target
stringlengths 5
300
| feat_repo_name
stringlengths 6
76
| text
stringlengths 26
1.05M
|
---|---|---|
ajax/libs/6to5/1.12.25/browser-polyfill.js | tresni/cdnjs | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){if(typeof Symbol==="undefined"){require("es6-symbol/implement")}require("es6-shim");require("./transformation/transformers/generators/runtime")},{"./transformation/transformers/generators/runtime":2,"es6-shim":4,"es6-symbol/implement":5}],2:[function(require,module,exports){(function(global){var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var runtime=global.regeneratorRuntime=exports;var hasOwn=Object.prototype.hasOwnProperty;var wrap=runtime.wrap=function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])};var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};var GF=function GeneratorFunction(){};var GFp=function GeneratorFunctionPrototype(){};var Gp=GFp.prototype=Generator.prototype;(GFp.constructor=GF).prototype=Gp.constructor=GFp;var GFName="GeneratorFunction";if(GF.name!==GFName)GF.name=GFName;if(GF.name!==GFName)throw new Error(GFName+" renamed?");runtime.isGeneratorFunction=function(genFun){var ctor=genFun&&genFun.constructor;return ctor?GF.name===ctor.name:false};runtime.mark=function(genFun){genFun.__proto__=GFp;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){var info;var value;try{info=this(arg);value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){throw new Error("Generator has already finished")}while(true){var delegate=context.delegate;var info;if(delegate){try{info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){var iterator=iterable;if(iteratorSymbol in iterable){iterator=iterable[iteratorSymbol]()}else if(!isNaN(iterable.length)){var i=-1;iterator=function next(){while(++i<iterable.length){if(i in iterable){next.value=iterable[i];next.done=false;return next}}next.done=true;return next};iterator.next=iterator}return iterator}runtime.values=values;Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;var thrown;if(record.type==="throw"){thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],3:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){(function(process){(function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.returnExports=factory()}})(this,function(){"use strict";var isCallableWithoutNew=function(func){try{func()}catch(e){return false}return true};var supportsSubclassing=function(C,f){try{var Sub=function(){C.apply(this,arguments)};if(!Sub.__proto__){return false}Object.setPrototypeOf(Sub,C);Sub.prototype=Object.create(C.prototype,{constructor:{value:C}});return f(Sub)}catch(e){return false}};var arePropertyDescriptorsSupported=function(){try{Object.defineProperty({},"x",{});return true}catch(e){return false}};var startsWithRejectsRegex=function(){var rejectsRegex=false;if(String.prototype.startsWith){try{"/a/".startsWith(/a/)}catch(e){rejectsRegex=true}}return rejectsRegex};var getGlobal=new Function("return this;");var globals=getGlobal();var global_isFinite=globals.isFinite;var supportsDescriptors=!!Object.defineProperty&&arePropertyDescriptorsSupported();var startsWithIsCompliant=startsWithRejectsRegex();var _slice=Array.prototype.slice;var _indexOf=String.prototype.indexOf;var _toString=Object.prototype.toString;var _hasOwnProperty=Object.prototype.hasOwnProperty;var ArrayIterator;var defineProperty=function(object,name,value,force){if(!force&&name in object){return}if(supportsDescriptors){Object.defineProperty(object,name,{configurable:true,enumerable:false,writable:true,value:value})}else{object[name]=value}};var defineProperties=function(object,map){Object.keys(map).forEach(function(name){var method=map[name];defineProperty(object,name,method,false)})};var create=Object.create||function(prototype,properties){function Type(){}Type.prototype=prototype;var object=new Type;if(typeof properties!=="undefined"){defineProperties(object,properties)}return object};var $iterator$=typeof Symbol==="function"&&Symbol.iterator||"_es6shim_iterator_";if(globals.Set&&typeof(new globals.Set)["@@iterator"]==="function"){$iterator$="@@iterator"}var addIterator=function(prototype,impl){if(!impl){impl=function iterator(){return this}}var o={};o[$iterator$]=impl;defineProperties(prototype,o);if(!prototype[$iterator$]&&typeof $iterator$==="symbol"){prototype[$iterator$]=impl}};var isArguments=function isArguments(value){var str=_toString.call(value);var result=str==="[object Arguments]";if(!result){result=str!=="[object Array]"&&value!==null&&typeof value==="object"&&typeof value.length==="number"&&value.length>=0&&_toString.call(value.callee)==="[object Function]"}return result};var emulateES6construct=function(o){if(!ES.TypeIsObject(o)){throw new TypeError("bad object")}if(!o._es6construct){if(o.constructor&&ES.IsCallable(o.constructor["@@create"])){o=o.constructor["@@create"](o)}defineProperties(o,{_es6construct:true})}return o};var ES={CheckObjectCoercible:function(x,optMessage){if(x==null){throw new TypeError(optMessage||"Cannot call method on "+x)}return x},TypeIsObject:function(x){return x!=null&&Object(x)===x},ToObject:function(o,optMessage){return Object(ES.CheckObjectCoercible(o,optMessage))},IsCallable:function(x){return typeof x==="function"&&_toString.call(x)==="[object Function]"},ToInt32:function(x){return x>>0},ToUint32:function(x){return x>>>0},ToInteger:function(value){var number=+value;if(Number.isNaN(number)){return 0}if(number===0||!Number.isFinite(number)){return number}return(number>0?1:-1)*Math.floor(Math.abs(number))},ToLength:function(value){var len=ES.ToInteger(value);if(len<=0){return 0}if(len>Number.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return len},SameValue:function(a,b){if(a===b){if(a===0){return 1/a===1/b}return true}return Number.isNaN(a)&&Number.isNaN(b)},SameValueZero:function(a,b){return a===b||Number.isNaN(a)&&Number.isNaN(b)},IsIterable:function(o){return ES.TypeIsObject(o)&&(typeof o[$iterator$]!=="undefined"||isArguments(o))},GetIterator:function(o){if(isArguments(o)){return new ArrayIterator(o,"value")}var itFn=o[$iterator$];if(!ES.IsCallable(itFn)){throw new TypeError("value is not an iterable")}var it=itFn.call(o);if(!ES.TypeIsObject(it)){throw new TypeError("bad iterator")}return it},IteratorNext:function(it){var result=arguments.length>1?it.next(arguments[1]):it.next();if(!ES.TypeIsObject(result)){throw new TypeError("bad iterator")}return result},Construct:function(C,args){var obj;if(ES.IsCallable(C["@@create"])){obj=C["@@create"]()}else{obj=create(C.prototype||null)}defineProperties(obj,{_es6construct:true});var result=C.apply(obj,args);return ES.TypeIsObject(result)?result:obj}};var numberConversion=function(){function roundToEven(n){var w=Math.floor(n),f=n-w;if(f<.5){return w}if(f>.5){return w+1}return w%2?w+1:w}function packIEEE754(v,ebits,fbits){var bias=(1<<ebits-1)-1,s,e,f,i,bits,str,bytes;if(v!==v){e=(1<<ebits)-1;f=Math.pow(2,fbits-1);s=0}else if(v===Infinity||v===-Infinity){e=(1<<ebits)-1;f=0;s=v<0?1:0}else if(v===0){e=0;f=0;s=1/v===-Infinity?1:0}else{s=v<0;v=Math.abs(v);if(v>=Math.pow(2,1-bias)){e=Math.min(Math.floor(Math.log(v)/Math.LN2),1023);f=roundToEven(v/Math.pow(2,e)*Math.pow(2,fbits));if(f/Math.pow(2,fbits)>=2){e=e+1;f=1}if(e>bias){e=(1<<ebits)-1;f=0}else{e=e+bias;f=f-Math.pow(2,fbits)}}else{e=0;f=roundToEven(v/Math.pow(2,1-bias-fbits))}}bits=[];for(i=fbits;i;i-=1){bits.push(f%2?1:0);f=Math.floor(f/2)}for(i=ebits;i;i-=1){bits.push(e%2?1:0);e=Math.floor(e/2)}bits.push(s?1:0);bits.reverse();str=bits.join("");bytes=[];while(str.length){bytes.push(parseInt(str.slice(0,8),2));str=str.slice(8)}return bytes}function unpackIEEE754(bytes,ebits,fbits){var bits=[],i,j,b,str,bias,s,e,f;for(i=bytes.length;i;i-=1){b=bytes[i-1];for(j=8;j;j-=1){bits.push(b%2?1:0);b=b>>1}}bits.reverse();str=bits.join("");bias=(1<<ebits-1)-1;s=parseInt(str.slice(0,1),2)?-1:1;e=parseInt(str.slice(1,1+ebits),2);f=parseInt(str.slice(1+ebits),2);if(e===(1<<ebits)-1){return f!==0?NaN:s*Infinity}else if(e>0){return s*Math.pow(2,e-bias)*(1+f/Math.pow(2,fbits))}else if(f!==0){return s*Math.pow(2,-(bias-1))*(f/Math.pow(2,fbits))}else{return s<0?-0:0}}function unpackFloat64(b){return unpackIEEE754(b,11,52)}function packFloat64(v){return packIEEE754(v,11,52)}function unpackFloat32(b){return unpackIEEE754(b,8,23)}function packFloat32(v){return packIEEE754(v,8,23)}var conversions={toFloat32:function(num){return unpackFloat32(packFloat32(num))}};if(typeof Float32Array!=="undefined"){var float32array=new Float32Array(1);conversions.toFloat32=function(num){float32array[0]=num;return float32array[0]}}return conversions}();defineProperties(String,{fromCodePoint:function(_){var points=_slice.call(arguments,0,arguments.length);var result=[];var next;for(var i=0,length=points.length;i<length;i++){next=Number(points[i]);if(!ES.SameValue(next,ES.ToInteger(next))||next<0||next>1114111){throw new RangeError("Invalid code point "+next)}if(next<65536){result.push(String.fromCharCode(next))}else{next-=65536;result.push(String.fromCharCode((next>>10)+55296));result.push(String.fromCharCode(next%1024+56320))}}return result.join("")},raw:function(callSite){var substitutions=_slice.call(arguments,1,arguments.length);var cooked=ES.ToObject(callSite,"bad callSite");var rawValue=cooked.raw;var raw=ES.ToObject(rawValue,"bad raw value");var len=Object.keys(raw).length;var literalsegments=ES.ToLength(len);if(literalsegments===0){return""}var stringElements=[];var nextIndex=0;var nextKey,next,nextSeg,nextSub;while(nextIndex<literalsegments){nextKey=String(nextIndex);next=raw[nextKey];nextSeg=String(next);stringElements.push(nextSeg);if(nextIndex+1>=literalsegments){break}next=substitutions[nextKey];if(typeof next==="undefined"){break}nextSub=String(next);stringElements.push(nextSub);nextIndex++}return stringElements.join("")}});if(String.fromCodePoint.length!==1){var originalFromCodePoint=String.fromCodePoint;defineProperty(String,"fromCodePoint",function(_){return originalFromCodePoint.apply(this,arguments)},true)}var StringShims={repeat:function(){var repeat=function(s,times){if(times<1){return""}if(times%2){return repeat(s,times-1)+s}var half=repeat(s,times/2);return half+half};return function(times){var thisStr=String(ES.CheckObjectCoercible(this));times=ES.ToInteger(times);if(times<0||times===Infinity){throw new RangeError("Invalid String#repeat value")}return repeat(thisStr,times)}}(),startsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "startsWith" with a regex')}searchStr=String(searchStr);var startArg=arguments.length>1?arguments[1]:void 0;var start=Math.max(ES.ToInteger(startArg),0);return thisStr.slice(start,start+searchStr.length)===searchStr},endsWith:function(searchStr){var thisStr=String(ES.CheckObjectCoercible(this));if(_toString.call(searchStr)==="[object RegExp]"){throw new TypeError('Cannot call method "endsWith" with a regex')}searchStr=String(searchStr);var thisLen=thisStr.length;var posArg=arguments.length>1?arguments[1]:void 0;var pos=typeof posArg==="undefined"?thisLen:ES.ToInteger(posArg);var end=Math.min(Math.max(pos,0),thisLen);return thisStr.slice(end-searchStr.length,end)===searchStr},contains:function(searchString){var position=arguments.length>1?arguments[1]:void 0;return _indexOf.call(this,searchString,position)!==-1},codePointAt:function(pos){var thisStr=String(ES.CheckObjectCoercible(this));var position=ES.ToInteger(pos);var length=thisStr.length;if(position<0||position>=length){return}var first=thisStr.charCodeAt(position);var isEnd=position+1===length;if(first<55296||first>56319||isEnd){return first}var second=thisStr.charCodeAt(position+1);if(second<56320||second>57343){return first}return(first-55296)*1024+(second-56320)+65536}};defineProperties(String.prototype,StringShims);var hasStringTrimBug="
".trim().length!==1;if(hasStringTrimBug){var originalStringTrim=String.prototype.trim;delete String.prototype.trim;var ws=[" \n\f\r "," \u2028","\u2029"].join("");var trimRegexp=new RegExp("(^["+ws+"]+)|(["+ws+"]+$)","g");defineProperties(String.prototype,{trim:function(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(trimRegexp,"")}})}var StringIterator=function(s){this._s=String(ES.CheckObjectCoercible(s));this._i=0};StringIterator.prototype.next=function(){var s=this._s,i=this._i;if(typeof s==="undefined"||i>=s.length){this._s=void 0;return{value:void 0,done:true}}var first=s.charCodeAt(i),second,len;if(first<55296||first>56319||i+1==s.length){len=1}else{second=s.charCodeAt(i+1);len=second<56320||second>57343?1:2}this._i=i+len;return{value:s.substr(i,len),done:false}};addIterator(StringIterator.prototype);addIterator(String.prototype,function(){return new StringIterator(this)});if(!startsWithIsCompliant){String.prototype.startsWith=StringShims.startsWith;String.prototype.endsWith=StringShims.endsWith}var ArrayShims={from:function(iterable){var mapFn=arguments.length>1?arguments[1]:void 0;var list=ES.ToObject(iterable,"bad iterable");if(typeof mapFn!=="undefined"&&!ES.IsCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}var hasThisArg=arguments.length>2;var thisArg=hasThisArg?arguments[2]:void 0;var usingIterator=ES.IsIterable(list);var length;var result,i,value;if(usingIterator){i=0;result=ES.IsCallable(this)?Object(new this):[];var it=usingIterator?ES.GetIterator(list):null;var iterationValue;do{iterationValue=ES.IteratorNext(it);if(!iterationValue.done){value=iterationValue.value;if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}i+=1}}while(!iterationValue.done);length=i}else{length=ES.ToLength(list.length);result=ES.IsCallable(this)?Object(new this(length)):new Array(length);for(i=0;i<length;++i){value=list[i];if(mapFn){result[i]=hasThisArg?mapFn.call(thisArg,value,i):mapFn(value,i)}else{result[i]=value}}}result.length=length;return result},of:function(){return Array.from(arguments)}};defineProperties(Array,ArrayShims);var arrayFromSwallowsNegativeLengths=function(){try{return Array.from({length:-1}).length===0}catch(e){return false}};if(!arrayFromSwallowsNegativeLengths()){defineProperty(Array,"from",ArrayShims.from,true)}ArrayIterator=function(array,kind){this.i=0;this.array=array;this.kind=kind};defineProperties(ArrayIterator.prototype,{next:function(){var i=this.i,array=this.array;if(!(this instanceof ArrayIterator)){throw new TypeError("Not an ArrayIterator")}if(typeof array!=="undefined"){var len=ES.ToLength(array.length);for(;i<len;i++){var kind=this.kind;var retval;if(kind==="key"){retval=i}else if(kind==="value"){retval=array[i]}else if(kind==="entry"){retval=[i,array[i]]}this.i=i+1;return{value:retval,done:false}}}this.array=void 0;return{value:void 0,done:true}}});addIterator(ArrayIterator.prototype);var ArrayPrototypeShims={copyWithin:function(target,start){var end=arguments[2];var o=ES.ToObject(this);var len=ES.ToLength(o.length);target=ES.ToInteger(target);start=ES.ToInteger(start);var to=target<0?Math.max(len+target,0):Math.min(target,len);var from=start<0?Math.max(len+start,0):Math.min(start,len);end=typeof end==="undefined"?len:ES.ToInteger(end);var fin=end<0?Math.max(len+end,0):Math.min(end,len);var count=Math.min(fin-from,len-to);var direction=1;if(from<to&&to<from+count){direction=-1;from+=count-1;to+=count-1}while(count>0){if(_hasOwnProperty.call(o,from)){o[to]=o[from]}else{delete o[from]}from+=direction;to+=direction;count-=1}return o},fill:function(value){var start=arguments.length>1?arguments[1]:void 0;var end=arguments.length>2?arguments[2]:void 0;var O=ES.ToObject(this);var len=ES.ToLength(O.length);start=ES.ToInteger(typeof start==="undefined"?0:start);end=ES.ToInteger(typeof end==="undefined"?len:end);var relativeStart=start<0?Math.max(len+start,0):Math.min(start,len);var relativeEnd=end<0?len+end:end;for(var i=relativeStart;i<len&&i<relativeEnd;++i){O[i]=value}return O},find:function find(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#find: predicate must be a function")}var thisArg=arguments[1];for(var i=0,value;i<length;i++){value=list[i];if(predicate.call(thisArg,value,i,list)){return value}}return},findIndex:function findIndex(predicate){var list=ES.ToObject(this);var length=ES.ToLength(list.length);if(!ES.IsCallable(predicate)){throw new TypeError("Array#findIndex: predicate must be a function")}var thisArg=arguments[1];for(var i=0;i<length;i++){if(predicate.call(thisArg,list[i],i,list)){return i}}return-1},keys:function(){return new ArrayIterator(this,"key")},values:function(){return new ArrayIterator(this,"value")},entries:function(){return new ArrayIterator(this,"entry")}};if(Array.prototype.keys&&!ES.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!ES.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[$iterator$]){defineProperties(Array.prototype,{values:Array.prototype[$iterator$]})}defineProperties(Array.prototype,ArrayPrototypeShims);addIterator(Array.prototype,function(){return this.values()});if(Object.getPrototypeOf){addIterator(Object.getPrototypeOf([].values()))}var maxSafeInteger=Math.pow(2,53)-1;defineProperties(Number,{MAX_SAFE_INTEGER:maxSafeInteger,MIN_SAFE_INTEGER:-maxSafeInteger,EPSILON:2.220446049250313e-16,parseInt:globals.parseInt,parseFloat:globals.parseFloat,isFinite:function(value){return typeof value==="number"&&global_isFinite(value)},isInteger:function(value){return Number.isFinite(value)&&ES.ToInteger(value)===value},isSafeInteger:function(value){return Number.isInteger(value)&&Math.abs(value)<=Number.MAX_SAFE_INTEGER},isNaN:function(value){return value!==value}});if(![,1].find(function(item,idx){return idx===0})){defineProperty(Array.prototype,"find",ArrayPrototypeShims.find,true)}if([,1].findIndex(function(item,idx){return idx===0})!==0){defineProperty(Array.prototype,"findIndex",ArrayPrototypeShims.findIndex,true)}if(supportsDescriptors){defineProperties(Object,{getPropertyDescriptor:function(subject,name){var pd=Object.getOwnPropertyDescriptor(subject,name);var proto=Object.getPrototypeOf(subject);while(typeof pd==="undefined"&&proto!==null){pd=Object.getOwnPropertyDescriptor(proto,name);proto=Object.getPrototypeOf(proto)}return pd},getPropertyNames:function(subject){var result=Object.getOwnPropertyNames(subject);var proto=Object.getPrototypeOf(subject);var addProperty=function(property){if(result.indexOf(property)===-1){result.push(property)}};while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto)}return result}});defineProperties(Object,{assign:function(target,source){if(!ES.TypeIsObject(target)){throw new TypeError("target must be an object")}return Array.prototype.reduce.call(arguments,function(target,source){return Object.keys(Object(source)).reduce(function(target,key){target[key]=source[key];return target},target)})},is:function(a,b){return ES.SameValue(a,b)},setPrototypeOf:function(Object,magic){var set;var checkArgs=function(O,proto){if(!ES.TypeIsObject(O)){throw new TypeError("cannot set prototype on a non-object")}if(!(proto===null||ES.TypeIsObject(proto))){throw new TypeError("can only set prototype to an object or null"+proto)}};var setPrototypeOf=function(O,proto){checkArgs(O,proto);set.call(O,proto);return O};try{set=Object.getOwnPropertyDescriptor(Object.prototype,magic).set;set.call({},null)}catch(e){if(Object.prototype!=={}[magic]){return}set=function(proto){this[magic]=proto};setPrototypeOf.polyfill=setPrototypeOf(setPrototypeOf({},null),Object.prototype)instanceof Object}return setPrototypeOf}(Object,"__proto__")})}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var FAKENULL=Object.create(null);var gpo=Object.getPrototypeOf,spo=Object.setPrototypeOf;Object.getPrototypeOf=function(o){var result=gpo(o);return result===FAKENULL?null:result};Object.setPrototypeOf=function(o,p){if(p===null){p=FAKENULL}return spo(o,p)};Object.setPrototypeOf.polyfill=false})()}try{Object.keys("foo")}catch(e){var originalObjectKeys=Object.keys;Object.keys=function(obj){return originalObjectKeys(ES.ToObject(obj))}}var MathShims={acosh:function(value){value=Number(value);if(Number.isNaN(value)||value<1){return NaN}if(value===1){return 0}if(value===Infinity){return value}return Math.log(value+Math.sqrt(value*value-1))},asinh:function(value){value=Number(value);if(value===0||!global_isFinite(value)){return value}return value<0?-Math.asinh(-value):Math.log(value+Math.sqrt(value*value+1))},atanh:function(value){value=Number(value);if(Number.isNaN(value)||value<-1||value>1){return NaN}if(value===-1){return-Infinity}if(value===1){return Infinity}if(value===0){return value}return.5*Math.log((1+value)/(1-value))},cbrt:function(value){value=Number(value);if(value===0){return value}var negate=value<0,result;if(negate){value=-value}result=Math.pow(value,1/3);return negate?-result:result},clz32:function(value){value=Number(value);var number=ES.ToUint32(value);if(number===0){return 32}return 32-number.toString(2).length},cosh:function(value){value=Number(value);if(value===0){return 1}if(Number.isNaN(value)){return NaN}if(!global_isFinite(value)){return Infinity}if(value<0){value=-value}if(value>21){return Math.exp(value)/2}return(Math.exp(value)+Math.exp(-value))/2},expm1:function(value){value=Number(value);if(value===-Infinity){return-1}if(!global_isFinite(value)||value===0){return value}return Math.exp(value)-1},hypot:function(x,y){var anyNaN=false;var allZero=true;var anyInfinity=false;var numbers=[];Array.prototype.every.call(arguments,function(arg){var num=Number(arg);if(Number.isNaN(num)){anyNaN=true}else if(num===Infinity||num===-Infinity){anyInfinity=true}else if(num!==0){allZero=false}if(anyInfinity){return false}else if(!anyNaN){numbers.push(Math.abs(num))}return true});if(anyInfinity){return Infinity}if(anyNaN){return NaN}if(allZero){return 0}numbers.sort(function(a,b){return b-a});var largest=numbers[0];var divided=numbers.map(function(number){return number/largest});var sum=divided.reduce(function(sum,number){return sum+=number*number},0);return largest*Math.sqrt(sum)},log2:function(value){return Math.log(value)*Math.LOG2E},log10:function(value){return Math.log(value)*Math.LOG10E},log1p:function(value){value=Number(value);if(value<-1||Number.isNaN(value)){return NaN}if(value===0||value===Infinity){return value}if(value===-1){return-Infinity}var result=0;var n=50;if(value<0||value>1){return Math.log(1+value)}for(var i=1;i<n;i++){if(i%2===0){result-=Math.pow(value,i)/i}else{result+=Math.pow(value,i)/i}}return result},sign:function(value){var number=+value;if(number===0){return number}if(Number.isNaN(number)){return number}return number<0?-1:1},sinh:function(value){value=Number(value);if(!global_isFinite(value)||value===0){return value}return(Math.exp(value)-Math.exp(-value))/2},tanh:function(value){value=Number(value);if(Number.isNaN(value)||value===0){return value}if(value===Infinity){return 1}if(value===-Infinity){return-1}return(Math.exp(value)-Math.exp(-value))/(Math.exp(value)+Math.exp(-value))},trunc:function(value){var number=Number(value);return number<0?-Math.floor(-number):Math.floor(number)},imul:function(x,y){x=ES.ToUint32(x);y=ES.ToUint32(y);var ah=x>>>16&65535;var al=x&65535;var bh=y>>>16&65535;var bl=y&65535;return al*bl+(ah*bl+al*bh<<16>>>0)|0},fround:function(x){if(x===0||x===Infinity||x===-Infinity||Number.isNaN(x)){return x}var num=Number(x);return numberConversion.toFloat32(num)}};defineProperties(Math,MathShims);if(Math.imul(4294967295,5)!==-5){Math.imul=MathShims.imul}var PromiseShim=function(){var Promise,Promise$prototype;ES.IsPromise=function(promise){if(!ES.TypeIsObject(promise)){return false}if(!promise._promiseConstructor){return false}if(typeof promise._status==="undefined"){return false}return true};var PromiseCapability=function(C){if(!ES.IsCallable(C)){throw new TypeError("bad promise constructor")}var capability=this;var resolver=function(resolve,reject){capability.resolve=resolve;capability.reject=reject};capability.promise=ES.Construct(C,[resolver]);if(!capability.promise._es6construct){throw new TypeError("bad promise constructor")}if(!(ES.IsCallable(capability.resolve)&&ES.IsCallable(capability.reject))){throw new TypeError("bad promise constructor")}};var setTimeout=globals.setTimeout;var makeZeroTimeout;if(typeof window!=="undefined"&&ES.IsCallable(window.postMessage)){makeZeroTimeout=function(){var timeouts=[];
var messageName="zero-timeout-message";var setZeroTimeout=function(fn){timeouts.push(fn);window.postMessage(messageName,"*")};var handleMessage=function(event){if(event.source==window&&event.data==messageName){event.stopPropagation();if(timeouts.length===0){return}var fn=timeouts.shift();fn()}};window.addEventListener("message",handleMessage,true);return setZeroTimeout}}var makePromiseAsap=function(){var P=globals.Promise;return P&&P.resolve&&function(task){return P.resolve().then(task)}};var enqueue=ES.IsCallable(globals.setImmediate)?globals.setImmediate.bind(globals):typeof process==="object"&&process.nextTick?process.nextTick:makePromiseAsap()||(ES.IsCallable(makeZeroTimeout)?makeZeroTimeout():function(task){setTimeout(task,0)});var triggerPromiseReactions=function(reactions,x){reactions.forEach(function(reaction){enqueue(function(){var handler=reaction.handler;var capability=reaction.capability;var resolve=capability.resolve;var reject=capability.reject;try{var result=handler(x);if(result===capability.promise){throw new TypeError("self resolution")}var updateResult=updatePromiseFromPotentialThenable(result,capability);if(!updateResult){resolve(result)}}catch(e){reject(e)}})})};var updatePromiseFromPotentialThenable=function(x,capability){if(!ES.TypeIsObject(x)){return false}var resolve=capability.resolve;var reject=capability.reject;try{var then=x.then;if(!ES.IsCallable(then)){return false}then.call(x,resolve,reject)}catch(e){reject(e)}return true};var promiseResolutionHandler=function(promise,onFulfilled,onRejected){return function(x){if(x===promise){return onRejected(new TypeError("self resolution"))}var C=promise._promiseConstructor;var capability=new PromiseCapability(C);var updateResult=updatePromiseFromPotentialThenable(x,capability);if(updateResult){return capability.promise.then(onFulfilled,onRejected)}else{return onFulfilled(x)}}};Promise=function(resolver){var promise=this;promise=emulateES6construct(promise);if(!promise._promiseConstructor){throw new TypeError("bad promise")}if(typeof promise._status!=="undefined"){throw new TypeError("promise already initialized")}if(!ES.IsCallable(resolver)){throw new TypeError("not a valid resolver")}promise._status="unresolved";promise._resolveReactions=[];promise._rejectReactions=[];var resolve=function(resolution){if(promise._status!=="unresolved"){return}var reactions=promise._resolveReactions;promise._result=resolution;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-resolution";triggerPromiseReactions(reactions,resolution)};var reject=function(reason){if(promise._status!=="unresolved"){return}var reactions=promise._rejectReactions;promise._result=reason;promise._resolveReactions=void 0;promise._rejectReactions=void 0;promise._status="has-rejection";triggerPromiseReactions(reactions,reason)};try{resolver(resolve,reject)}catch(e){reject(e)}return promise};Promise$prototype=Promise.prototype;defineProperties(Promise,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Promise$prototype;obj=obj||create(prototype);defineProperties(obj,{_status:void 0,_result:void 0,_resolveReactions:void 0,_rejectReactions:void 0,_promiseConstructor:void 0});obj._promiseConstructor=constructor;return obj}});var _promiseAllResolver=function(index,values,capability,remaining){var done=false;return function(x){if(done){return}done=true;values[index]=x;if(--remaining.count===0){var resolve=capability.resolve;resolve(values)}}};Promise.all=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);var values=[],remaining={count:1};for(var index=0;;index++){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);var resolveElement=_promiseAllResolver(index,values,capability,remaining);remaining.count++;nextPromise.then(resolveElement,capability.reject)}if(--remaining.count===0){resolve(values)}}catch(e){reject(e)}return capability.promise};Promise.race=function(iterable){var C=this;var capability=new PromiseCapability(C);var resolve=capability.resolve;var reject=capability.reject;try{if(!ES.IsIterable(iterable)){throw new TypeError("bad iterable")}var it=ES.GetIterator(iterable);while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextPromise=C.resolve(next.value);nextPromise.then(resolve,reject)}}catch(e){reject(e)}return capability.promise};Promise.reject=function(reason){var C=this;var capability=new PromiseCapability(C);var reject=capability.reject;reject(reason);return capability.promise};Promise.resolve=function(v){var C=this;if(ES.IsPromise(v)){var constructor=v._promiseConstructor;if(constructor===C){return v}}var capability=new PromiseCapability(C);var resolve=capability.resolve;resolve(v);return capability.promise};Promise.prototype["catch"]=function(onRejected){return this.then(void 0,onRejected)};Promise.prototype.then=function(onFulfilled,onRejected){var promise=this;if(!ES.IsPromise(promise)){throw new TypeError("not a promise")}var C=this.constructor;var capability=new PromiseCapability(C);if(!ES.IsCallable(onRejected)){onRejected=function(e){throw e}}if(!ES.IsCallable(onFulfilled)){onFulfilled=function(x){return x}}var resolutionHandler=promiseResolutionHandler(promise,onFulfilled,onRejected);var resolveReaction={capability:capability,handler:resolutionHandler};var rejectReaction={capability:capability,handler:onRejected};switch(promise._status){case"unresolved":promise._resolveReactions.push(resolveReaction);promise._rejectReactions.push(rejectReaction);break;case"has-resolution":triggerPromiseReactions([resolveReaction],promise._result);break;case"has-rejection":triggerPromiseReactions([rejectReaction],promise._result);break;default:throw new TypeError("unexpected")}return capability.promise};return Promise}();defineProperties(globals,{Promise:PromiseShim});var promiseSupportsSubclassing=supportsSubclassing(globals.Promise,function(S){return S.resolve(42)instanceof S});var promiseIgnoresNonFunctionThenCallbacks=function(){try{globals.Promise.reject(42).then(null,5).then(null,function(){});return true}catch(ex){return false}}();var promiseRequiresObjectContext=function(){try{Promise.call(3,function(){})}catch(e){return true}return false}();if(!promiseSupportsSubclassing||!promiseIgnoresNonFunctionThenCallbacks||!promiseRequiresObjectContext){globals.Promise=PromiseShim}var testOrder=function(a){var b=Object.keys(a.reduce(function(o,k){o[k]=true;return o},{}));return a.join(":")===b.join(":")};var preservesInsertionOrder=testOrder(["z","a","bb"]);var preservesNumericInsertionOrder=testOrder(["z",1,"a","3",2]);if(supportsDescriptors){var fastkey=function fastkey(key){if(!preservesInsertionOrder){return null}var type=typeof key;if(type==="string"){return"$"+key}else if(type==="number"){if(!preservesNumericInsertionOrder){return"n"+key}return key}return null};var emptyObject=function emptyObject(){return Object.create?Object.create(null):{}};var collectionShims={Map:function(){var empty={};function MapEntry(key,value){this.key=key;this.value=value;this.next=null;this.prev=null}MapEntry.prototype.isRemoved=function(){return this.key===empty};function MapIterator(map,kind){this.head=map._head;this.i=this.head;this.kind=kind}MapIterator.prototype={next:function(){var i=this.i,kind=this.kind,head=this.head,result;if(typeof this.i==="undefined"){return{value:void 0,done:true}}while(i.isRemoved()&&i!==head){i=i.prev}while(i.next!==head){i=i.next;if(!i.isRemoved()){if(kind==="key"){result=i.key}else if(kind==="value"){result=i.value}else{result=[i.key,i.value]}this.i=i;return{value:result,done:false}}}this.i=void 0;return{value:void 0,done:true}}};addIterator(MapIterator.prototype);function Map(iterable){var map=this;if(!ES.TypeIsObject(map)){throw new TypeError("Map does not accept arguments when called as a function")}map=emulateES6construct(map);if(!map._es6map){throw new TypeError("bad map")}var head=new MapEntry(null,null);head.next=head.prev=head;defineProperties(map,{_head:head,_storage:emptyObject(),_size:0});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=map.set;if(!ES.IsCallable(adder)){throw new TypeError("bad map")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;if(!ES.TypeIsObject(nextItem)){throw new TypeError("expected iterable of pairs")}adder.call(map,nextItem[0],nextItem[1])}}return map}var Map$prototype=Map.prototype;defineProperties(Map,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Map$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6map:true});return obj}});Object.defineProperty(Map.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._size==="undefined"){throw new TypeError("size method called on incompatible Map")}return this._size}});defineProperties(Map.prototype,{get:function(key){var fkey=fastkey(key);if(fkey!==null){var entry=this._storage[fkey];if(entry){return entry.value}else{return}}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return i.value}}return},has:function(key){var fkey=fastkey(key);if(fkey!==null){return typeof this._storage[fkey]!=="undefined"}var head=this._head,i=head;while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){return true}}return false},set:function(key,value){var head=this._head,i=head,entry;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]!=="undefined"){this._storage[fkey].value=value;return this}else{entry=this._storage[fkey]=new MapEntry(key,value);i=head.prev}}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.value=value;return this}}entry=entry||new MapEntry(key,value);if(ES.SameValue(-0,key)){entry.key=+0}entry.next=this._head;entry.prev=this._head.prev;entry.prev.next=entry;entry.next.prev=entry;this._size+=1;return this},"delete":function(key){var head=this._head,i=head;var fkey=fastkey(key);if(fkey!==null){if(typeof this._storage[fkey]==="undefined"){return false}i=this._storage[fkey].prev;delete this._storage[fkey]}while((i=i.next)!==head){if(ES.SameValueZero(i.key,key)){i.key=i.value=empty;i.prev.next=i.next;i.next.prev=i.prev;this._size-=1;return true}}return false},clear:function(){this._size=0;this._storage=emptyObject();var head=this._head,i=head,p=i.next;while((i=p)!==head){i.key=i.value=empty;p=i.next;i.next=i.prev=head}head.next=head.prev=head},keys:function(){return new MapIterator(this,"key")},values:function(){return new MapIterator(this,"value")},entries:function(){return new MapIterator(this,"key+value")},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var it=this.entries();for(var entry=it.next();!entry.done;entry=it.next()){callback.call(context,entry.value[1],entry.value[0],this)}}});addIterator(Map.prototype,function(){return this.entries()});return Map}(),Set:function(){var SetShim=function Set(iterable){var set=this;if(!ES.TypeIsObject(set)){throw new TypeError("Set does not accept arguments when called as a function")}set=emulateES6construct(set);if(!set._es6set){throw new TypeError("bad set")}defineProperties(set,{"[[SetData]]":null,_storage:emptyObject()});if(typeof iterable!=="undefined"&&iterable!==null){var it=ES.GetIterator(iterable);var adder=set.add;if(!ES.IsCallable(adder)){throw new TypeError("bad set")}while(true){var next=ES.IteratorNext(it);if(next.done){break}var nextItem=next.value;adder.call(set,nextItem)}}return set};var Set$prototype=SetShim.prototype;defineProperties(SetShim,{"@@create":function(obj){var constructor=this;var prototype=constructor.prototype||Set$prototype;obj=obj||create(prototype);defineProperties(obj,{_es6set:true});return obj}});var ensureMap=function ensureMap(set){if(!set["[[SetData]]"]){var m=set["[[SetData]]"]=new collectionShims.Map;Object.keys(set._storage).forEach(function(k){if(k.charCodeAt(0)===36){k=k.slice(1)}else if(k.charAt(0)==="n"){k=+k.slice(1)}else{k=+k}m.set(k,k)});set._storage=null}};Object.defineProperty(SetShim.prototype,"size",{configurable:true,enumerable:false,get:function(){if(typeof this._storage==="undefined"){throw new TypeError("size method called on incompatible Set")}ensureMap(this);return this["[[SetData]]"].size}});defineProperties(SetShim.prototype,{has:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){return!!this._storage[fkey]}ensureMap(this);return this["[[SetData]]"].has(key)},add:function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){this._storage[fkey]=true;return this}ensureMap(this);this["[[SetData]]"].set(key,key);return this},"delete":function(key){var fkey;if(this._storage&&(fkey=fastkey(key))!==null){var hasFKey=_hasOwnProperty.call(this._storage,fkey);return delete this._storage[fkey]&&hasFKey}ensureMap(this);return this["[[SetData]]"]["delete"](key)},clear:function(){if(this._storage){this._storage=emptyObject();return}return this["[[SetData]]"].clear()},keys:function(){ensureMap(this);return this["[[SetData]]"].keys()},values:function(){ensureMap(this);return this["[[SetData]]"].values()},entries:function(){ensureMap(this);return this["[[SetData]]"].entries()},forEach:function(callback){var context=arguments.length>1?arguments[1]:null;var entireSet=this;ensureMap(this);this["[[SetData]]"].forEach(function(value,key){callback.call(context,key,key,entireSet)})}});addIterator(SetShim.prototype,function(){return this.values()});return SetShim}()};defineProperties(globals,collectionShims);if(globals.Map||globals.Set){if(typeof globals.Map.prototype.clear!=="function"||(new globals.Set).size!==0||(new globals.Map).size!==0||typeof globals.Map.prototype.keys!=="function"||typeof globals.Set.prototype.keys!=="function"||typeof globals.Map.prototype.forEach!=="function"||typeof globals.Set.prototype.forEach!=="function"||isCallableWithoutNew(globals.Map)||isCallableWithoutNew(globals.Set)||!supportsSubclassing(globals.Map,function(M){var m=new M([]);m.set(42,42);return m instanceof M})){globals.Map=collectionShims.Map;globals.Set=collectionShims.Set}}addIterator(Object.getPrototypeOf((new globals.Map).keys()));addIterator(Object.getPrototypeOf((new globals.Set).keys()))}return globals})}).call(this,require("_process"))},{_process:3}],5:[function(require,module,exports){"use strict";if(!require("./is-implemented")()){Object.defineProperty(require("es5-ext/global"),"Symbol",{value:require("./polyfill"),configurable:true,enumerable:false,writable:true})}},{"./is-implemented":6,"./polyfill":21,"es5-ext/global":8}],6:[function(require,module,exports){"use strict";module.exports=function(){var symbol;if(typeof Symbol!=="function")return false;symbol=Symbol("test symbol");try{String(symbol)}catch(e){return false}if(typeof Symbol.iterator==="symbol")return true;if(typeof Symbol.isConcatSpreadable!=="object")return false;if(typeof Symbol.isRegExp!=="object")return false;if(typeof Symbol.iterator!=="object")return false;if(typeof Symbol.toPrimitive!=="object")return false;if(typeof Symbol.toStringTag!=="object")return false;if(typeof Symbol.unscopables!=="object")return false;return true}},{}],7:[function(require,module,exports){"use strict";var assign=require("es5-ext/object/assign"),normalizeOpts=require("es5-ext/object/normalize-options"),isCallable=require("es5-ext/object/is-callable"),contains=require("es5-ext/string/#/contains"),d;d=module.exports=function(dscr,value){var c,e,w,options,desc;if(arguments.length<2||typeof dscr!=="string"){options=value;value=dscr;dscr=null}else{options=arguments[2]}if(dscr==null){c=w=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e");w=contains.call(dscr,"w")}desc={value:value,configurable:c,enumerable:e,writable:w};return!options?desc:assign(normalizeOpts(options),desc)};d.gs=function(dscr,get,set){var c,e,options,desc;if(typeof dscr!=="string"){options=set;set=get;get=dscr;dscr=null}else{options=arguments[3]}if(get==null){get=undefined}else if(!isCallable(get)){options=get;get=set=undefined}else if(set==null){set=undefined}else if(!isCallable(set)){options=set;set=undefined}if(dscr==null){c=true;e=false}else{c=contains.call(dscr,"c");e=contains.call(dscr,"e")}desc={get:get,set:set,configurable:c,enumerable:e};return!options?desc:assign(normalizeOpts(options),desc)}},{"es5-ext/object/assign":9,"es5-ext/object/is-callable":12,"es5-ext/object/normalize-options":16,"es5-ext/string/#/contains":18}],8:[function(require,module,exports){"use strict";module.exports=new Function("return this")()},{}],9:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.assign:require("./shim")},{"./is-implemented":10,"./shim":11}],10:[function(require,module,exports){"use strict";module.exports=function(){var assign=Object.assign,obj;if(typeof assign!=="function")return false;obj={foo:"raz"};assign(obj,{bar:"dwa"},{trzy:"trzy"});return obj.foo+obj.bar+obj.trzy==="razdwatrzy"}},{}],11:[function(require,module,exports){"use strict";var keys=require("../keys"),value=require("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,l=max(arguments.length,2),assign;dest=Object(value(dest));assign=function(key){try{dest[key]=src[key]}catch(e){if(!error)error=e}};for(i=1;i<l;++i){src=arguments[i];keys(src).forEach(assign)}if(error!==undefined)throw error;return dest}},{"../keys":13,"../valid-value":17}],12:[function(require,module,exports){"use strict";module.exports=function(obj){return typeof obj==="function"}},{}],13:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?Object.keys:require("./shim")},{"./is-implemented":14,"./shim":15}],14:[function(require,module,exports){"use strict";module.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},{}],15:[function(require,module,exports){"use strict";var keys=Object.keys;module.exports=function(object){return keys(object==null?object:Object(object))}},{}],16:[function(require,module,exports){"use strict";var assign=require("./assign"),forEach=Array.prototype.forEach,create=Object.create,getPrototypeOf=Object.getPrototypeOf,process;process=function(src,obj){var proto=getPrototypeOf(src);return assign(proto?process(proto,obj):obj,src)};module.exports=function(options){var result=create(null);forEach.call(arguments,function(options){if(options==null)return;process(Object(options),result)});return result}},{"./assign":9}],17:[function(require,module,exports){"use strict";module.exports=function(value){if(value==null)throw new TypeError("Cannot use null or undefined");return value}},{}],18:[function(require,module,exports){"use strict";module.exports=require("./is-implemented")()?String.prototype.contains:require("./shim")},{"./is-implemented":19,"./shim":20}],19:[function(require,module,exports){"use strict";var str="razdwatrzy";module.exports=function(){if(typeof str.contains!=="function")return false;return str.contains("dwa")===true&&str.contains("foo")===false}},{}],20:[function(require,module,exports){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],21:[function(require,module,exports){"use strict";var d=require("d"),create=Object.create,defineProperties=Object.defineProperties,generateName,Symbol;generateName=function(){var created=create(null);return function(desc){var postfix=0;while(created[desc+(postfix||"")])++postfix;desc+=postfix||"";created[desc]=true;return"@@"+desc}}();module.exports=Symbol=function(description){var symbol;if(this instanceof Symbol){throw new TypeError("TypeError: Symbol is not a constructor")}symbol=create(Symbol.prototype);description=description===undefined?"":String(description);return defineProperties(symbol,{__description__:d("",description),__name__:d("",generateName(description))})};Object.defineProperties(Symbol,{create:d("",Symbol("create")),hasInstance:d("",Symbol("hasInstance")),isConcatSpreadable:d("",Symbol("isConcatSpreadable")),isRegExp:d("",Symbol("isRegExp")),iterator:d("",Symbol("iterator")),toPrimitive:d("",Symbol("toPrimitive")),toStringTag:d("",Symbol("toStringTag")),unscopables:d("",Symbol("unscopables"))});defineProperties(Symbol.prototype,{properToString:d(function(){return"Symbol ("+this.__description__+")"}),toString:d("",function(){return this.__name__})});Object.defineProperty(Symbol.prototype,Symbol.toPrimitive,d("",function(hint){throw new TypeError("Conversion of symbol objects is not allowed")}));Object.defineProperty(Symbol.prototype,Symbol.toStringTag,d("c","Symbol"))},{d:7}]},{},[1]); |
ui-react/src/index.js | agliznetsov/sputnik | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('root')
);
|
ajax/libs/react-slick/0.13.0/react-slick.min.js | kennynaoh/cdnjs | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.Slider=e(require("react"),require("react-dom")):t.Slider=e(t.React,t.ReactDOM)}(this,function(t,e){return function(t){function e(s){if(i[s])return i[s].exports;var r=i[s]={exports:{},id:s,loaded:!1};return t[s].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";t.exports=i(1)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}var r=i(2),n=s(r),o=i(3),a=i(8),l=s(a),d=i(15),u=s(d),c=i(17),h=s(c),p=i(10),f=s(p),S=n["default"].createClass({displayName:"Slider",mixins:[h["default"]],getInitialState:function(){return{breakpoint:null}},componentDidMount:function(){var t=this;if(this.props.responsive){var e=this.props.responsive.map(function(t){return t.breakpoint});e.sort(function(t,e){return t-e}),e.forEach(function(i,s){var r;r=0===s?(0,u["default"])({minWidth:0,maxWidth:i}):(0,u["default"])({minWidth:e[s-1],maxWidth:i}),t.media(r,function(){t.setState({breakpoint:i})})});var i=(0,u["default"])({minWidth:e.slice(-1)[0]});this.media(i,function(){t.setState({breakpoint:null})})}},render:function(){var t,e,i=this;this.state.breakpoint?(e=this.props.responsive.filter(function(t){return t.breakpoint===i.state.breakpoint}),t="unslick"===e[0].settings?"unslick":(0,l["default"])({},this.props,e[0].settings)):t=(0,l["default"])({},f["default"],this.props);var s=this.props.children;return Array.isArray(s)||(s=[s]),s=s.filter(function(t){return!!t}),"unslick"===t?n["default"].createElement("div",null,s):n["default"].createElement(o.InnerSlider,t,s)}});t.exports=S},function(e,i){e.exports=t},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.InnerSlider=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},n=i(2),o=s(n),a=i(4),l=s(a),d=i(7),u=s(d),c=i(9),h=s(c),p=i(10),f=s(p),S=i(11),v=s(S),g=i(12),w=i(13),m=i(14);e.InnerSlider=o["default"].createClass({displayName:"InnerSlider",mixins:[u["default"],l["default"]],getInitialState:function(){return r({},h["default"],{currentSlide:this.props.initialSlide})},getDefaultProps:function(){return f["default"]},componentWillMount:function(){this.props.init&&this.props.init(),this.setState({mounted:!0});for(var t=[],e=0;e<o["default"].Children.count(this.props.children);e++)e>=this.state.currentSlide&&e<this.state.currentSlide+this.props.slidesToShow&&t.push(e);this.props.lazyLoad&&0===this.state.lazyLoadedList.length&&this.setState({lazyLoadedList:t})},componentDidMount:function(){this.initialize(this.props),this.adaptHeight(),window.addEventListener?window.addEventListener("resize",this.onWindowResized):window.attachEvent("onresize",this.onWindowResized)},componentWillUnmount:function(){this.animationEndCallback&&clearTimeout(this.animationEndCallback),window.addEventListener?window.removeEventListener("resize",this.onWindowResized):window.detachEvent("onresize",this.onWindowResized),this.state.autoPlayTimer&&window.clearInterval(this.state.autoPlayTimer)},componentWillReceiveProps:function(t){this.props.slickGoTo!=t.slickGoTo?this.changeSlide({message:"index",index:t.slickGoTo,currentSlide:this.state.currentSlide}):this.update(t)},componentDidUpdate:function(){this.adaptHeight()},onWindowResized:function(){this.update(this.props),this.setState({animating:!1})},render:function(){var t,e=(0,v["default"])("slick-initialized","slick-slider",this.props.className),i={fade:this.props.fade,cssEase:this.props.cssEase,speed:this.props.speed,infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,lazyLoad:this.props.lazyLoad,lazyLoadedList:this.state.lazyLoadedList,rtl:this.props.rtl,slideWidth:this.state.slideWidth,slidesToShow:this.props.slidesToShow,slideCount:this.state.slideCount,trackStyle:this.state.trackStyle,variableWidth:this.props.variableWidth};if(this.props.dots===!0&&this.state.slideCount>=this.props.slidesToShow){var s={dotsClass:this.props.dotsClass,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,currentSlide:this.state.currentSlide,slidesToScroll:this.props.slidesToScroll,clickHandler:this.changeSlide};t=o["default"].createElement(w.Dots,s)}var n,a,l={infinite:this.props.infinite,centerMode:this.props.centerMode,currentSlide:this.state.currentSlide,slideCount:this.state.slideCount,slidesToShow:this.props.slidesToShow,prevArrow:this.props.prevArrow,nextArrow:this.props.nextArrow,clickHandler:this.changeSlide};this.props.arrows&&(n=o["default"].createElement(m.PrevArrow,l),a=o["default"].createElement(m.NextArrow,l));var d=null;return this.props.vertical===!1?this.props.centerMode===!0&&(d={padding:"0px "+this.props.centerPadding}):this.props.centerMode===!0&&(d={padding:this.props.centerPadding+" 0px"}),o["default"].createElement("div",{className:e,onMouseEnter:this.onInnerSliderEnter,onMouseLeave:this.onInnerSliderLeave},o["default"].createElement("div",{ref:"list",className:"slick-list",style:d,onMouseDown:this.swipeStart,onMouseMove:this.state.dragging?this.swipeMove:null,onMouseUp:this.swipeEnd,onMouseLeave:this.state.dragging?this.swipeEnd:null,onTouchStart:this.swipeStart,onTouchMove:this.state.dragging?this.swipeMove:null,onTouchEnd:this.swipeEnd,onTouchCancel:this.state.dragging?this.swipeEnd:null},o["default"].createElement(g.Track,r({ref:"track"},i),this.props.children)),n,a,t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=i(5),n=i(7),o=(s(n),i(8)),a=s(o),l={changeSlide:function(t){var e,i,s,r,n,o=this.props,a=o.slidesToScroll,l=o.slidesToShow,d=this.state,u=d.slideCount,c=d.currentSlide;if(r=u%a!==0,e=r?0:(u-c)%a,"previous"===t.message)s=0===e?a:l-e,n=c-s,this.props.lazyLoad&&(i=c-s,n=-1===i?u-1:i);else if("next"===t.message)s=0===e?a:e,n=c+s,this.props.lazyLoad&&(n=(c+a)%u+e);else if("dots"===t.message){if(n=t.index*t.slidesToScroll,n===t.currentSlide)return}else if("index"===t.message&&(n=t.index,n===t.currentSlide))return;this.slideHandler(n)},keyHandler:function(t){},selectHandler:function(t){},swipeStart:function(t){var e,i;this.props.swipe===!1||"ontouchend"in document&&this.props.swipe===!1||this.props.draggable===!1&&-1!==t.type.indexOf("mouse")||(e=void 0!==t.touches?t.touches[0].pageX:t.clientX,i=void 0!==t.touches?t.touches[0].pageY:t.clientY,this.setState({dragging:!0,touchObject:{startX:e,startY:i,curX:e,curY:i}}))},swipeMove:function(t){if(!this.state.dragging)return void t.preventDefault();if(!this.state.animating){var e,i,s,n=this.state.touchObject;i=(0,r.getTrackLeft)((0,a["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state)),n.curX=t.touches?t.touches[0].pageX:t.clientX,n.curY=t.touches?t.touches[0].pageY:t.clientY,n.swipeLength=Math.round(Math.sqrt(Math.pow(n.curX-n.startX,2))),s=(this.props.rtl===!1?1:-1)*(n.curX>n.startX?1:-1);var o=this.state.currentSlide,l=Math.ceil(this.state.slideCount/this.props.slidesToScroll),d=this.swipeDirection(this.state.touchObject),u=n.swipeLength;this.props.infinite===!1&&(0===o&&"right"===d||o+1>=l&&"left"===d)&&(u=n.swipeLength*this.props.edgeFriction,this.state.edgeDragged===!1&&this.props.edgeEvent&&(this.props.edgeEvent(d),this.setState({edgeDragged:!0}))),this.state.swiped===!1&&this.props.swipeEvent&&(this.props.swipeEvent(d),this.setState({swiped:!0})),e=i+u*s,this.setState({touchObject:n,swipeLeft:e,trackStyle:(0,r.getTrackCSS)((0,a["default"])({left:e},this.props,this.state))}),Math.abs(n.curX-n.startX)<.8*Math.abs(n.curY-n.startY)||n.swipeLength>4&&t.preventDefault()}},swipeEnd:function(t){if(!this.state.dragging)return void t.preventDefault();var e=this.state.touchObject,i=this.state.listWidth/this.props.touchThreshold,s=this.swipeDirection(e);if(this.setState({dragging:!1,edgeDragged:!1,swiped:!1,swipeLeft:null,touchObject:{}}),e.swipeLength)if(e.swipeLength>i)t.preventDefault(),"left"===s?this.slideHandler(this.state.currentSlide+this.props.slidesToScroll):"right"===s?this.slideHandler(this.state.currentSlide-this.props.slidesToScroll):this.slideHandler(this.state.currentSlide);else{var n=(0,r.getTrackLeft)((0,a["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},this.props,this.state));this.setState({trackStyle:(0,r.getTrackAnimateCSS)((0,a["default"])({left:n},this.props,this.state))})}},onInnerSliderEnter:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.pause()},onInnerSliderLeave:function(t){this.props.autoplay&&this.props.pauseOnHover&&this.autoPlay()}};e["default"]=l},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.getTrackLeft=e.getTrackAnimateCSS=e.getTrackCSS=void 0;var r=i(6),n=s(r),o=function(t,e){return e.reduce(function(e,i){return e&&t.hasOwnProperty(i)},!0)?null:console.error("Keys Missing",t)},a=e.getTrackCSS=function(t){o(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var e;e=t.variableWidth?(t.slideCount+2*t.slidesToShow)*t.slideWidth:t.centerMode?(t.slideCount+2*(t.slidesToShow+1))*t.slideWidth:(t.slideCount+2*t.slidesToShow)*t.slideWidth;var i={opacity:1,width:e,WebkitTransform:"translate3d("+t.left+"px, 0px, 0px)",transform:"translate3d("+t.left+"px, 0px, 0px)",transition:"",WebkitTransition:"",msTransform:"translateX("+t.left+"px)"};return!window.addEventListener&&window.attachEvent&&(i.marginLeft=t.left+"px"),i};e.getTrackAnimateCSS=function(t){o(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var e=a(t);return e.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,e.transition="transform "+t.speed+"ms "+t.cssEase,e},e.getTrackLeft=function(t){o(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth"]);var e,i,s=0;if(t.fade)return 0;if(t.infinite&&(t.slideCount>t.slidesToShow&&(s=t.slideWidth*t.slidesToShow*-1),t.slideCount%t.slidesToScroll!==0&&t.slideIndex+t.slidesToScroll>t.slideCount&&t.slideCount>t.slidesToShow&&(s=t.slideIndex>t.slideCount?(t.slidesToShow-(t.slideIndex-t.slideCount))*t.slideWidth*-1:t.slideCount%t.slidesToScroll*t.slideWidth*-1)),t.centerMode&&(t.infinite?s+=t.slideWidth*Math.floor(t.slidesToShow/2):s=t.slideWidth*Math.floor(t.slidesToShow/2)),e=t.slideIndex*t.slideWidth*-1+s,t.variableWidth===!0){var r;t.slideCount<=t.slidesToShow||t.infinite===!1?i=n["default"].findDOMNode(t.trackRef).childNodes[t.slideIndex]:(r=t.slideIndex+t.slidesToShow,i=n["default"].findDOMNode(t.trackRef).childNodes[r]),e=i?-1*i.offsetLeft:0,t.centerMode===!0&&(i=t.infinite===!1?n["default"].findDOMNode(t.trackRef).children[t.slideIndex]:n["default"].findDOMNode(t.trackRef).children[t.slideIndex+t.slidesToShow+1],e=i?-1*i.offsetLeft:0,e+=(t.listWidth-i.offsetWidth)/2)}return e}},function(t,i){t.exports=e},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=i(2),n=s(r),o=i(6),a=s(o),l=i(5),d=i(8),u=s(d),c={initialize:function(t){var e=n["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.track)),r=s/t.slidesToShow,o=t.rtl?e-1-t.initialSlide:t.initialSlide;this.setState({slideCount:e,slideWidth:r,listWidth:i,trackWidth:s,currentSlide:o},function(){var e=(0,l.getTrackLeft)((0,u["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,l.getTrackCSS)((0,u["default"])({left:e},t,this.state));this.setState({trackStyle:i}),this.autoPlay()})},update:function(t){var e=n["default"].Children.count(t.children),i=this.getWidth(a["default"].findDOMNode(this.refs.list)),s=this.getWidth(a["default"].findDOMNode(this.refs.track)),r=this.getWidth(a["default"].findDOMNode(this))/t.slidesToShow;t.autoplay||this.pause(),this.setState({slideCount:e,slideWidth:r,listWidth:i,trackWidth:s},function(){var e=(0,l.getTrackLeft)((0,u["default"])({slideIndex:this.state.currentSlide,trackRef:this.refs.track},t,this.state)),i=(0,l.getTrackCSS)((0,u["default"])({left:e},t,this.state));this.setState({trackStyle:i})})},getWidth:function(t){return t.getBoundingClientRect().width||t.offsetWidth},adaptHeight:function(){if(this.props.adaptiveHeight){var t='[data-index="'+this.state.currentSlide+'"]';if(this.refs.list){var e=a["default"].findDOMNode(this.refs.list);e.style.height=e.querySelector(t).offsetHeight+"px"}}},slideHandler:function(t){var e,i,s,r,n,o=this;if(!this.props.waitForAnimate||!this.state.animating){if(this.props.fade)return i=this.state.currentSlide,e=0>t?t+this.state.slideCount:t>=this.state.slideCount?t-this.state.slideCount:t,this.props.lazyLoad&&this.state.lazyLoadedList.indexOf(e)<0&&this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(e)}),n=function(){o.setState({animating:!1}),o.props.afterChange&&o.props.afterChange(e),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:e},function(){this.animationEndCallback=setTimeout(n,this.props.speed)}),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,e),void this.autoPlay();if(e=t,i=0>e?this.props.infinite===!1?0:this.state.slideCount%this.props.slidesToScroll!==0?this.state.slideCount-this.state.slideCount%this.props.slidesToScroll:this.state.slideCount+e:e>=this.state.slideCount?this.props.infinite===!1?this.state.slideCount-this.props.slidesToShow:this.state.slideCount%this.props.slidesToScroll!==0?0:e-this.state.slideCount:e,s=(0,l.getTrackLeft)((0,u["default"])({slideIndex:e,trackRef:this.refs.track},this.props,this.state)),r=(0,l.getTrackLeft)((0,u["default"])({slideIndex:i,trackRef:this.refs.track},this.props,this.state)),this.props.infinite===!1&&(s=r),this.props.beforeChange&&this.props.beforeChange(this.state.currentSlide,i),this.props.lazyLoad){for(var a=!0,d=[],c=e;c<e+this.props.slidesToShow;c++)a=a&&this.state.lazyLoadedList.indexOf(c)>=0,a||d.push(c);a||this.setState({lazyLoadedList:this.state.lazyLoadedList.concat(d)})}if(this.props.useCSS===!1)this.setState({currentSlide:i,trackStyle:(0,l.getTrackCSS)((0,u["default"])({left:r},this.props,this.state))},function(){this.props.afterChange&&this.props.afterChange(i)});else{var h={animating:!1,currentSlide:i,trackStyle:(0,l.getTrackCSS)((0,u["default"])({left:r},this.props,this.state)),swipeLeft:null};n=function(){o.setState(h),o.props.afterChange&&o.props.afterChange(i),delete o.animationEndCallback},this.setState({animating:!0,currentSlide:i,trackStyle:(0,l.getTrackAnimateCSS)((0,u["default"])({left:s},this.props,this.state))},function(){this.animationEndCallback=setTimeout(n,this.props.speed)})}this.autoPlay()}},swipeDirection:function(t){var e,i,s,r;return e=t.startX-t.curX,i=t.startY-t.curY,s=Math.atan2(i,e),r=Math.round(180*s/Math.PI),0>r&&(r=360-Math.abs(r)),45>=r&&r>=0||360>=r&&r>=315?this.props.rtl===!1?"left":"right":r>=135&&225>=r?this.props.rtl===!1?"right":"left":"vertical"},autoPlay:function(){var t=this;if(!this.state.autoPlayTimer){var e=function(){if(t.state.mounted){var e=t.props.rtl?t.state.currentSlide-t.props.slidesToScroll:t.state.currentSlide+t.props.slidesToScroll;t.slideHandler(e)}};this.props.autoplay&&this.setState({autoPlayTimer:window.setInterval(e,this.props.autoplaySpeed)})}},pause:function(){this.state.autoPlayTimer&&(window.clearInterval(this.state.autoPlayTimer),this.setState({autoPlayTimer:null}))}};e["default"]=c},function(t,e){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;10>i;i++)e["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==s.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=s()?Object.assign:function(t,e){for(var s,o,a=i(t),l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var d in s)r.call(s,d)&&(a[d]=s[d]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(s);for(var u=0;u<o.length;u++)n.call(s,o[u])&&(a[o[u]]=s[o[u]])}}return a}},function(t,e){"use strict";var i={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,slideCount:null,slideWidth:null,swipeLeft:null,touchObject:{startX:0,startY:0,curX:0,curY:0},lazyLoadedList:[],initialized:!1,edgeDragged:!1,swiped:!1,trackStyle:{},trackWidth:0};t.exports=i},function(t,e){"use strict";var i={className:"",adaptiveHeight:!1,arrows:!0,autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:!1,pauseOnHover:!1,responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,waitForAnimate:!0,afterChange:null,beforeChange:null,edgeEvent:null,init:null,swipeEvent:null,nextArrow:null,prevArrow:null};t.exports=i},function(t,e,i){var s,r;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function i(){for(var t=[],e=0;e<arguments.length;e++){var s=arguments[e];if(s){var r=typeof s;if("string"===r||"number"===r)t.push(s);else if(Array.isArray(s))t.push(i.apply(null,s));else if("object"===r)for(var o in s)n.call(s,o)&&s[o]&&t.push(o)}}return t.join(" ")}var n={}.hasOwnProperty;"undefined"!=typeof t&&t.exports?t.exports=i:(s=[],r=function(){return i}.apply(e,s),!(void 0!==r&&(t.exports=r)))}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Track=void 0;var r=i(2),n=s(r),o=i(8),a=s(o),l=i(11),d=s(l),u=function(t){var e,i,s,r,n;return n=t.rtl?t.slideCount-1-t.index:t.index,s=0>n||n>=t.slideCount,t.centerMode?(r=Math.floor(t.slidesToShow/2),i=(n-t.currentSlide)%t.slideCount===0,n>t.currentSlide-r-1&&n<=t.currentSlide+r&&(e=!0)):e=t.currentSlide<=n&&n<t.currentSlide+t.slidesToShow,(0,d["default"])({"slick-slide":!0,"slick-active":e,"slick-center":i,"slick-cloned":s})},c=function(t){var e={};return void 0!==t.variableWidth&&t.variableWidth!==!1||(e.width=t.slideWidth),t.fade&&(e.position="relative",e.left=-t.index*t.slideWidth,e.opacity=t.currentSlide===t.index?1:0,e.transition="opacity "+t.speed+"ms "+t.cssEase,e.WebkitTransition="opacity "+t.speed+"ms "+t.cssEase),e},h=function(t,e){return null===t.key||void 0===t.key?e:t.key},p=function(t){var e,i,s=[],r=[],o=[],l=n["default"].Children.count(t.children);return n["default"].Children.forEach(t.children,function(p,f){i=!t.lazyLoad|(t.lazyLoad&&t.lazyLoadedList.indexOf(f)>=0)?p:n["default"].createElement("div",null);var S,v=c((0,a["default"])({},t,{index:f})),g=u((0,a["default"])({index:f},t));if(S=i.props.className?(0,d["default"])(g,i.props.className):g,s.push(n["default"].cloneElement(i,{key:"original"+h(i,f),"data-index":f,className:S,style:(0,a["default"])({},i.props.style||{},v)})),t.infinite&&t.fade===!1){var w=t.variableWidth?t.slidesToShow+1:t.slidesToShow;f>=l-w&&(e=-(l-f),r.push(n["default"].cloneElement(i,{key:"precloned"+h(i,e),"data-index":e,className:S,style:(0,a["default"])({},i.props.style||{},v)}))),w>f&&(e=l+f,o.push(n["default"].cloneElement(i,{key:"postcloned"+h(i,e),"data-index":e,className:S,style:(0,a["default"])({},i.props.style||{},v)})))}}),t.rtl?r.concat(s,o).reverse():r.concat(s,o)};e.Track=n["default"].createClass({displayName:"Track",render:function(){var t=p(this.props);return n["default"].createElement("div",{className:"slick-track",style:this.props.trackStyle},t)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.Dots=void 0;var r=i(2),n=s(r),o=i(11),a=s(o),l=function(t){var e;return e=Math.ceil(t.slideCount/t.slidesToScroll)};e.Dots=n["default"].createClass({displayName:"Dots",clickHandler:function(t,e){e.preventDefault(),this.props.clickHandler(t)},render:function(){var t=this,e=l({slideCount:this.props.slideCount,slidesToScroll:this.props.slidesToScroll}),i=Array.apply(null,Array(e+1).join("0").split("")).map(function(e,i){var s=i*t.props.slidesToScroll,r=i*t.props.slidesToScroll+(t.props.slidesToScroll-1),o=(0,a["default"])({"slick-active":t.props.currentSlide>=s&&t.props.currentSlide<=r}),l={message:"dots",index:i,slidesToScroll:t.props.slidesToScroll,currentSlide:t.props.currentSlide};return n["default"].createElement("li",{key:i,className:o},n["default"].createElement("button",{onClick:t.clickHandler.bind(t,l)},i+1))});return n["default"].createElement("ul",{className:this.props.dotsClass,style:{display:"block"}},i)}})},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0,e.NextArrow=e.PrevArrow=void 0;var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},n=i(2),o=s(n),a=i(11),l=s(a);e.PrevArrow=o["default"].createClass({displayName:"PrevArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-prev":!0},e=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(0===this.props.currentSlide||this.props.slideCount<=this.props.slidesToShow)&&(t["slick-disabled"]=!0,e=null);var i,s={key:"0","data-role":"none",className:(0,l["default"])(t),style:{display:"block"},onClick:e};return i=this.props.prevArrow?o["default"].cloneElement(this.props.prevArrow,s):o["default"].createElement("button",r({key:"0",type:"button"},s)," Previous")}}),e.NextArrow=o["default"].createClass({displayName:"NextArrow",clickHandler:function(t,e){e&&e.preventDefault(),this.props.clickHandler(t,e)},render:function(){var t={"slick-arrow":!0,"slick-next":!0},e=this.clickHandler.bind(this,{message:"next"});this.props.infinite||(this.props.centerMode&&this.props.currentSlide>=this.props.slideCount-1?(t["slick-disabled"]=!0,e=null):this.props.currentSlide>=this.props.slideCount-this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null),this.props.slideCount<=this.props.slidesToShow&&(t["slick-disabled"]=!0,e=null));var i,s={key:"1","data-role":"none",className:(0,l["default"])(t),style:{display:"block"},onClick:e};return i=this.props.nextArrow?o["default"].cloneElement(this.props.nextArrow,s):o["default"].createElement("button",r({key:"1",type:"button"},s)," Next")}})},function(t,e,i){var s=i(16),r=function(t){var e=/[height|width]$/;return e.test(t)},n=function(t){var e="",i=Object.keys(t);return i.forEach(function(n,o){var a=t[n];n=s(n),r(n)&&"number"==typeof a&&(a+="px"),e+=a===!0?n:a===!1?"not "+n:"("+n+": "+a+")",o<i.length-1&&(e+=" and ")}),e},o=function(t){var e="";return"string"==typeof t?t:t instanceof Array?(t.forEach(function(i,s){e+=n(i),s<t.length-1&&(e+=", ")}),e):n(t)};t.exports=o},function(t,e){var i=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}).toLowerCase()};t.exports=i},function(t,e,i){var s=i(18),r=s&&i(19),n=i(15),o={media:function(t,e){t=n(t),"function"==typeof e&&(e={match:e}),r.register(t,e),this._responsiveMediaHandlers||(this._responsiveMediaHandlers=[]),this._responsiveMediaHandlers.push({query:t,handler:e})},componentWillUnmount:function(){this._responsiveMediaHandlers&&this._responsiveMediaHandlers.forEach(function(t){r.unregister(t.query,t.handler)})}};t.exports=o},function(t,e){var i=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=i},function(t,e,i){var s;!function(r,n,o){var a=window.matchMedia;"undefined"!=typeof t&&t.exports?t.exports=o(a):(s=function(){return n[r]=o(a)}.call(e,i,e,t),!(void 0!==s&&(t.exports=s)))}("enquire",this,function(t){"use strict";function e(t,e){var i,s=0,r=t.length;for(s;r>s&&(i=e(t[s],s),i!==!1);s++);}function i(t){return"[object Array]"===Object.prototype.toString.apply(t)}function s(t){return"function"==typeof t}function r(t){this.options=t,!t.deferSetup&&this.setup()}function n(e,i){this.query=e,this.isUnconditional=i,this.handlers=[],this.mql=t(e);var s=this;this.listener=function(t){s.mql=t,s.assess()},this.mql.addListener(this.listener)}function o(){if(!t)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return r.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},n.prototype={addHandler:function(t){var e=new r(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var i=this.handlers;e(i,function(e,s){return e.equals(t)?(e.destroy(),!i.splice(s,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},o.prototype={register:function(t,r,o){var a=this.queries,l=o&&this.browserIsIncapable;return a[t]||(a[t]=new n(t,l)),s(r)&&(r={match:r}),i(r)||(r=[r]),e(r,function(e){a[t].addHandler(e)}),this},unregister:function(t,e){var i=this.queries[t];return i&&(e?i.removeHandler(e):(i.clear(),delete this.queries[t])),this}},new o})}])}); |
src/components/demo/preview.js | VicStor/react-pdf-viewer | import React, { Component } from 'react';
import Viewer from '../pdf_viewer';
import {
TopMenu,
BottomMenu
} from '../controls';
// import Loader from './helpers/loader';
class App extends Component {
constructor() {
super();
this.state = {
fitWidth: true,
isFullScreen: false,
showThumbnails: false,
currentIndex: 0,
loadingProgress: 0,
numPages: null
};
}
getNumPages = (numPages) => {
this.setState({ numPages });
}
showThumbnailsHandler = () => {
this.pdfViewer.showThumbnails(!this.state.showThumbnails);
this.setState({ showThumbnails: !this.state.showThumbnails });
}
fitWidthHandler = () => {
const { fitWidth } = this.state;
this.pdfViewer.switchViewMode(!fitWidth);
this.setState({ fitWidth: !fitWidth });
}
setCurrentPage = (pageIndex) => {
this.setState({ currentIndex: pageIndex });
}
scrollToPage = (pageIndex) => {
this.pdfViewer.scrollToPage(pageIndex);
}
fullScreenHandler = () => {
console.log('fullScreenHandler');
this.setState({ isFullScreen: !this.state.isFullScreen });
// this.pdfViewer.fullScreen();
}
getViewer = (pdfViewer) => {
this.pdfViewer = pdfViewer;
console.log('pdfViewer: ', this.pdfViewer);
this.pdfViewer.onProgress((progress) => {
const loadingProgress = Math.floor((100 * progress.loaded) / progress.total);
this.setState({ loadingProgress });
});
this.pdfViewer.onLoad((pdfDocument) => {
this.setState({ numPages: pdfDocument.numPages });
});
this.pdfViewer.onPageFlipp(this.setCurrentPage);
}
closePreviewHandler = () => {
console.log('Close preview');
this.props.closePreview();
}
renderDocument() {
// const { isFetching } = this.state;
// if (isFetching) {
// return <Loader />;
// }
return (
<Viewer
getViewer={this.getViewer}
docLink={this.props.docLink}
svg={this.props.svg}
/>
);
}
render() {
const {
isFullScreen, showThumbnails, currentIndex,
loadingProgress, numPages, fitWidth } = this.state;
const { fullScreenHandler, showThumbnailsHandler,
fitWidthHandler, scrollToPage, closePreviewHandler } = this;
return (
<div className={`preview fm fcn${isFullScreen ? ' fullScreen' : ''}`}>
<TopMenu
previewTitle='Some docName'
fullScreenHandler={fullScreenHandler}
closePreview={closePreviewHandler}
loadingProgress={loadingProgress}
/>
<div className='fm frn'>
{this.renderDocument()}
</div>
<BottomMenu
numPages={numPages}
fitWidth={fitWidth}
fitWidthHandler={fitWidthHandler}
showThumbnails={showThumbnails}
showThumbnailsHandler={showThumbnailsHandler}
currentPage={currentIndex}
scrollToPage={scrollToPage}
/>
</div>
);
}
}
export default App;
|
test/components/Counter.spec.js | robteix/millie | /* eslint no-unused-expressions: 0 */
import { expect } from 'chai';
import { spy } from 'sinon';
import React from 'react';
import {
renderIntoDocument,
scryRenderedDOMComponentsWithTag,
findRenderedDOMComponentWithClass,
Simulate
} from 'react-addons-test-utils';
import Counter from '../../app/components/Counter';
function setup() {
const actions = {
increment: spy(),
incrementIfOdd: spy(),
incrementAsync: spy(),
decrement: spy()
};
const component = renderIntoDocument(<Counter counter={1} {...actions} />);
return {
component,
actions,
buttons: scryRenderedDOMComponentsWithTag(component, 'button').map(button => button),
p: findRenderedDOMComponentWithClass(component, 'counter')
};
}
describe('Counter component', () => {
it('should display count', () => {
const { p } = setup();
expect(p.textContent).to.match(/^1$/);
});
it('first button should call increment', () => {
const { buttons, actions } = setup();
Simulate.click(buttons[0]);
expect(actions.increment.called).to.be.true;
});
it('second button should call decrement', () => {
const { buttons, actions } = setup();
Simulate.click(buttons[1]);
expect(actions.decrement.called).to.be.true;
});
it('third button should call incrementIfOdd', () => {
const { buttons, actions } = setup();
Simulate.click(buttons[2]);
expect(actions.incrementIfOdd.called).to.be.true;
});
it('fourth button should call incrementAsync', () => {
const { buttons, actions } = setup();
Simulate.click(buttons[3]);
expect(actions.incrementAsync.called).to.be.true;
});
});
|
app/javascript/flavours/glitch/features/directory/components/account_card.js | glitch-soc/mastodon | import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { makeGetAccount } from 'flavours/glitch/selectors';
import Avatar from 'flavours/glitch/components/avatar';
import DisplayName from 'flavours/glitch/components/display_name';
import Permalink from 'flavours/glitch/components/permalink';
import Button from 'flavours/glitch/components/button';
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import { autoPlayGif, me, unfollowModal } from 'flavours/glitch/util/initial_state';
import ShortNumber from 'flavours/glitch/components/short_number';
import {
followAccount,
unfollowAccount,
unblockAccount,
unmuteAccount,
} from 'flavours/glitch/actions/accounts';
import { openModal } from 'flavours/glitch/actions/modal';
import classNames from 'classnames';
const messages = defineMessages({
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },
follow: { id: 'account.follow', defaultMessage: 'Follow' },
cancel_follow_request: { id: 'account.cancel_follow_request', defaultMessage: 'Cancel follow request' },
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },
unblock: { id: 'account.unblock_short', defaultMessage: 'Unblock' },
unmute: { id: 'account.unmute_short', defaultMessage: 'Unmute' },
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
});
const makeMapStateToProps = () => {
const getAccount = makeGetAccount();
const mapStateToProps = (state, { id }) => ({
account: getAccount(state, id),
});
return mapStateToProps;
};
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow(account) {
if (
account.getIn(['relationship', 'following']) ||
account.getIn(['relationship', 'requested'])
) {
if (unfollowModal) {
dispatch(
openModal('CONFIRM', {
message: (
<FormattedMessage
id='confirmations.unfollow.message'
defaultMessage='Are you sure you want to unfollow {name}?'
values={{ name: <strong>@{account.get('acct')}</strong> }}
/>
),
confirm: intl.formatMessage(messages.unfollowConfirm),
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
}),
);
} else {
dispatch(unfollowAccount(account.get('id')));
}
} else {
dispatch(followAccount(account.get('id')));
}
},
onBlock(account) {
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
}
},
onMute(account) {
if (account.getIn(['relationship', 'muting'])) {
dispatch(unmuteAccount(account.get('id')));
}
},
});
export default
@injectIntl
@connect(makeMapStateToProps, mapDispatchToProps)
class AccountCard extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
intl: PropTypes.object.isRequired,
onFollow: PropTypes.func.isRequired,
onBlock: PropTypes.func.isRequired,
onMute: PropTypes.func.isRequired,
};
handleMouseEnter = ({ currentTarget }) => {
if (autoPlayGif) {
return;
}
const emojis = currentTarget.querySelectorAll('.custom-emoji');
for (var i = 0; i < emojis.length; i++) {
let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-original');
}
}
handleMouseLeave = ({ currentTarget }) => {
if (autoPlayGif) {
return;
}
const emojis = currentTarget.querySelectorAll('.custom-emoji');
for (var i = 0; i < emojis.length; i++) {
let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-static');
}
}
handleFollow = () => {
this.props.onFollow(this.props.account);
};
handleBlock = () => {
this.props.onBlock(this.props.account);
};
handleMute = () => {
this.props.onMute(this.props.account);
}
handleEditProfile = () => {
window.open('/settings/profile', '_blank');
}
render() {
const { account, intl } = this.props;
let actionBtn;
if (me !== account.get('id')) {
if (!account.get('relationship')) { // Wait until the relationship is loaded
actionBtn = '';
} else if (account.getIn(['relationship', 'requested'])) {
actionBtn = <Button className={classNames('logo-button')} text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.handleFollow} />;
} else if (account.getIn(['relationship', 'muting'])) {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unmute)} onClick={this.handleMute} />;
} else if (!account.getIn(['relationship', 'blocking'])) {
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames('logo-button', { 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.handleFollow} />;
} else if (account.getIn(['relationship', 'blocking'])) {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.unblock)} onClick={this.handleBlock} />;
}
} else {
actionBtn = <Button className='logo-button' text={intl.formatMessage(messages.edit_profile)} onClick={this.handleEditProfile} />;
}
return (
<div className='account-card'>
<Permalink href={account.get('url')} to={`/@${account.get('acct')}`} className='account-card__permalink'>
<div className='account-card__header'>
<img
src={
autoPlayGif ? account.get('header') : account.get('header_static')
}
alt=''
/>
</div>
<div className='account-card__title'>
<div className='account-card__title__avatar'><Avatar account={account} size={56} /></div>
<DisplayName account={account} />
</div>
</Permalink>
{account.get('note').length > 0 && (
<div
className='account-card__bio translate'
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
dangerouslySetInnerHTML={{ __html: account.get('note_emojified') }}
/>
)}
<div className='account-card__actions'>
<div className='account-card__counters'>
<div className='account-card__counters__item'>
<ShortNumber value={account.get('statuses_count')} />
<small>
<FormattedMessage id='account.posts' defaultMessage='Posts' />
</small>
</div>
<div className='account-card__counters__item'>
{account.get('followers_count') < 0 ? '-' : <ShortNumber value={account.get('followers_count')} />}{' '}
<small>
<FormattedMessage
id='account.followers'
defaultMessage='Followers'
/>
</small>
</div>
<div className='account-card__counters__item'>
<ShortNumber value={account.get('following_count')} />{' '}
<small>
<FormattedMessage
id='account.following'
defaultMessage='Following'
/>
</small>
</div>
</div>
<div className='account-card__actions__button'>
{actionBtn}
</div>
</div>
</div>
);
}
}
|
src/components/modal.js | RichardDorn/mastermind-clone | import React, { Component } from 'react';
import ReactDOM from 'react-dom';
class Modal extends Component {
static propTypes = {
children: React.PropTypes.node,
}
componentDidMount() {
this.modalTarget = document.createElement('div');
this.modalTarget.className = 'modal';
document.body.appendChild(this.modalTarget);
this._render();
}
componentWillUpdate() {
this._render();
}
componentWillUnmount() {
ReactDOM.unmountComponentAtNode(this.modalTarget);
document.body.removeChild(this.modalTarget);
}
_render() {
ReactDOM.render(
<div>{this.props.children}</div>,
this.modalTarget
);
}
render() {
return <noscript />;
}
}
export default Modal; |
ajax/libs/webshim/1.14.5-RC2/dev/shims/combos/26.js | xymostech/cdnjs | /**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.2.1
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2014-05-14
*/
/**
* Compiled inline version. (Library mode)
*/
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
/*globals $code */
(function(exports, undefined) {
"use strict";
var modules = {};
function require(ids, callback) {
var module, defs = [];
for (var i = 0; i < ids.length; ++i) {
module = modules[ids[i]] || resolve(ids[i]);
if (!module) {
throw 'module definition dependecy not found: ' + ids[i];
}
defs.push(module);
}
callback.apply(null, defs);
}
function define(id, dependencies, definition) {
if (typeof id !== 'string') {
throw 'invalid module definition, module id must be defined and be a string';
}
if (dependencies === undefined) {
throw 'invalid module definition, dependencies must be specified';
}
if (definition === undefined) {
throw 'invalid module definition, definition function must be specified';
}
require(dependencies, function() {
modules[id] = definition.apply(null, arguments);
});
}
function defined(id) {
return !!modules[id];
}
function resolve(id) {
var target = exports;
var fragments = id.split(/[.\/]/);
for (var fi = 0; fi < fragments.length; ++fi) {
if (!target[fragments[fi]]) {
return;
}
target = target[fragments[fi]];
}
return target;
}
function expose(ids) {
for (var i = 0; i < ids.length; i++) {
var target = exports;
var id = ids[i];
var fragments = id.split(/[.\/]/);
for (var fi = 0; fi < fragments.length - 1; ++fi) {
if (target[fragments[fi]] === undefined) {
target[fragments[fi]] = {};
}
target = target[fragments[fi]];
}
target[fragments[fragments.length - 1]] = modules[id];
}
}
// Included from: src/javascript/core/utils/Basic.js
/**
* Basic.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Basic', [], function() {
/**
Gets the true type of the built-in object (better version of typeof).
@author Angus Croll (http://javascriptweblog.wordpress.com/)
@method typeOf
@for Utils
@static
@param {Object} o Object to check.
@return {String} Object [[Class]]
*/
var typeOf = function(o) {
var undef;
if (o === undef) {
return 'undefined';
} else if (o === null) {
return 'null';
} else if (o.nodeType) {
return 'node';
}
// the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8
return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
};
/**
Extends the specified object with another object.
@method extend
@static
@param {Object} target Object to extend.
@param {Object} [obj]* Multiple objects to extend with.
@return {Object} Same as target, the extended object.
*/
var extend = function(target) {
var undef;
each(arguments, function(arg, i) {
if (i > 0) {
each(arg, function(value, key) {
if (value !== undef) {
if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) {
extend(target[key], value);
} else {
target[key] = value;
}
}
});
}
});
return target;
};
/**
Executes the callback function for each item in array/object. If you return false in the
callback it will break the loop.
@method each
@static
@param {Object} obj Object to iterate.
@param {function} callback Callback function to execute for each item.
*/
var each = function(obj, callback) {
var length, key, i, undef;
if (obj) {
try {
length = obj.length;
} catch(ex) {
length = undef;
}
if (length === undef) {
// Loop object items
for (key in obj) {
if (obj.hasOwnProperty(key)) {
if (callback(obj[key], key) === false) {
return;
}
}
}
} else {
// Loop array items
for (i = 0; i < length; i++) {
if (callback(obj[i], i) === false) {
return;
}
}
}
}
};
/**
Checks if object is empty.
@method isEmptyObj
@static
@param {Object} o Object to check.
@return {Boolean}
*/
var isEmptyObj = function(obj) {
var prop;
if (!obj || typeOf(obj) !== 'object') {
return true;
}
for (prop in obj) {
return false;
}
return true;
};
/**
Recieve an array of functions (usually async) to call in sequence, each function
receives a callback as first argument that it should call, when it completes. Finally,
after everything is complete, main callback is called. Passing truthy value to the
callback as a first argument will interrupt the sequence and invoke main callback
immediately.
@method inSeries
@static
@param {Array} queue Array of functions to call in sequence
@param {Function} cb Main callback that is called in the end, or in case of error
*/
var inSeries = function(queue, cb) {
var i = 0, length = queue.length;
if (typeOf(cb) !== 'function') {
cb = function() {};
}
if (!queue || !queue.length) {
cb();
}
function callNext(i) {
if (typeOf(queue[i]) === 'function') {
queue[i](function(error) {
/*jshint expr:true */
++i < length && !error ? callNext(i) : cb(error);
});
}
}
callNext(i);
};
/**
Recieve an array of functions (usually async) to call in parallel, each function
receives a callback as first argument that it should call, when it completes. After
everything is complete, main callback is called. Passing truthy value to the
callback as a first argument will interrupt the process and invoke main callback
immediately.
@method inParallel
@static
@param {Array} queue Array of functions to call in sequence
@param {Function} cb Main callback that is called in the end, or in case of erro
*/
var inParallel = function(queue, cb) {
var count = 0, num = queue.length, cbArgs = new Array(num);
each(queue, function(fn, i) {
fn(function(error) {
if (error) {
return cb(error);
}
var args = [].slice.call(arguments);
args.shift(); // strip error - undefined or not
cbArgs[i] = args;
count++;
if (count === num) {
cbArgs.unshift(null);
cb.apply(this, cbArgs);
}
});
});
};
/**
Find an element in array and return it's index if present, otherwise return -1.
@method inArray
@static
@param {Mixed} needle Element to find
@param {Array} array
@return {Int} Index of the element, or -1 if not found
*/
var inArray = function(needle, array) {
if (array) {
if (Array.prototype.indexOf) {
return Array.prototype.indexOf.call(array, needle);
}
for (var i = 0, length = array.length; i < length; i++) {
if (array[i] === needle) {
return i;
}
}
}
return -1;
};
/**
Returns elements of first array if they are not present in second. And false - otherwise.
@private
@method arrayDiff
@param {Array} needles
@param {Array} array
@return {Array|Boolean}
*/
var arrayDiff = function(needles, array) {
var diff = [];
if (typeOf(needles) !== 'array') {
needles = [needles];
}
if (typeOf(array) !== 'array') {
array = [array];
}
for (var i in needles) {
if (inArray(needles[i], array) === -1) {
diff.push(needles[i]);
}
}
return diff.length ? diff : false;
};
/**
Find intersection of two arrays.
@private
@method arrayIntersect
@param {Array} array1
@param {Array} array2
@return {Array} Intersection of two arrays or null if there is none
*/
var arrayIntersect = function(array1, array2) {
var result = [];
each(array1, function(item) {
if (inArray(item, array2) !== -1) {
result.push(item);
}
});
return result.length ? result : null;
};
/**
Forces anything into an array.
@method toArray
@static
@param {Object} obj Object with length field.
@return {Array} Array object containing all items.
*/
var toArray = function(obj) {
var i, arr = [];
for (i = 0; i < obj.length; i++) {
arr[i] = obj[i];
}
return arr;
};
/**
Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers.
The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages
to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique.
It's more probable for the earth to be hit with an ansteriod. Y
@method guid
@static
@param {String} prefix to prepend (by default 'o' will be prepended).
@method guid
@return {String} Virtually unique id.
*/
var guid = (function() {
var counter = 0;
return function(prefix) {
var guid = new Date().getTime().toString(32), i;
for (i = 0; i < 5; i++) {
guid += Math.floor(Math.random() * 65535).toString(32);
}
return (prefix || 'o_') + guid + (counter++).toString(32);
};
}());
/**
Trims white spaces around the string
@method trim
@static
@param {String} str
@return {String}
*/
var trim = function(str) {
if (!str) {
return str;
}
return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, '');
};
/**
Parses the specified size string into a byte value. For example 10kb becomes 10240.
@method parseSizeStr
@static
@param {String/Number} size String to parse or number to just pass through.
@return {Number} Size in bytes.
*/
var parseSizeStr = function(size) {
if (typeof(size) !== 'string') {
return size;
}
var muls = {
t: 1099511627776,
g: 1073741824,
m: 1048576,
k: 1024
},
mul;
size = /^([0-9]+)([mgk]?)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, ''));
mul = size[2];
size = +size[1];
if (muls.hasOwnProperty(mul)) {
size *= muls[mul];
}
return size;
};
return {
guid: guid,
typeOf: typeOf,
extend: extend,
each: each,
isEmptyObj: isEmptyObj,
inSeries: inSeries,
inParallel: inParallel,
inArray: inArray,
arrayDiff: arrayDiff,
arrayIntersect: arrayIntersect,
toArray: toArray,
trim: trim,
parseSizeStr: parseSizeStr
};
});
// Included from: src/javascript/core/I18n.js
/**
* I18n.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/I18n", [
"moxie/core/utils/Basic"
], function(Basic) {
var i18n = {};
return {
/**
* Extends the language pack object with new items.
*
* @param {Object} pack Language pack items to add.
* @return {Object} Extended language pack object.
*/
addI18n: function(pack) {
return Basic.extend(i18n, pack);
},
/**
* Translates the specified string by checking for the english string in the language pack lookup.
*
* @param {String} str String to look for.
* @return {String} Translated string or the input string if it wasn't found.
*/
translate: function(str) {
return i18n[str] || str;
},
/**
* Shortcut for translate function
*
* @param {String} str String to look for.
* @return {String} Translated string or the input string if it wasn't found.
*/
_: function(str) {
return this.translate(str);
},
/**
* Pseudo sprintf implementation - simple way to replace tokens with specified values.
*
* @param {String} str String with tokens
* @return {String} String with replaced tokens
*/
sprintf: function(str) {
var args = [].slice.call(arguments, 1);
return str.replace(/%[a-z]/g, function() {
var value = args.shift();
return Basic.typeOf(value) !== 'undefined' ? value : '';
});
}
};
});
// Included from: src/javascript/core/utils/Mime.js
/**
* Mime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/utils/Mime", [
"moxie/core/utils/Basic",
"moxie/core/I18n"
], function(Basic, I18n) {
var mimeData = "" +
"application/msword,doc dot," +
"application/pdf,pdf," +
"application/pgp-signature,pgp," +
"application/postscript,ps ai eps," +
"application/rtf,rtf," +
"application/vnd.ms-excel,xls xlb," +
"application/vnd.ms-powerpoint,ppt pps pot," +
"application/zip,zip," +
"application/x-shockwave-flash,swf swfl," +
"application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," +
"application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," +
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," +
"application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," +
"application/vnd.openxmlformats-officedocument.presentationml.template,potx," +
"application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," +
"application/x-javascript,js," +
"application/json,json," +
"audio/mpeg,mp3 mpga mpega mp2," +
"audio/x-wav,wav," +
"audio/x-m4a,m4a," +
"audio/ogg,oga ogg," +
"audio/aiff,aiff aif," +
"audio/flac,flac," +
"audio/aac,aac," +
"audio/ac3,ac3," +
"audio/x-ms-wma,wma," +
"image/bmp,bmp," +
"image/gif,gif," +
"image/jpeg,jpg jpeg jpe," +
"image/photoshop,psd," +
"image/png,png," +
"image/svg+xml,svg svgz," +
"image/tiff,tiff tif," +
"text/plain,asc txt text diff log," +
"text/html,htm html xhtml," +
"text/css,css," +
"text/csv,csv," +
"text/rtf,rtf," +
"video/mpeg,mpeg mpg mpe m2v," +
"video/quicktime,qt mov," +
"video/mp4,mp4," +
"video/x-m4v,m4v," +
"video/x-flv,flv," +
"video/x-ms-wmv,wmv," +
"video/avi,avi," +
"video/webm,webm," +
"video/3gpp,3gpp 3gp," +
"video/3gpp2,3g2," +
"video/vnd.rn-realvideo,rv," +
"video/ogg,ogv," +
"video/x-matroska,mkv," +
"application/vnd.oasis.opendocument.formula-template,otf," +
"application/octet-stream,exe";
var Mime = {
mimes: {},
extensions: {},
// Parses the default mime types string into a mimes and extensions lookup maps
addMimeType: function (mimeData) {
var items = mimeData.split(/,/), i, ii, ext;
for (i = 0; i < items.length; i += 2) {
ext = items[i + 1].split(/ /);
// extension to mime lookup
for (ii = 0; ii < ext.length; ii++) {
this.mimes[ext[ii]] = items[i];
}
// mime to extension lookup
this.extensions[items[i]] = ext;
}
},
extList2mimes: function (filters, addMissingExtensions) {
var self = this, ext, i, ii, type, mimes = [];
// convert extensions to mime types list
for (i = 0; i < filters.length; i++) {
ext = filters[i].extensions.split(/\s*,\s*/);
for (ii = 0; ii < ext.length; ii++) {
// if there's an asterisk in the list, then accept attribute is not required
if (ext[ii] === '*') {
return [];
}
type = self.mimes[ext[ii]];
if (!type) {
if (addMissingExtensions && /^\w+$/.test(ext[ii])) {
mimes.push('.' + ext[ii]);
} else {
return []; // accept all
}
} else if (Basic.inArray(type, mimes) === -1) {
mimes.push(type);
}
}
}
return mimes;
},
mimes2exts: function(mimes) {
var self = this, exts = [];
Basic.each(mimes, function(mime) {
if (mime === '*') {
exts = [];
return false;
}
// check if this thing looks like mime type
var m = mime.match(/^(\w+)\/(\*|\w+)$/);
if (m) {
if (m[2] === '*') {
// wildcard mime type detected
Basic.each(self.extensions, function(arr, mime) {
if ((new RegExp('^' + m[1] + '/')).test(mime)) {
[].push.apply(exts, self.extensions[mime]);
}
});
} else if (self.extensions[mime]) {
[].push.apply(exts, self.extensions[mime]);
}
}
});
return exts;
},
mimes2extList: function(mimes) {
var accept = [], exts = [];
if (Basic.typeOf(mimes) === 'string') {
mimes = Basic.trim(mimes).split(/\s*,\s*/);
}
exts = this.mimes2exts(mimes);
accept.push({
title: I18n.translate('Files'),
extensions: exts.length ? exts.join(',') : '*'
});
// save original mimes string
accept.mimes = mimes;
return accept;
},
getFileExtension: function(fileName) {
var matches = fileName && fileName.match(/\.([^.]+)$/);
if (matches) {
return matches[1].toLowerCase();
}
return '';
},
getFileMime: function(fileName) {
return this.mimes[this.getFileExtension(fileName)] || '';
}
};
Mime.addMimeType(mimeData);
return Mime;
});
// Included from: src/javascript/core/utils/Env.js
/**
* Env.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/core/utils/Env", [
"moxie/core/utils/Basic"
], function(Basic) {
// UAParser.js v0.6.2
// Lightweight JavaScript-based User-Agent string parser
// https://github.com/faisalman/ua-parser-js
//
// Copyright © 2012-2013 Faisalman <[email protected]>
// Dual licensed under GPLv2 & MIT
var UAParser = (function (undefined) {
//////////////
// Constants
/////////////
var EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
UNDEF_TYPE = 'undefined',
OBJ_TYPE = 'object',
MAJOR = 'major',
MODEL = 'model',
NAME = 'name',
TYPE = 'type',
VENDOR = 'vendor',
VERSION = 'version',
ARCHITECTURE= 'architecture',
CONSOLE = 'console',
MOBILE = 'mobile',
TABLET = 'tablet';
///////////
// Helper
//////////
var util = {
has : function (str1, str2) {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
},
lowerize : function (str) {
return str.toLowerCase();
}
};
///////////////
// Map helper
//////////////
var mapper = {
rgx : function () {
// loop through all regexes maps
for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) {
var regex = args[i], // even sequence (0,2,4,..)
props = args[i + 1]; // odd sequence (1,3,5,..)
// construct object barebones
if (typeof(result) === UNDEF_TYPE) {
result = {};
for (p in props) {
q = props[p];
if (typeof(q) === OBJ_TYPE) {
result[q[0]] = undefined;
} else {
result[q] = undefined;
}
}
}
// try matching uastring with regexes
for (j = k = 0; j < regex.length; j++) {
matches = regex[j].exec(this.getUA());
if (!!matches) {
for (p = 0; p < props.length; p++) {
match = matches[++k];
q = props[p];
// check if given property is actually array
if (typeof(q) === OBJ_TYPE && q.length > 0) {
if (q.length == 2) {
if (typeof(q[1]) == FUNC_TYPE) {
// assign modified match
result[q[0]] = q[1].call(this, match);
} else {
// assign given value, ignore regex match
result[q[0]] = q[1];
}
} else if (q.length == 3) {
// check whether function or regex
if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) {
// call function (usually string mapper)
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
} else {
// sanitize match using given regex
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
}
} else if (q.length == 4) {
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
}
} else {
result[q] = match ? match : undefined;
}
}
break;
}
}
if(!!matches) break; // break the loop immediately if match found
}
return result;
},
str : function (str, map) {
for (var i in map) {
// check if array
if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) {
if (util.has(map[i][j], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
} else if (util.has(map[i], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
return str;
}
};
///////////////
// String map
//////////////
var maps = {
browser : {
oldsafari : {
major : {
'1' : ['/8', '/1', '/3'],
'2' : '/4',
'?' : '/'
},
version : {
'1.0' : '/8',
'1.2' : '/1',
'1.3' : '/3',
'2.0' : '/412',
'2.0.2' : '/416',
'2.0.3' : '/417',
'2.0.4' : '/419',
'?' : '/'
}
}
},
device : {
sprint : {
model : {
'Evo Shift 4G' : '7373KT'
},
vendor : {
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
version : {
'ME' : '4.90',
'NT 3.11' : 'NT3.51',
'NT 4.0' : 'NT4.0',
'2000' : 'NT 5.0',
'XP' : ['NT 5.1', 'NT 5.2'],
'Vista' : 'NT 6.0',
'7' : 'NT 6.1',
'8' : 'NT 6.2',
'8.1' : 'NT 6.3',
'RT' : 'ARM'
}
}
}
};
//////////////
// Regex map
/////////////
var regexes = {
browser : [[
// Presto based
/(opera\smini)\/((\d+)?[\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80
], [NAME, VERSION, MAJOR], [
/\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION, MAJOR], [
// Mixed
/(kindle)\/((\d+)?[\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron
], [NAME, VERSION, MAJOR], [
/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i // IE11
], [[NAME, 'IE'], VERSION, MAJOR], [
/(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex
], [[NAME, 'Yandex'], VERSION, MAJOR], [
/(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION, MAJOR], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i
// Chrome/OmniWeb/Arora/Tizen/Nokia
], [NAME, VERSION, MAJOR], [
/(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION, MAJOR], [
/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION, MAJOR], [
/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i // Android Browser
], [[NAME, 'Android Browser'], VERSION, MAJOR], [
/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [
/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [VERSION, MAJOR, NAME], [
/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0
], [NAME, [MAJOR, mapper.str, maps.browser.oldsafari.major], [VERSION, mapper.str, maps.browser.oldsafari.version]], [
/(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror
/(webkit|khtml)\/((\d+)?[\w\.]+)/i
], [NAME, VERSION, MAJOR], [
// Gecko based
/(navigator|netscape)\/((\d+)?[\w\.-]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION, MAJOR], [
/(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/QQBrowser
/(links)\s\(((\d+)?[\w\.]+)/i, // Links
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic
], [NAME, VERSION, MAJOR]
],
engine : [[
/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [
/rv\:([\w\.]+).*(gecko)/i // Gecko
], [VERSION, NAME]
],
os : [[
// Windows based
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
// Mobile/Embedded OS
/\((bb)(10);/i // BlackBerry 10
], [[NAME, 'BlackBerry'], VERSION], [
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
/(tizen)\/([\w\.]+)/i, // Tizen
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo
], [NAME, VERSION], [
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
], [[NAME, 'Symbian'], VERSION],[
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [
// Console
/(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
/(gnu)\s?([\w\.]+)*/i // GNU
], [NAME, VERSION], [
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[
// Solaris
/(sunos)\s?([\w\.]+\d)*/i // Solaris
], [[NAME, 'Solaris'], VERSION], [
// BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [NAME, VERSION],[
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i // Mac OS
], [NAME, [VERSION, /_/g, '.']], [
// Other
/(haiku)\s(\w+)/i, // Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
/(unix)\s?([\w\.]+)*/i // UNIX
], [NAME, VERSION]
]
};
/////////////////
// Constructor
////////////////
var UAParser = function (uastring) {
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
this.getBrowser = function () {
return mapper.rgx.apply(this, regexes.browser);
};
this.getEngine = function () {
return mapper.rgx.apply(this, regexes.engine);
};
this.getOS = function () {
return mapper.rgx.apply(this, regexes.os);
};
this.getResult = function() {
return {
ua : this.getUA(),
browser : this.getBrowser(),
engine : this.getEngine(),
os : this.getOS()
};
};
this.getUA = function () {
return ua;
};
this.setUA = function (uastring) {
ua = uastring;
return this;
};
this.setUA(ua);
};
return new UAParser().getResult();
})();
function version_compare(v1, v2, operator) {
// From: http://phpjs.org/functions
// + original by: Philippe Jausions (http://pear.php.net/user/jausions)
// + original by: Aidan Lister (http://aidanlister.com/)
// + reimplemented by: Kankrelune (http://www.webfaktory.info/)
// + improved by: Brett Zamir (http://brett-zamir.me)
// + improved by: Scott Baker
// + improved by: Theriault
// * example 1: version_compare('8.2.5rc', '8.2.5a');
// * returns 1: 1
// * example 2: version_compare('8.2.50', '8.2.52', '<');
// * returns 2: true
// * example 3: version_compare('5.3.0-dev', '5.3.0');
// * returns 3: -1
// * example 4: version_compare('4.1.0.52','4.01.0.51');
// * returns 4: 1
// Important: compare must be initialized at 0.
var i = 0,
x = 0,
compare = 0,
// vm maps textual PHP versions to negatives so they're less than 0.
// PHP currently defines these as CASE-SENSITIVE. It is important to
// leave these as negatives so that they can come before numerical versions
// and as if no letters were there to begin with.
// (1alpha is < 1 and < 1.1 but > 1dev1)
// If a non-numerical value can't be mapped to this table, it receives
// -7 as its value.
vm = {
'dev': -6,
'alpha': -5,
'a': -5,
'beta': -4,
'b': -4,
'RC': -3,
'rc': -3,
'#': -2,
'p': 1,
'pl': 1
},
// This function will be called to prepare each version argument.
// It replaces every _, -, and + with a dot.
// It surrounds any nonsequence of numbers/dots with dots.
// It replaces sequences of dots with a single dot.
// version_compare('4..0', '4.0') == 0
// Important: A string of 0 length needs to be converted into a value
// even less than an unexisting value in vm (-7), hence [-8].
// It's also important to not strip spaces because of this.
// version_compare('', ' ') == 1
prepVersion = function (v) {
v = ('' + v).replace(/[_\-+]/g, '.');
v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.');
return (!v.length ? [-8] : v.split('.'));
},
// This converts a version component to a number.
// Empty component becomes 0.
// Non-numerical component becomes a negative number.
// Numerical component becomes itself as an integer.
numVersion = function (v) {
return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10));
};
v1 = prepVersion(v1);
v2 = prepVersion(v2);
x = Math.max(v1.length, v2.length);
for (i = 0; i < x; i++) {
if (v1[i] == v2[i]) {
continue;
}
v1[i] = numVersion(v1[i]);
v2[i] = numVersion(v2[i]);
if (v1[i] < v2[i]) {
compare = -1;
break;
} else if (v1[i] > v2[i]) {
compare = 1;
break;
}
}
if (!operator) {
return compare;
}
// Important: operator is CASE-SENSITIVE.
// "No operator" seems to be treated as "<."
// Any other values seem to make the function return null.
switch (operator) {
case '>':
case 'gt':
return (compare > 0);
case '>=':
case 'ge':
return (compare >= 0);
case '<=':
case 'le':
return (compare <= 0);
case '==':
case '=':
case 'eq':
return (compare === 0);
case '<>':
case '!=':
case 'ne':
return (compare !== 0);
case '':
case '<':
case 'lt':
return (compare < 0);
default:
return null;
}
}
var can = (function() {
var caps = {
define_property: (function() {
/* // currently too much extra code required, not exactly worth it
try { // as of IE8, getters/setters are supported only on DOM elements
var obj = {};
if (Object.defineProperty) {
Object.defineProperty(obj, 'prop', {
enumerable: true,
configurable: true
});
return true;
}
} catch(ex) {}
if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) {
return true;
}*/
return false;
}()),
create_canvas: (function() {
// On the S60 and BB Storm, getContext exists, but always returns undefined
// so we actually have to call getContext() to verify
// github.com/Modernizr/Modernizr/issues/issue/97/
var el = document.createElement('canvas');
return !!(el.getContext && el.getContext('2d'));
}()),
return_response_type: function(responseType) {
try {
if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) {
return true;
} else if (window.XMLHttpRequest) {
var xhr = new XMLHttpRequest();
xhr.open('get', '/'); // otherwise Gecko throws an exception
if ('responseType' in xhr) {
xhr.responseType = responseType;
// as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?)
if (xhr.responseType !== responseType) {
return false;
}
return true;
}
}
} catch (ex) {}
return false;
},
// ideas for this heavily come from Modernizr (http://modernizr.com/)
use_data_uri: (function() {
var du = new Image();
du.onload = function() {
caps.use_data_uri = (du.width === 1 && du.height === 1);
};
setTimeout(function() {
du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
}, 1);
return false;
}()),
use_data_uri_over32kb: function() { // IE8
return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9);
},
use_data_uri_of: function(bytes) {
return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb());
},
use_fileinput: function() {
var el = document.createElement('input');
el.setAttribute('type', 'file');
return !el.disabled;
}
};
return function(cap) {
var args = [].slice.call(arguments);
args.shift(); // shift of cap
return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap];
};
}());
var Env = {
can: can,
browser: UAParser.browser.name,
version: parseFloat(UAParser.browser.major),
os: UAParser.os.name, // everybody intuitively types it in a lowercase for some reason
osVersion: UAParser.os.version,
verComp: version_compare,
swf_url: "../flash/Moxie.swf",
xap_url: "../silverlight/Moxie.xap",
global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent"
};
// for backward compatibility
// @deprecated Use `Env.os` instead
Env.OS = Env.os;
return Env;
});
// Included from: src/javascript/core/utils/Dom.js
/**
* Dom.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) {
/**
Get DOM Element by it's id.
@method get
@for Utils
@param {String} id Identifier of the DOM Element
@return {DOMElement}
*/
var get = function(id) {
if (typeof id !== 'string') {
return id;
}
return document.getElementById(id);
};
/**
Checks if specified DOM element has specified class.
@method hasClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var hasClass = function(obj, name) {
if (!obj.className) {
return false;
}
var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)");
return regExp.test(obj.className);
};
/**
Adds specified className to specified DOM element.
@method addClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var addClass = function(obj, name) {
if (!hasClass(obj, name)) {
obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name;
}
};
/**
Removes specified className from specified DOM element.
@method removeClass
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Class name
*/
var removeClass = function(obj, name) {
if (obj.className) {
var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)");
obj.className = obj.className.replace(regExp, function($0, $1, $2) {
return $1 === ' ' && $2 === ' ' ? ' ' : '';
});
}
};
/**
Returns a given computed style of a DOM element.
@method getStyle
@static
@param {Object} obj DOM element like object.
@param {String} name Style you want to get from the DOM element
*/
var getStyle = function(obj, name) {
if (obj.currentStyle) {
return obj.currentStyle[name];
} else if (window.getComputedStyle) {
return window.getComputedStyle(obj, null)[name];
}
};
/**
Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.
@method getPos
@static
@param {Element} node HTML element or element id to get x, y position from.
@param {Element} root Optional root element to stop calculations at.
@return {object} Absolute position of the specified element object with x, y fields.
*/
var getPos = function(node, root) {
var x = 0, y = 0, parent, doc = document, nodeRect, rootRect;
node = node;
root = root || doc.body;
// Returns the x, y cordinate for an element on IE 6 and IE 7
function getIEPos(node) {
var bodyElm, rect, x = 0, y = 0;
if (node) {
rect = node.getBoundingClientRect();
bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body;
x = rect.left + bodyElm.scrollLeft;
y = rect.top + bodyElm.scrollTop;
}
return {
x : x,
y : y
};
}
// Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode
if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) {
nodeRect = getIEPos(node);
rootRect = getIEPos(root);
return {
x : nodeRect.x - rootRect.x,
y : nodeRect.y - rootRect.y
};
}
parent = node;
while (parent && parent != root && parent.nodeType) {
x += parent.offsetLeft || 0;
y += parent.offsetTop || 0;
parent = parent.offsetParent;
}
parent = node.parentNode;
while (parent && parent != root && parent.nodeType) {
x -= parent.scrollLeft || 0;
y -= parent.scrollTop || 0;
parent = parent.parentNode;
}
return {
x : x,
y : y
};
};
/**
Returns the size of the specified node in pixels.
@method getSize
@static
@param {Node} node Node to get the size of.
@return {Object} Object with a w and h property.
*/
var getSize = function(node) {
return {
w : node.offsetWidth || node.clientWidth,
h : node.offsetHeight || node.clientHeight
};
};
return {
get: get,
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
getStyle: getStyle,
getPos: getPos,
getSize: getSize
};
});
// Included from: src/javascript/core/Exceptions.js
/**
* Exceptions.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/Exceptions', [
'moxie/core/utils/Basic'
], function(Basic) {
function _findKey(obj, value) {
var key;
for (key in obj) {
if (obj[key] === value) {
return key;
}
}
return null;
}
return {
RuntimeError: (function() {
var namecodes = {
NOT_INIT_ERR: 1,
NOT_SUPPORTED_ERR: 9,
JS_ERR: 4
};
function RuntimeError(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": RuntimeError " + this.code;
}
Basic.extend(RuntimeError, namecodes);
RuntimeError.prototype = Error.prototype;
return RuntimeError;
}()),
OperationNotAllowedException: (function() {
function OperationNotAllowedException(code) {
this.code = code;
this.name = 'OperationNotAllowedException';
}
Basic.extend(OperationNotAllowedException, {
NOT_ALLOWED_ERR: 1
});
OperationNotAllowedException.prototype = Error.prototype;
return OperationNotAllowedException;
}()),
ImageError: (function() {
var namecodes = {
WRONG_FORMAT: 1,
MAX_RESOLUTION_ERR: 2
};
function ImageError(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": ImageError " + this.code;
}
Basic.extend(ImageError, namecodes);
ImageError.prototype = Error.prototype;
return ImageError;
}()),
FileException: (function() {
var namecodes = {
NOT_FOUND_ERR: 1,
SECURITY_ERR: 2,
ABORT_ERR: 3,
NOT_READABLE_ERR: 4,
ENCODING_ERR: 5,
NO_MODIFICATION_ALLOWED_ERR: 6,
INVALID_STATE_ERR: 7,
SYNTAX_ERR: 8
};
function FileException(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": FileException " + this.code;
}
Basic.extend(FileException, namecodes);
FileException.prototype = Error.prototype;
return FileException;
}()),
DOMException: (function() {
var namecodes = {
INDEX_SIZE_ERR: 1,
DOMSTRING_SIZE_ERR: 2,
HIERARCHY_REQUEST_ERR: 3,
WRONG_DOCUMENT_ERR: 4,
INVALID_CHARACTER_ERR: 5,
NO_DATA_ALLOWED_ERR: 6,
NO_MODIFICATION_ALLOWED_ERR: 7,
NOT_FOUND_ERR: 8,
NOT_SUPPORTED_ERR: 9,
INUSE_ATTRIBUTE_ERR: 10,
INVALID_STATE_ERR: 11,
SYNTAX_ERR: 12,
INVALID_MODIFICATION_ERR: 13,
NAMESPACE_ERR: 14,
INVALID_ACCESS_ERR: 15,
VALIDATION_ERR: 16,
TYPE_MISMATCH_ERR: 17,
SECURITY_ERR: 18,
NETWORK_ERR: 19,
ABORT_ERR: 20,
URL_MISMATCH_ERR: 21,
QUOTA_EXCEEDED_ERR: 22,
TIMEOUT_ERR: 23,
INVALID_NODE_TYPE_ERR: 24,
DATA_CLONE_ERR: 25
};
function DOMException(code) {
this.code = code;
this.name = _findKey(namecodes, code);
this.message = this.name + ": DOMException " + this.code;
}
Basic.extend(DOMException, namecodes);
DOMException.prototype = Error.prototype;
return DOMException;
}()),
EventException: (function() {
function EventException(code) {
this.code = code;
this.name = 'EventException';
}
Basic.extend(EventException, {
UNSPECIFIED_EVENT_TYPE_ERR: 0
});
EventException.prototype = Error.prototype;
return EventException;
}())
};
});
// Included from: src/javascript/core/EventTarget.js
/**
* EventTarget.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/EventTarget', [
'moxie/core/Exceptions',
'moxie/core/utils/Basic'
], function(x, Basic) {
/**
Parent object for all event dispatching components and objects
@class EventTarget
@constructor EventTarget
*/
function EventTarget() {
// hash of event listeners by object uid
var eventpool = {};
Basic.extend(this, {
/**
Unique id of the event dispatcher, usually overriden by children
@property uid
@type String
*/
uid: null,
/**
Can be called from within a child in order to acquire uniqie id in automated manner
@method init
*/
init: function() {
if (!this.uid) {
this.uid = Basic.guid('uid_');
}
},
/**
Register a handler to a specific event dispatched by the object
@method addEventListener
@param {String} type Type or basically a name of the event to subscribe to
@param {Function} fn Callback function that will be called when event happens
@param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first
@param {Object} [scope=this] A scope to invoke event handler in
*/
addEventListener: function(type, fn, priority, scope) {
var self = this, list;
type = Basic.trim(type);
if (/\s/.test(type)) {
// multiple event types were passed for one handler
Basic.each(type.split(/\s+/), function(type) {
self.addEventListener(type, fn, priority, scope);
});
return;
}
type = type.toLowerCase();
priority = parseInt(priority, 10) || 0;
list = eventpool[this.uid] && eventpool[this.uid][type] || [];
list.push({fn : fn, priority : priority, scope : scope || this});
if (!eventpool[this.uid]) {
eventpool[this.uid] = {};
}
eventpool[this.uid][type] = list;
},
/**
Check if any handlers were registered to the specified event
@method hasEventListener
@param {String} type Type or basically a name of the event to check
@return {Mixed} Returns a handler if it was found and false, if - not
*/
hasEventListener: function(type) {
return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid];
},
/**
Unregister the handler from the event, or if former was not specified - unregister all handlers
@method removeEventListener
@param {String} type Type or basically a name of the event
@param {Function} [fn] Handler to unregister
*/
removeEventListener: function(type, fn) {
type = type.toLowerCase();
var list = eventpool[this.uid] && eventpool[this.uid][type], i;
if (list) {
if (fn) {
for (i = list.length - 1; i >= 0; i--) {
if (list[i].fn === fn) {
list.splice(i, 1);
break;
}
}
} else {
list = [];
}
// delete event list if it has become empty
if (!list.length) {
delete eventpool[this.uid][type];
// and object specific entry in a hash if it has no more listeners attached
if (Basic.isEmptyObj(eventpool[this.uid])) {
delete eventpool[this.uid];
}
}
}
},
/**
Remove all event handlers from the object
@method removeAllEventListeners
*/
removeAllEventListeners: function() {
if (eventpool[this.uid]) {
delete eventpool[this.uid];
}
},
/**
Dispatch the event
@method dispatchEvent
@param {String/Object} Type of event or event object to dispatch
@param {Mixed} [...] Variable number of arguments to be passed to a handlers
@return {Boolean} true by default and false if any handler returned false
*/
dispatchEvent: function(type) {
var uid, list, args, tmpEvt, evt = {}, result = true, undef;
if (Basic.typeOf(type) !== 'string') {
// we can't use original object directly (because of Silverlight)
tmpEvt = type;
if (Basic.typeOf(tmpEvt.type) === 'string') {
type = tmpEvt.type;
if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event
evt.total = tmpEvt.total;
evt.loaded = tmpEvt.loaded;
}
evt.async = tmpEvt.async || false;
} else {
throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR);
}
}
// check if event is meant to be dispatched on an object having specific uid
if (type.indexOf('::') !== -1) {
(function(arr) {
uid = arr[0];
type = arr[1];
}(type.split('::')));
} else {
uid = this.uid;
}
type = type.toLowerCase();
list = eventpool[uid] && eventpool[uid][type];
if (list) {
// sort event list by prority
list.sort(function(a, b) { return b.priority - a.priority; });
args = [].slice.call(arguments);
// first argument will be pseudo-event object
args.shift();
evt.type = type;
args.unshift(evt);
// Dispatch event to all listeners
var queue = [];
Basic.each(list, function(handler) {
// explicitly set the target, otherwise events fired from shims do not get it
args[0].target = handler.scope;
// if event is marked as async, detach the handler
if (evt.async) {
queue.push(function(cb) {
setTimeout(function() {
cb(handler.fn.apply(handler.scope, args) === false);
}, 1);
});
} else {
queue.push(function(cb) {
cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation
});
}
});
if (queue.length) {
Basic.inSeries(queue, function(err) {
result = !err;
});
}
}
return result;
},
/**
Alias for addEventListener
@method bind
@protected
*/
bind: function() {
this.addEventListener.apply(this, arguments);
},
/**
Alias for removeEventListener
@method unbind
@protected
*/
unbind: function() {
this.removeEventListener.apply(this, arguments);
},
/**
Alias for removeAllEventListeners
@method unbindAll
@protected
*/
unbindAll: function() {
this.removeAllEventListeners.apply(this, arguments);
},
/**
Alias for dispatchEvent
@method trigger
@protected
*/
trigger: function() {
return this.dispatchEvent.apply(this, arguments);
},
/**
Converts properties of on[event] type to corresponding event handlers,
is used to avoid extra hassle around the process of calling them back
@method convertEventPropsToHandlers
@private
*/
convertEventPropsToHandlers: function(handlers) {
var h;
if (Basic.typeOf(handlers) !== 'array') {
handlers = [handlers];
}
for (var i = 0; i < handlers.length; i++) {
h = 'on' + handlers[i];
if (Basic.typeOf(this[h]) === 'function') {
this.addEventListener(handlers[i], this[h]);
} else if (Basic.typeOf(this[h]) === 'undefined') {
this[h] = null; // object must have defined event properties, even if it doesn't make use of them
}
}
}
});
}
EventTarget.instance = new EventTarget();
return EventTarget;
});
// Included from: src/javascript/core/utils/Encode.js
/**
* Encode.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Encode', [], function() {
/**
Encode string with UTF-8
@method utf8_encode
@for Utils
@static
@param {String} str String to encode
@return {String} UTF-8 encoded string
*/
var utf8_encode = function(str) {
return unescape(encodeURIComponent(str));
};
/**
Decode UTF-8 encoded string
@method utf8_decode
@static
@param {String} str String to decode
@return {String} Decoded string
*/
var utf8_decode = function(str_data) {
return decodeURIComponent(escape(str_data));
};
/**
Decode Base64 encoded string (uses browser's default method if available),
from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js
@method atob
@static
@param {String} data String to decode
@return {String} Decoded string
*/
var atob = function(data, utf8) {
if (typeof(window.atob) === 'function') {
return utf8 ? utf8_decode(window.atob(data)) : window.atob(data);
}
// http://kevin.vanzonneveld.net
// + original by: Tyler Akins (http://rumkin.com)
// + improved by: Thunder.m
// + input by: Aman Gupta
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// + bugfixed by: Pellentesque Malesuada
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: Brett Zamir (http://brett-zamir.me)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
// * returns 1: 'Kevin van Zonneveld'
// mozilla has this native
// - but breaks in 2.0.0.12!
//if (typeof this.window.atob == 'function') {
// return atob(data);
//}
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
ac = 0,
dec = "",
tmp_arr = [];
if (!data) {
return data;
}
data += '';
do { // unpack four hexets into three octets using index points in b64
h1 = b64.indexOf(data.charAt(i++));
h2 = b64.indexOf(data.charAt(i++));
h3 = b64.indexOf(data.charAt(i++));
h4 = b64.indexOf(data.charAt(i++));
bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
o1 = bits >> 16 & 0xff;
o2 = bits >> 8 & 0xff;
o3 = bits & 0xff;
if (h3 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1);
} else if (h4 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1, o2);
} else {
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
}
} while (i < data.length);
dec = tmp_arr.join('');
return utf8 ? utf8_decode(dec) : dec;
};
/**
Base64 encode string (uses browser's default method if available),
from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js
@method btoa
@static
@param {String} data String to encode
@return {String} Base64 encoded string
*/
var btoa = function(data, utf8) {
if (utf8) {
utf8_encode(data);
}
if (typeof(window.btoa) === 'function') {
return window.btoa(data);
}
// http://kevin.vanzonneveld.net
// + original by: Tyler Akins (http://rumkin.com)
// + improved by: Bayron Guevara
// + improved by: Thunder.m
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Pellentesque Malesuada
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Rafał Kukawski (http://kukawski.pl)
// * example 1: base64_encode('Kevin van Zonneveld');
// * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
// mozilla has this native
// - but breaks in 2.0.0.12!
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
ac = 0,
enc = "",
tmp_arr = [];
if (!data) {
return data;
}
do { // pack three octets into four hexets
o1 = data.charCodeAt(i++);
o2 = data.charCodeAt(i++);
o3 = data.charCodeAt(i++);
bits = o1 << 16 | o2 << 8 | o3;
h1 = bits >> 18 & 0x3f;
h2 = bits >> 12 & 0x3f;
h3 = bits >> 6 & 0x3f;
h4 = bits & 0x3f;
// use hexets to index into b64, and append result to encoded string
tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
} while (i < data.length);
enc = tmp_arr.join('');
var r = data.length % 3;
return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
};
return {
utf8_encode: utf8_encode,
utf8_decode: utf8_decode,
atob: atob,
btoa: btoa
};
});
// Included from: src/javascript/runtime/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/Runtime', [
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/EventTarget"
], function(Basic, Dom, EventTarget) {
var runtimeConstructors = {}, runtimes = {};
/**
Common set of methods and properties for every runtime instance
@class Runtime
@param {Object} options
@param {String} type Sanitized name of the runtime
@param {Object} [caps] Set of capabilities that differentiate specified runtime
@param {Object} [modeCaps] Set of capabilities that do require specific operational mode
@param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested
*/
function Runtime(options, type, caps, modeCaps, preferredMode) {
/**
Dispatched when runtime is initialized and ready.
Results in RuntimeInit on a connected component.
@event Init
*/
/**
Dispatched when runtime fails to initialize.
Results in RuntimeError on a connected component.
@event Error
*/
var self = this
, _shim
, _uid = Basic.guid(type + '_')
, defaultMode = preferredMode || 'browser'
;
options = options || {};
// register runtime in private hash
runtimes[_uid] = this;
/**
Default set of capabilities, which can be redifined later by specific runtime
@private
@property caps
@type Object
*/
caps = Basic.extend({
// Runtime can:
// provide access to raw binary data of the file
access_binary: false,
// provide access to raw binary data of the image (image extension is optional)
access_image_binary: false,
// display binary data as thumbs for example
display_media: false,
// make cross-domain requests
do_cors: false,
// accept files dragged and dropped from the desktop
drag_and_drop: false,
// filter files in selection dialog by their extensions
filter_by_extension: true,
// resize image (and manipulate it raw data of any file in general)
resize_image: false,
// periodically report how many bytes of total in the file were uploaded (loaded)
report_upload_progress: false,
// provide access to the headers of http response
return_response_headers: false,
// support response of specific type, which should be passed as an argument
// e.g. runtime.can('return_response_type', 'blob')
return_response_type: false,
// return http status code of the response
return_status_code: true,
// send custom http header with the request
send_custom_headers: false,
// pick up the files from a dialog
select_file: false,
// select whole folder in file browse dialog
select_folder: false,
// select multiple files at once in file browse dialog
select_multiple: true,
// send raw binary data, that is generated after image resizing or manipulation of other kind
send_binary_string: false,
// send cookies with http request and therefore retain session
send_browser_cookies: true,
// send data formatted as multipart/form-data
send_multipart: true,
// slice the file or blob to smaller parts
slice_blob: false,
// upload file without preloading it to memory, stream it out directly from disk
stream_upload: false,
// programmatically trigger file browse dialog
summon_file_dialog: false,
// upload file of specific size, size should be passed as argument
// e.g. runtime.can('upload_filesize', '500mb')
upload_filesize: true,
// initiate http request with specific http method, method should be passed as argument
// e.g. runtime.can('use_http_method', 'put')
use_http_method: true
}, caps);
// default to the mode that is compatible with preferred caps
if (options.preferred_caps) {
defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode);
}
// small extension factory here (is meant to be extended with actual extensions constructors)
_shim = (function() {
var objpool = {};
return {
exec: function(uid, comp, fn, args) {
if (_shim[comp]) {
if (!objpool[uid]) {
objpool[uid] = {
context: this,
instance: new _shim[comp]()
};
}
if (objpool[uid].instance[fn]) {
return objpool[uid].instance[fn].apply(this, args);
}
}
},
removeInstance: function(uid) {
delete objpool[uid];
},
removeAllInstances: function() {
var self = this;
Basic.each(objpool, function(obj, uid) {
if (Basic.typeOf(obj.instance.destroy) === 'function') {
obj.instance.destroy.call(obj.context);
}
self.removeInstance(uid);
});
}
};
}());
// public methods
Basic.extend(this, {
/**
Specifies whether runtime instance was initialized or not
@property initialized
@type {Boolean}
@default false
*/
initialized: false, // shims require this flag to stop initialization retries
/**
Unique ID of the runtime
@property uid
@type {String}
*/
uid: _uid,
/**
Runtime type (e.g. flash, html5, etc)
@property type
@type {String}
*/
type: type,
/**
Runtime (not native one) may operate in browser or client mode.
@property mode
@private
@type {String|Boolean} current mode or false, if none possible
*/
mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode),
/**
id of the DOM container for the runtime (if available)
@property shimid
@type {String}
*/
shimid: _uid + '_container',
/**
Number of connected clients. If equal to zero, runtime can be destroyed
@property clients
@type {Number}
*/
clients: 0,
/**
Runtime initialization options
@property options
@type {Object}
*/
options: options,
/**
Checks if the runtime has specific capability
@method can
@param {String} cap Name of capability to check
@param {Mixed} [value] If passed, capability should somehow correlate to the value
@param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set)
@return {Boolean} true if runtime has such capability and false, if - not
*/
can: function(cap, value) {
var refCaps = arguments[2] || caps;
// if cap var is a comma-separated list of caps, convert it to object (key/value)
if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') {
cap = Runtime.parseCaps(cap);
}
if (Basic.typeOf(cap) === 'object') {
for (var key in cap) {
if (!this.can(key, cap[key], refCaps)) {
return false;
}
}
return true;
}
// check the individual cap
if (Basic.typeOf(refCaps[cap]) === 'function') {
return refCaps[cap].call(this, value);
} else {
return (value === refCaps[cap]);
}
},
/**
Returns container for the runtime as DOM element
@method getShimContainer
@return {DOMElement}
*/
getShimContainer: function() {
var container, shimContainer = Dom.get(this.shimid);
// if no container for shim, create one
if (!shimContainer) {
container = this.options.container ? Dom.get(this.options.container) : document.body;
// create shim container and insert it at an absolute position into the outer container
shimContainer = document.createElement('div');
shimContainer.id = this.shimid;
shimContainer.className = 'moxie-shim moxie-shim-' + this.type;
Basic.extend(shimContainer.style, {
position: 'absolute',
top: '0px',
left: '0px',
width: '1px',
height: '1px',
overflow: 'hidden'
});
container.appendChild(shimContainer);
container = null;
}
return shimContainer;
},
/**
Returns runtime as DOM element (if appropriate)
@method getShim
@return {DOMElement}
*/
getShim: function() {
return _shim;
},
/**
Invokes a method within the runtime itself (might differ across the runtimes)
@method shimExec
@param {Mixed} []
@protected
@return {Mixed} Depends on the action and component
*/
shimExec: function(component, action) {
var args = [].slice.call(arguments, 2);
return self.getShim().exec.call(this, this.uid, component, action, args);
},
/**
Operaional interface that is used by components to invoke specific actions on the runtime
(is invoked in the scope of component)
@method exec
@param {Mixed} []*
@protected
@return {Mixed} Depends on the action and component
*/
exec: function(component, action) { // this is called in the context of component, not runtime
var args = [].slice.call(arguments, 2);
if (self[component] && self[component][action]) {
return self[component][action].apply(this, args);
}
return self.shimExec.apply(this, arguments);
},
/**
Destroys the runtime (removes all events and deletes DOM structures)
@method destroy
*/
destroy: function() {
if (!self) {
return; // obviously already destroyed
}
var shimContainer = Dom.get(this.shimid);
if (shimContainer) {
shimContainer.parentNode.removeChild(shimContainer);
}
if (_shim) {
_shim.removeAllInstances();
}
this.unbindAll();
delete runtimes[this.uid];
this.uid = null; // mark this runtime as destroyed
_uid = self = _shim = shimContainer = null;
}
});
// once we got the mode, test against all caps
if (this.mode && options.required_caps && !this.can(options.required_caps)) {
this.mode = false;
}
}
/**
Default order to try different runtime types
@property order
@type String
@static
*/
Runtime.order = 'html5,flash,silverlight,html4';
/**
Retrieves runtime from private hash by it's uid
@method getRuntime
@private
@static
@param {String} uid Unique identifier of the runtime
@return {Runtime|Boolean} Returns runtime, if it exists and false, if - not
*/
Runtime.getRuntime = function(uid) {
return runtimes[uid] ? runtimes[uid] : false;
};
/**
Register constructor for the Runtime of new (or perhaps modified) type
@method addConstructor
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@param {Function} construct Constructor for the Runtime type
*/
Runtime.addConstructor = function(type, constructor) {
constructor.prototype = EventTarget.instance;
runtimeConstructors[type] = constructor;
};
/**
Get the constructor for the specified type.
method getConstructor
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@return {Function} Constructor for the Runtime type
*/
Runtime.getConstructor = function(type) {
return runtimeConstructors[type] || null;
};
/**
Get info about the runtime (uid, type, capabilities)
@method getInfo
@static
@param {String} uid Unique identifier of the runtime
@return {Mixed} Info object or null if runtime doesn't exist
*/
Runtime.getInfo = function(uid) {
var runtime = Runtime.getRuntime(uid);
if (runtime) {
return {
uid: runtime.uid,
type: runtime.type,
mode: runtime.mode,
can: function() {
return runtime.can.apply(runtime, arguments);
}
};
}
return null;
};
/**
Convert caps represented by a comma-separated string to the object representation.
@method parseCaps
@static
@param {String} capStr Comma-separated list of capabilities
@return {Object}
*/
Runtime.parseCaps = function(capStr) {
var capObj = {};
if (Basic.typeOf(capStr) !== 'string') {
return capStr || {};
}
Basic.each(capStr.split(','), function(key) {
capObj[key] = true; // we assume it to be - true
});
return capObj;
};
/**
Test the specified runtime for specific capabilities.
@method can
@static
@param {String} type Runtime type (e.g. flash, html5, etc)
@param {String|Object} caps Set of capabilities to check
@return {Boolean} Result of the test
*/
Runtime.can = function(type, caps) {
var runtime
, constructor = Runtime.getConstructor(type)
, mode
;
if (constructor) {
runtime = new constructor({
required_caps: caps
});
mode = runtime.mode;
runtime.destroy();
return !!mode;
}
return false;
};
/**
Figure out a runtime that supports specified capabilities.
@method thatCan
@static
@param {String|Object} caps Set of capabilities to check
@param {String} [runtimeOrder] Comma-separated list of runtimes to check against
@return {String} Usable runtime identifier or null
*/
Runtime.thatCan = function(caps, runtimeOrder) {
var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/);
for (var i in types) {
if (Runtime.can(types[i], caps)) {
return types[i];
}
}
return null;
};
/**
Figure out an operational mode for the specified set of capabilities.
@method getMode
@static
@param {Object} modeCaps Set of capabilities that depend on particular runtime mode
@param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for
@param {String|Boolean} [defaultMode='browser'] Default mode to use
@return {String|Boolean} Compatible operational mode
*/
Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) {
var mode = null;
if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified
defaultMode = 'browser';
}
if (requiredCaps && !Basic.isEmptyObj(modeCaps)) {
// loop over required caps and check if they do require the same mode
Basic.each(requiredCaps, function(value, cap) {
if (modeCaps.hasOwnProperty(cap)) {
var capMode = modeCaps[cap](value);
// make sure we always have an array
if (typeof(capMode) === 'string') {
capMode = [capMode];
}
if (!mode) {
mode = capMode;
} else if (!(mode = Basic.arrayIntersect(mode, capMode))) {
// if cap requires conflicting mode - runtime cannot fulfill required caps
return (mode = false);
}
}
});
if (mode) {
return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0];
} else if (mode === false) {
return false;
}
}
return defaultMode;
};
/**
Capability check that always returns true
@private
@static
@return {True}
*/
Runtime.capTrue = function() {
return true;
};
/**
Capability check that always returns false
@private
@static
@return {False}
*/
Runtime.capFalse = function() {
return false;
};
/**
Evaluate the expression to boolean value and create a function that always returns it.
@private
@static
@param {Mixed} expr Expression to evaluate
@return {Function} Function returning the result of evaluation
*/
Runtime.capTest = function(expr) {
return function() {
return !!expr;
};
};
return Runtime;
});
// Included from: src/javascript/runtime/RuntimeClient.js
/**
* RuntimeClient.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/RuntimeClient', [
'moxie/core/Exceptions',
'moxie/core/utils/Basic',
'moxie/runtime/Runtime'
], function(x, Basic, Runtime) {
/**
Set of methods and properties, required by a component to acquire ability to connect to a runtime
@class RuntimeClient
*/
return function RuntimeClient() {
var runtime;
Basic.extend(this, {
/**
Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one.
Increments number of clients connected to the specified runtime.
@method connectRuntime
@param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites
*/
connectRuntime: function(options) {
var comp = this, ruid;
function initialize(items) {
var type, constructor;
// if we ran out of runtimes
if (!items.length) {
comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));
runtime = null;
return;
}
type = items.shift();
constructor = Runtime.getConstructor(type);
if (!constructor) {
initialize(items);
return;
}
// try initializing the runtime
runtime = new constructor(options);
runtime.bind('Init', function() {
// mark runtime as initialized
runtime.initialized = true;
// jailbreak ...
setTimeout(function() {
runtime.clients++;
// this will be triggered on component
comp.trigger('RuntimeInit', runtime);
}, 1);
});
runtime.bind('Error', function() {
runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here
initialize(items);
});
/*runtime.bind('Exception', function() { });*/
// check if runtime managed to pick-up operational mode
if (!runtime.mode) {
runtime.trigger('Error');
return;
}
runtime.init();
}
// check if a particular runtime was requested
if (Basic.typeOf(options) === 'string') {
ruid = options;
} else if (Basic.typeOf(options.ruid) === 'string') {
ruid = options.ruid;
}
if (ruid) {
runtime = Runtime.getRuntime(ruid);
if (runtime) {
runtime.clients++;
return runtime;
} else {
// there should be a runtime and there's none - weird case
throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR);
}
}
// initialize a fresh one, that fits runtime list and required features best
initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/));
},
/**
Returns the runtime to which the client is currently connected.
@method getRuntime
@return {Runtime} Runtime or null if client is not connected
*/
getRuntime: function() {
if (runtime && runtime.uid) {
return runtime;
}
runtime = null; // make sure we do not leave zombies rambling around
return null;
},
/**
Disconnects from the runtime. Decrements number of clients connected to the specified runtime.
@method disconnectRuntime
*/
disconnectRuntime: function() {
if (runtime && --runtime.clients <= 0) {
runtime.destroy();
runtime = null;
}
}
});
};
});
// Included from: src/javascript/file/Blob.js
/**
* Blob.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/Blob', [
'moxie/core/utils/Basic',
'moxie/core/utils/Encode',
'moxie/runtime/RuntimeClient'
], function(Basic, Encode, RuntimeClient) {
var blobpool = {};
/**
@class Blob
@constructor
@param {String} ruid Unique id of the runtime, to which this blob belongs to
@param {Object} blob Object "Native" blob object, as it is represented in the runtime
*/
function Blob(ruid, blob) {
function _sliceDetached(start, end, type) {
var blob, data = blobpool[this.uid];
if (Basic.typeOf(data) !== 'string' || !data.length) {
return null; // or throw exception
}
blob = new Blob(null, {
type: type,
size: end - start
});
blob.detach(data.substr(start, blob.size));
return blob;
}
RuntimeClient.call(this);
if (ruid) {
this.connectRuntime(ruid);
}
if (!blob) {
blob = {};
} else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string
blob = { data: blob };
}
Basic.extend(this, {
/**
Unique id of the component
@property uid
@type {String}
*/
uid: blob.uid || Basic.guid('uid_'),
/**
Unique id of the connected runtime, if falsy, then runtime will have to be initialized
before this Blob can be used, modified or sent
@property ruid
@type {String}
*/
ruid: ruid,
/**
Size of blob
@property size
@type {Number}
@default 0
*/
size: blob.size || 0,
/**
Mime type of blob
@property type
@type {String}
@default ''
*/
type: blob.type || '',
/**
@method slice
@param {Number} [start=0]
*/
slice: function(start, end, type) {
if (this.isDetached()) {
return _sliceDetached.apply(this, arguments);
}
return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type);
},
/**
Returns "native" blob object (as it is represented in connected runtime) or null if not found
@method getSource
@return {Blob} Returns "native" blob object or null if not found
*/
getSource: function() {
if (!blobpool[this.uid]) {
return null;
}
return blobpool[this.uid];
},
/**
Detaches blob from any runtime that it depends on and initialize with standalone value
@method detach
@protected
@param {DOMString} [data=''] Standalone value
*/
detach: function(data) {
if (this.ruid) {
this.getRuntime().exec.call(this, 'Blob', 'destroy');
this.disconnectRuntime();
this.ruid = null;
}
data = data || '';
// if dataUrl, convert to binary string
var matches = data.match(/^data:([^;]*);base64,/);
if (matches) {
this.type = matches[1];
data = Encode.atob(data.substring(data.indexOf('base64,') + 7));
}
this.size = data.length;
blobpool[this.uid] = data;
},
/**
Checks if blob is standalone (detached of any runtime)
@method isDetached
@protected
@return {Boolean}
*/
isDetached: function() {
return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string';
},
/**
Destroy Blob and free any resources it was using
@method destroy
*/
destroy: function() {
this.detach();
delete blobpool[this.uid];
}
});
if (blob.data) {
this.detach(blob.data); // auto-detach if payload has been passed
} else {
blobpool[this.uid] = blob;
}
}
return Blob;
});
// Included from: src/javascript/file/File.js
/**
* File.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/File', [
'moxie/core/utils/Basic',
'moxie/core/utils/Mime',
'moxie/file/Blob'
], function(Basic, Mime, Blob) {
/**
@class File
@extends Blob
@constructor
@param {String} ruid Unique id of the runtime, to which this blob belongs to
@param {Object} file Object "Native" file object, as it is represented in the runtime
*/
function File(ruid, file) {
var name, type;
if (!file) { // avoid extra errors in case we overlooked something
file = {};
}
// figure out the type
if (file.type && file.type !== '') {
type = file.type;
} else {
type = Mime.getFileMime(file.name);
}
// sanitize file name or generate new one
if (file.name) {
name = file.name.replace(/\\/g, '/');
name = name.substr(name.lastIndexOf('/') + 1);
} else {
var prefix = type.split('/')[0];
name = Basic.guid((prefix !== '' ? prefix : 'file') + '_');
if (Mime.extensions[type]) {
name += '.' + Mime.extensions[type][0]; // append proper extension if possible
}
}
Blob.apply(this, arguments);
Basic.extend(this, {
/**
File mime type
@property type
@type {String}
@default ''
*/
type: type || '',
/**
File name
@property name
@type {String}
@default UID
*/
name: name || Basic.guid('file_'),
/**
Relative path to the file inside a directory
@property relativePath
@type {String}
@default ''
*/
relativePath: '',
/**
Date of last modification
@property lastModifiedDate
@type {String}
@default now
*/
lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET)
});
}
File.prototype = Blob.prototype;
return File;
});
// Included from: src/javascript/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileInput', [
'moxie/core/utils/Basic',
'moxie/core/utils/Mime',
'moxie/core/utils/Dom',
'moxie/core/Exceptions',
'moxie/core/EventTarget',
'moxie/core/I18n',
'moxie/file/File',
'moxie/runtime/Runtime',
'moxie/runtime/RuntimeClient'
], function(Basic, Mime, Dom, x, EventTarget, I18n, File, Runtime, RuntimeClient) {
/**
Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click,
converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory
with _FileReader_ or uploaded to a server through _XMLHttpRequest_.
@class FileInput
@constructor
@extends EventTarget
@uses RuntimeClient
@param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_.
@param {String|DOMElement} options.browse_button DOM Element to turn into file picker.
@param {Array} [options.accept] Array of mime types to accept. By default accepts all.
@param {String} [options.file='file'] Name of the file field (not the filename).
@param {Boolean} [options.multiple=false] Enable selection of multiple files.
@param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time).
@param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode
for _browse\_button_.
@param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support.
@example
<div id="container">
<a id="file-picker" href="javascript:;">Browse...</a>
</div>
<script>
var fileInput = new mOxie.FileInput({
browse_button: 'file-picker', // or document.getElementById('file-picker')
container: 'container',
accept: [
{title: "Image files", extensions: "jpg,gif,png"} // accept only images
],
multiple: true // allow multiple file selection
});
fileInput.onchange = function(e) {
// do something to files array
console.info(e.target.files); // or this.files or fileInput.files
};
fileInput.init(); // initialize
</script>
*/
var dispatches = [
/**
Dispatched when runtime is connected and file-picker is ready to be used.
@event ready
@param {Object} event
*/
'ready',
/**
Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked.
Check [corresponding documentation entry](#method_refresh) for more info.
@event refresh
@param {Object} event
*/
/**
Dispatched when selection of files in the dialog is complete.
@event change
@param {Object} event
*/
'change',
'cancel', // TODO: might be useful
/**
Dispatched when mouse cursor enters file-picker area. Can be used to style element
accordingly.
@event mouseenter
@param {Object} event
*/
'mouseenter',
/**
Dispatched when mouse cursor leaves file-picker area. Can be used to style element
accordingly.
@event mouseleave
@param {Object} event
*/
'mouseleave',
/**
Dispatched when functional mouse button is pressed on top of file-picker area.
@event mousedown
@param {Object} event
*/
'mousedown',
/**
Dispatched when functional mouse button is released on top of file-picker area.
@event mouseup
@param {Object} event
*/
'mouseup'
];
function FileInput(options) {
var self = this,
container, browseButton, defaults;
// if flat argument passed it should be browse_button id
if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) {
options = { browse_button : options };
}
// this will help us to find proper default container
browseButton = Dom.get(options.browse_button);
if (!browseButton) {
// browse button is required
throw new x.DOMException(x.DOMException.NOT_FOUND_ERR);
}
// figure out the options
defaults = {
accept: [{
title: I18n.translate('All Files'),
extensions: '*'
}],
name: 'file',
multiple: false,
required_caps: false,
container: browseButton.parentNode || document.body
};
options = Basic.extend({}, defaults, options);
// convert to object representation
if (typeof(options.required_caps) === 'string') {
options.required_caps = Runtime.parseCaps(options.required_caps);
}
// normalize accept option (could be list of mime types or array of title/extensions pairs)
if (typeof(options.accept) === 'string') {
options.accept = Mime.mimes2extList(options.accept);
}
container = Dom.get(options.container);
// make sure we have container
if (!container) {
container = document.body;
}
// make container relative, if it's not
if (Dom.getStyle(container, 'position') === 'static') {
container.style.position = 'relative';
}
container = browseButton = null; // IE
RuntimeClient.call(self);
Basic.extend(self, {
/**
Unique id of the component
@property uid
@protected
@readOnly
@type {String}
@default UID
*/
uid: Basic.guid('uid_'),
/**
Unique id of the connected runtime, if any.
@property ruid
@protected
@type {String}
*/
ruid: null,
/**
Unique id of the runtime container. Useful to get hold of it for various manipulations.
@property shimid
@protected
@type {String}
*/
shimid: null,
/**
Array of selected mOxie.File objects
@property files
@type {Array}
@default null
*/
files: null,
/**
Initializes the file-picker, connects it to runtime and dispatches event ready when done.
@method init
*/
init: function() {
self.convertEventPropsToHandlers(dispatches);
self.bind('RuntimeInit', function(e, runtime) {
self.ruid = runtime.uid;
self.shimid = runtime.shimid;
self.bind("Ready", function() {
self.trigger("Refresh");
}, 999);
self.bind("Change", function() {
var files = runtime.exec.call(self, 'FileInput', 'getFiles');
self.files = [];
Basic.each(files, function(file) {
// ignore empty files (IE10 for example hangs if you try to send them via XHR)
if (file.size === 0) {
return true;
}
self.files.push(new File(self.ruid, file));
});
}, 999);
// re-position and resize shim container
self.bind('Refresh', function() {
var pos, size, browseButton, shimContainer;
browseButton = Dom.get(options.browse_button);
shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist
if (browseButton) {
pos = Dom.getPos(browseButton, Dom.get(options.container));
size = Dom.getSize(browseButton);
if (shimContainer) {
Basic.extend(shimContainer.style, {
top : pos.y + 'px',
left : pos.x + 'px',
width : size.w + 'px',
height : size.h + 'px'
});
}
}
shimContainer = browseButton = null;
});
runtime.exec.call(self, 'FileInput', 'init', options);
});
// runtime needs: options.required_features, options.runtime_order and options.container
self.connectRuntime(Basic.extend({}, options, {
required_caps: {
select_file: true
}
}));
},
/**
Disables file-picker element, so that it doesn't react to mouse clicks.
@method disable
@param {Boolean} [state=true] Disable component if - true, enable if - false
*/
disable: function(state) {
var runtime = this.getRuntime();
if (runtime) {
runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state);
}
},
/**
Reposition and resize dialog trigger to match the position and size of browse_button element.
@method refresh
*/
refresh: function() {
self.trigger("Refresh");
},
/**
Destroy component.
@method destroy
*/
destroy: function() {
var runtime = this.getRuntime();
if (runtime) {
runtime.exec.call(this, 'FileInput', 'destroy');
this.disconnectRuntime();
}
if (Basic.typeOf(this.files) === 'array') {
// no sense in leaving associated files behind
Basic.each(this.files, function(file) {
file.destroy();
});
}
this.files = null;
}
});
}
FileInput.prototype = EventTarget.instance;
return FileInput;
});
// Included from: src/javascript/runtime/RuntimeTarget.js
/**
* RuntimeTarget.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/runtime/RuntimeTarget', [
'moxie/core/utils/Basic',
'moxie/runtime/RuntimeClient',
"moxie/core/EventTarget"
], function(Basic, RuntimeClient, EventTarget) {
/**
Instance of this class can be used as a target for the events dispatched by shims,
when allowing them onto components is for either reason inappropriate
@class RuntimeTarget
@constructor
@protected
@extends EventTarget
*/
function RuntimeTarget() {
this.uid = Basic.guid('uid_');
RuntimeClient.call(this);
this.destroy = function() {
this.disconnectRuntime();
this.unbindAll();
};
}
RuntimeTarget.prototype = EventTarget.instance;
return RuntimeTarget;
});
// Included from: src/javascript/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileReader', [
'moxie/core/utils/Basic',
'moxie/core/utils/Encode',
'moxie/core/Exceptions',
'moxie/core/EventTarget',
'moxie/file/Blob',
'moxie/file/File',
'moxie/runtime/RuntimeTarget'
], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) {
/**
Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader)
interface. Where possible uses native FileReader, where - not falls back to shims.
@class FileReader
@constructor FileReader
@extends EventTarget
@uses RuntimeClient
*/
var dispatches = [
/**
Dispatched when the read starts.
@event loadstart
@param {Object} event
*/
'loadstart',
/**
Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total).
@event progress
@param {Object} event
*/
'progress',
/**
Dispatched when the read has successfully completed.
@event load
@param {Object} event
*/
'load',
/**
Dispatched when the read has been aborted. For instance, by invoking the abort() method.
@event abort
@param {Object} event
*/
'abort',
/**
Dispatched when the read has failed.
@event error
@param {Object} event
*/
'error',
/**
Dispatched when the request has completed (either in success or failure).
@event loadend
@param {Object} event
*/
'loadend'
];
function FileReader() {
var self = this, _fr;
Basic.extend(this, {
/**
UID of the component instance.
@property uid
@type {String}
*/
uid: Basic.guid('uid_'),
/**
Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING
and FileReader.DONE.
@property readyState
@type {Number}
@default FileReader.EMPTY
*/
readyState: FileReader.EMPTY,
/**
Result of the successful read operation.
@property result
@type {String}
*/
result: null,
/**
Stores the error of failed asynchronous read operation.
@property error
@type {DOMError}
*/
error: null,
/**
Initiates reading of File/Blob object contents to binary string.
@method readAsBinaryString
@param {Blob|File} blob Object to preload
*/
readAsBinaryString: function(blob) {
_read.call(this, 'readAsBinaryString', blob);
},
/**
Initiates reading of File/Blob object contents to dataURL string.
@method readAsDataURL
@param {Blob|File} blob Object to preload
*/
readAsDataURL: function(blob) {
_read.call(this, 'readAsDataURL', blob);
},
/**
Initiates reading of File/Blob object contents to string.
@method readAsText
@param {Blob|File} blob Object to preload
*/
readAsText: function(blob) {
_read.call(this, 'readAsText', blob);
},
/**
Aborts preloading process.
@method abort
*/
abort: function() {
this.result = null;
if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) {
return;
} else if (this.readyState === FileReader.LOADING) {
this.readyState = FileReader.DONE;
}
if (_fr) {
_fr.getRuntime().exec.call(this, 'FileReader', 'abort');
}
this.trigger('abort');
this.trigger('loadend');
},
/**
Destroy component and release resources.
@method destroy
*/
destroy: function() {
this.abort();
if (_fr) {
_fr.getRuntime().exec.call(this, 'FileReader', 'destroy');
_fr.disconnectRuntime();
}
self = _fr = null;
}
});
function _read(op, blob) {
_fr = new RuntimeTarget();
function error(err) {
self.readyState = FileReader.DONE;
self.error = err;
self.trigger('error');
loadEnd();
}
function loadEnd() {
_fr.destroy();
_fr = null;
self.trigger('loadend');
}
function exec(runtime) {
_fr.bind('Error', function(e, err) {
error(err);
});
_fr.bind('Progress', function(e) {
self.result = runtime.exec.call(_fr, 'FileReader', 'getResult');
self.trigger(e);
});
_fr.bind('Load', function(e) {
self.readyState = FileReader.DONE;
self.result = runtime.exec.call(_fr, 'FileReader', 'getResult');
self.trigger(e);
loadEnd();
});
runtime.exec.call(_fr, 'FileReader', 'read', op, blob);
}
this.convertEventPropsToHandlers(dispatches);
if (this.readyState === FileReader.LOADING) {
return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR));
}
this.readyState = FileReader.LOADING;
this.trigger('loadstart');
// if source is o.Blob/o.File
if (blob instanceof Blob) {
if (blob.isDetached()) {
var src = blob.getSource();
switch (op) {
case 'readAsText':
case 'readAsBinaryString':
this.result = src;
break;
case 'readAsDataURL':
this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src);
break;
}
this.readyState = FileReader.DONE;
this.trigger('load');
loadEnd();
} else {
exec(_fr.connectRuntime(blob.ruid));
}
} else {
error(new x.DOMException(x.DOMException.NOT_FOUND_ERR));
}
}
}
/**
Initial FileReader state
@property EMPTY
@type {Number}
@final
@static
@default 0
*/
FileReader.EMPTY = 0;
/**
FileReader switches to this state when it is preloading the source
@property LOADING
@type {Number}
@final
@static
@default 1
*/
FileReader.LOADING = 1;
/**
Preloading is complete, this is a final state
@property DONE
@type {Number}
@final
@static
@default 2
*/
FileReader.DONE = 2;
FileReader.prototype = EventTarget.instance;
return FileReader;
});
// Included from: src/javascript/core/utils/Url.js
/**
* Url.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Url', [], function() {
/**
Parse url into separate components and fill in absent parts with parts from current url,
based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js
@method parseUrl
@for Utils
@static
@param {String} url Url to parse (defaults to empty string if undefined)
@return {Object} Hash containing extracted uri components
*/
var parseUrl = function(url, currentUrl) {
var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment']
, i = key.length
, ports = {
http: 80,
https: 443
}
, uri = {}
, regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/
, m = regex.exec(url || '')
;
while (i--) {
if (m[i]) {
uri[key[i]] = m[i];
}
}
// when url is relative, we set the origin and the path ourselves
if (!uri.scheme) {
// come up with defaults
if (!currentUrl || typeof(currentUrl) === 'string') {
currentUrl = parseUrl(currentUrl || document.location.href);
}
uri.scheme = currentUrl.scheme;
uri.host = currentUrl.host;
uri.port = currentUrl.port;
var path = '';
// for urls without trailing slash we need to figure out the path
if (/^[^\/]/.test(uri.path)) {
path = currentUrl.path;
// if path ends with a filename, strip it
if (!/(\/|\/[^\.]+)$/.test(path)) {
path = path.replace(/\/[^\/]+$/, '/');
} else {
path += '/';
}
}
uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir
}
if (!uri.port) {
uri.port = ports[uri.scheme] || 80;
}
uri.port = parseInt(uri.port, 10);
if (!uri.path) {
uri.path = "/";
}
delete uri.source;
return uri;
};
/**
Resolve url - among other things will turn relative url to absolute
@method resolveUrl
@static
@param {String} url Either absolute or relative
@return {String} Resolved, absolute url
*/
var resolveUrl = function(url) {
var ports = { // we ignore default ports
http: 80,
https: 443
}
, urlp = parseUrl(url)
;
return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : '');
};
/**
Check if specified url has the same origin as the current document
@method hasSameOrigin
@param {String|Object} url
@return {Boolean}
*/
var hasSameOrigin = function(url) {
function origin(url) {
return [url.scheme, url.host, url.port].join('/');
}
if (typeof url === 'string') {
url = parseUrl(url);
}
return origin(parseUrl()) === origin(url);
};
return {
parseUrl: parseUrl,
resolveUrl: resolveUrl,
hasSameOrigin: hasSameOrigin
};
});
// Included from: src/javascript/file/FileReaderSync.js
/**
* FileReaderSync.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/file/FileReaderSync', [
'moxie/core/utils/Basic',
'moxie/runtime/RuntimeClient',
'moxie/core/utils/Encode'
], function(Basic, RuntimeClient, Encode) {
/**
Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here
it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be,
but probably < 1mb). Not meant to be used directly by user.
@class FileReaderSync
@private
@constructor
*/
return function() {
RuntimeClient.call(this);
Basic.extend(this, {
uid: Basic.guid('uid_'),
readAsBinaryString: function(blob) {
return _read.call(this, 'readAsBinaryString', blob);
},
readAsDataURL: function(blob) {
return _read.call(this, 'readAsDataURL', blob);
},
/*readAsArrayBuffer: function(blob) {
return _read.call(this, 'readAsArrayBuffer', blob);
},*/
readAsText: function(blob) {
return _read.call(this, 'readAsText', blob);
}
});
function _read(op, blob) {
if (blob.isDetached()) {
var src = blob.getSource();
switch (op) {
case 'readAsBinaryString':
return src;
case 'readAsDataURL':
return 'data:' + blob.type + ';base64,' + Encode.btoa(src);
case 'readAsText':
var txt = '';
for (var i = 0, length = src.length; i < length; i++) {
txt += String.fromCharCode(src[i]);
}
return txt;
}
} else {
var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob);
this.disconnectRuntime();
return result;
}
}
};
});
// Included from: src/javascript/xhr/FormData.js
/**
* FormData.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/xhr/FormData", [
"moxie/core/Exceptions",
"moxie/core/utils/Basic",
"moxie/file/Blob"
], function(x, Basic, Blob) {
/**
FormData
@class FormData
@constructor
*/
function FormData() {
var _blob, _fields = [];
Basic.extend(this, {
/**
Append another key-value pair to the FormData object
@method append
@param {String} name Name for the new field
@param {String|Blob|Array|Object} value Value for the field
*/
append: function(name, value) {
var self = this, valueType = Basic.typeOf(value);
// according to specs value might be either Blob or String
if (value instanceof Blob) {
_blob = {
name: name,
value: value // unfortunately we can only send single Blob in one FormData
};
} else if ('array' === valueType) {
name += '[]';
Basic.each(value, function(value) {
self.append(name, value);
});
} else if ('object' === valueType) {
Basic.each(value, function(value, key) {
self.append(name + '[' + key + ']', value);
});
} else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) {
self.append(name, "false");
} else {
_fields.push({
name: name,
value: value.toString()
});
}
},
/**
Checks if FormData contains Blob.
@method hasBlob
@return {Boolean}
*/
hasBlob: function() {
return !!this.getBlob();
},
/**
Retrieves blob.
@method getBlob
@return {Object} Either Blob if found or null
*/
getBlob: function() {
return _blob && _blob.value || null;
},
/**
Retrieves blob field name.
@method getBlobName
@return {String} Either Blob field name or null
*/
getBlobName: function() {
return _blob && _blob.name || null;
},
/**
Loop over the fields in FormData and invoke the callback for each of them.
@method each
@param {Function} cb Callback to call for each field
*/
each: function(cb) {
Basic.each(_fields, function(field) {
cb(field.value, field.name);
});
if (_blob) {
cb(_blob.value, _blob.name);
}
},
destroy: function() {
_blob = null;
_fields = [];
}
});
}
return FormData;
});
// Included from: src/javascript/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/xhr/XMLHttpRequest", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/core/EventTarget",
"moxie/core/utils/Encode",
"moxie/core/utils/Url",
"moxie/runtime/Runtime",
"moxie/runtime/RuntimeTarget",
"moxie/file/Blob",
"moxie/file/FileReaderSync",
"moxie/xhr/FormData",
"moxie/core/utils/Env",
"moxie/core/utils/Mime"
], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) {
var httpCode = {
100: 'Continue',
101: 'Switching Protocols',
102: 'Processing',
200: 'OK',
201: 'Created',
202: 'Accepted',
203: 'Non-Authoritative Information',
204: 'No Content',
205: 'Reset Content',
206: 'Partial Content',
207: 'Multi-Status',
226: 'IM Used',
300: 'Multiple Choices',
301: 'Moved Permanently',
302: 'Found',
303: 'See Other',
304: 'Not Modified',
305: 'Use Proxy',
306: 'Reserved',
307: 'Temporary Redirect',
400: 'Bad Request',
401: 'Unauthorized',
402: 'Payment Required',
403: 'Forbidden',
404: 'Not Found',
405: 'Method Not Allowed',
406: 'Not Acceptable',
407: 'Proxy Authentication Required',
408: 'Request Timeout',
409: 'Conflict',
410: 'Gone',
411: 'Length Required',
412: 'Precondition Failed',
413: 'Request Entity Too Large',
414: 'Request-URI Too Long',
415: 'Unsupported Media Type',
416: 'Requested Range Not Satisfiable',
417: 'Expectation Failed',
422: 'Unprocessable Entity',
423: 'Locked',
424: 'Failed Dependency',
426: 'Upgrade Required',
500: 'Internal Server Error',
501: 'Not Implemented',
502: 'Bad Gateway',
503: 'Service Unavailable',
504: 'Gateway Timeout',
505: 'HTTP Version Not Supported',
506: 'Variant Also Negotiates',
507: 'Insufficient Storage',
510: 'Not Extended'
};
function XMLHttpRequestUpload() {
this.uid = Basic.guid('uid_');
}
XMLHttpRequestUpload.prototype = EventTarget.instance;
/**
Implementation of XMLHttpRequest
@class XMLHttpRequest
@constructor
@uses RuntimeClient
@extends EventTarget
*/
var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons)
var NATIVE = 1, RUNTIME = 2;
function XMLHttpRequest() {
var self = this,
// this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible
props = {
/**
The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout.
@property timeout
@type Number
@default 0
*/
timeout: 0,
/**
Current state, can take following values:
UNSENT (numeric value 0)
The object has been constructed.
OPENED (numeric value 1)
The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method.
HEADERS_RECEIVED (numeric value 2)
All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available.
LOADING (numeric value 3)
The response entity body is being received.
DONE (numeric value 4)
@property readyState
@type Number
@default 0 (UNSENT)
*/
readyState: XMLHttpRequest.UNSENT,
/**
True when user credentials are to be included in a cross-origin request. False when they are to be excluded
in a cross-origin request and when cookies are to be ignored in its response. Initially false.
@property withCredentials
@type Boolean
@default false
*/
withCredentials: false,
/**
Returns the HTTP status code.
@property status
@type Number
@default 0
*/
status: 0,
/**
Returns the HTTP status text.
@property statusText
@type String
*/
statusText: "",
/**
Returns the response type. Can be set to change the response type. Values are:
the empty string (default), "arraybuffer", "blob", "document", "json", and "text".
@property responseType
@type String
*/
responseType: "",
/**
Returns the document response entity body.
Throws an "InvalidStateError" exception if responseType is not the empty string or "document".
@property responseXML
@type Document
*/
responseXML: null,
/**
Returns the text response entity body.
Throws an "InvalidStateError" exception if responseType is not the empty string or "text".
@property responseText
@type String
*/
responseText: null,
/**
Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body).
Can become: ArrayBuffer, Blob, Document, JSON, Text
@property response
@type Mixed
*/
response: null
},
_async = true,
_url,
_method,
_headers = {},
_user,
_password,
_encoding = null,
_mimeType = null,
// flags
_sync_flag = false,
_send_flag = false,
_upload_events_flag = false,
_upload_complete_flag = false,
_error_flag = false,
_same_origin_flag = false,
// times
_start_time,
_timeoutset_time,
_finalMime = null,
_finalCharset = null,
_options = {},
_xhr,
_responseHeaders = '',
_responseHeadersBag
;
Basic.extend(this, props, {
/**
Unique id of the component
@property uid
@type String
*/
uid: Basic.guid('uid_'),
/**
Target for Upload events
@property upload
@type XMLHttpRequestUpload
*/
upload: new XMLHttpRequestUpload(),
/**
Sets the request method, request URL, synchronous flag, request username, and request password.
Throws a "SyntaxError" exception if one of the following is true:
method is not a valid HTTP method.
url cannot be resolved.
url contains the "user:password" format in the userinfo production.
Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK.
Throws an "InvalidAccessError" exception if one of the following is true:
Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin.
There is an associated XMLHttpRequest document and either the timeout attribute is not zero,
the withCredentials attribute is true, or the responseType attribute is not the empty string.
@method open
@param {String} method HTTP method to use on request
@param {String} url URL to request
@param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default.
@param {String} [user] Username to use in HTTP authentication process on server-side
@param {String} [password] Password to use in HTTP authentication process on server-side
*/
open: function(method, url, async, user, password) {
var urlp;
// first two arguments are required
if (!method || !url) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method
if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 3
if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) {
_method = method.toUpperCase();
}
// 4 - allowing these methods poses a security risk
if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) {
throw new x.DOMException(x.DOMException.SECURITY_ERR);
}
// 5
url = Encode.utf8_encode(url);
// 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError".
urlp = Url.parseUrl(url);
_same_origin_flag = Url.hasSameOrigin(urlp);
// 7 - manually build up absolute url
_url = Url.resolveUrl(url);
// 9-10, 12-13
if ((user || password) && !_same_origin_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
_user = user || urlp.user;
_password = password || urlp.pass;
// 11
_async = async || true;
if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 14 - terminate abort()
// 15 - terminate send()
// 18
_sync_flag = !_async;
_send_flag = false;
_headers = {};
_reset.call(this);
// 19
_p('readyState', XMLHttpRequest.OPENED);
// 20
this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers
this.dispatchEvent('readystatechange');
},
/**
Appends an header to the list of author request headers, or if header is already
in the list of author request headers, combines its value with value.
Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set.
Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value
is not a valid HTTP header field value.
@method setRequestHeader
@param {String} header
@param {String|Number} value
*/
setRequestHeader: function(header, value) {
var uaHeaders = [ // these headers are controlled by the user agent
"accept-charset",
"accept-encoding",
"access-control-request-headers",
"access-control-request-method",
"connection",
"content-length",
"cookie",
"cookie2",
"content-transfer-encoding",
"date",
"expect",
"host",
"keep-alive",
"origin",
"referer",
"te",
"trailer",
"transfer-encoding",
"upgrade",
"user-agent",
"via"
];
// 1-2
if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3
if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 4
/* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values
if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}*/
header = Basic.trim(header).toLowerCase();
// setting of proxy-* and sec-* headers is prohibited by spec
if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) {
return false;
}
// camelize
// browsers lowercase header names (at least for custom ones)
// header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); });
if (!_headers[header]) {
_headers[header] = value;
} else {
// http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph)
_headers[header] += ', ' + value;
}
return true;
},
/**
Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2.
@method getAllResponseHeaders
@return {String} reponse headers or empty string
*/
getAllResponseHeaders: function() {
return _responseHeaders || '';
},
/**
Returns the header field value from the response of which the field name matches header,
unless the field name is Set-Cookie or Set-Cookie2.
@method getResponseHeader
@param {String} header
@return {String} value(s) for the specified header or null
*/
getResponseHeader: function(header) {
header = header.toLowerCase();
if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) {
return null;
}
if (_responseHeaders && _responseHeaders !== '') {
// if we didn't parse response headers until now, do it and keep for later
if (!_responseHeadersBag) {
_responseHeadersBag = {};
Basic.each(_responseHeaders.split(/\r\n/), function(line) {
var pair = line.split(/:\s+/);
if (pair.length === 2) { // last line might be empty, omit
pair[0] = Basic.trim(pair[0]); // just in case
_responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form
header: pair[0],
value: Basic.trim(pair[1])
};
}
});
}
if (_responseHeadersBag.hasOwnProperty(header)) {
return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value;
}
}
return null;
},
/**
Sets the Content-Type header for the response to mime.
Throws an "InvalidStateError" exception if the state is LOADING or DONE.
Throws a "SyntaxError" exception if mime is not a valid media type.
@method overrideMimeType
@param String mime Mime type to set
*/
overrideMimeType: function(mime) {
var matches, charset;
// 1
if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2
mime = Basic.trim(mime.toLowerCase());
if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) {
mime = matches[1];
if (matches[2]) {
charset = matches[2];
}
}
if (!Mime.mimes[mime]) {
throw new x.DOMException(x.DOMException.SYNTAX_ERR);
}
// 3-4
_finalMime = mime;
_finalCharset = charset;
},
/**
Initiates the request. The optional argument provides the request entity body.
The argument is ignored if request method is GET or HEAD.
Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set.
@method send
@param {Blob|Document|String|FormData} [data] Request entity body
@param {Object} [options] Set of requirements and pre-requisities for runtime initialization
*/
send: function(data, options) {
if (Basic.typeOf(options) === 'string') {
_options = { ruid: options };
} else if (!options) {
_options = {};
} else {
_options = options;
}
this.convertEventPropsToHandlers(dispatches);
this.upload.convertEventPropsToHandlers(dispatches);
// 1-2
if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3
// sending Blob
if (data instanceof Blob) {
_options.ruid = data.ruid;
_mimeType = data.type || 'application/octet-stream';
}
// FormData
else if (data instanceof FormData) {
if (data.hasBlob()) {
var blob = data.getBlob();
_options.ruid = blob.ruid;
_mimeType = blob.type || 'application/octet-stream';
}
}
// DOMString
else if (typeof data === 'string') {
_encoding = 'UTF-8';
_mimeType = 'text/plain;charset=UTF-8';
// data should be converted to Unicode and encoded as UTF-8
data = Encode.utf8_encode(data);
}
// if withCredentials not set, but requested, set it automatically
if (!this.withCredentials) {
this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag;
}
// 4 - storage mutex
// 5
_upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP
// 6
_error_flag = false;
// 7
_upload_complete_flag = !data;
// 8 - Asynchronous steps
if (!_sync_flag) {
// 8.1
_send_flag = true;
// 8.2
// this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr
// 8.3
//if (!_upload_complete_flag) {
// this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr
//}
}
// 8.5 - Return the send() method call, but continue running the steps in this algorithm.
_doXHR.call(this, data);
},
/**
Cancels any network activity.
@method abort
*/
abort: function() {
_error_flag = true;
_sync_flag = false;
if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) {
_p('readyState', XMLHttpRequest.DONE);
_send_flag = false;
if (_xhr) {
_xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag);
} else {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
_upload_complete_flag = true;
} else {
_p('readyState', XMLHttpRequest.UNSENT);
}
},
destroy: function() {
if (_xhr) {
if (Basic.typeOf(_xhr.destroy) === 'function') {
_xhr.destroy();
}
_xhr = null;
}
this.unbindAll();
if (this.upload) {
this.upload.unbindAll();
this.upload = null;
}
}
});
/* this is nice, but maybe too lengthy
// if supported by JS version, set getters/setters for specific properties
o.defineProperty(this, 'readyState', {
configurable: false,
get: function() {
return _p('readyState');
}
});
o.defineProperty(this, 'timeout', {
configurable: false,
get: function() {
return _p('timeout');
},
set: function(value) {
if (_sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// timeout still should be measured relative to the start time of request
_timeoutset_time = (new Date).getTime();
_p('timeout', value);
}
});
// the withCredentials attribute has no effect when fetching same-origin resources
o.defineProperty(this, 'withCredentials', {
configurable: false,
get: function() {
return _p('withCredentials');
},
set: function(value) {
// 1-2
if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 3-4
if (_anonymous_flag || _sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 5
_p('withCredentials', value);
}
});
o.defineProperty(this, 'status', {
configurable: false,
get: function() {
return _p('status');
}
});
o.defineProperty(this, 'statusText', {
configurable: false,
get: function() {
return _p('statusText');
}
});
o.defineProperty(this, 'responseType', {
configurable: false,
get: function() {
return _p('responseType');
},
set: function(value) {
// 1
if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2
if (_sync_flag) {
throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR);
}
// 3
_p('responseType', value.toLowerCase());
}
});
o.defineProperty(this, 'responseText', {
configurable: false,
get: function() {
// 1
if (!~o.inArray(_p('responseType'), ['', 'text'])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2-3
if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return _p('responseText');
}
});
o.defineProperty(this, 'responseXML', {
configurable: false,
get: function() {
// 1
if (!~o.inArray(_p('responseType'), ['', 'document'])) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
// 2-3
if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) {
throw new x.DOMException(x.DOMException.INVALID_STATE_ERR);
}
return _p('responseXML');
}
});
o.defineProperty(this, 'response', {
configurable: false,
get: function() {
if (!!~o.inArray(_p('responseType'), ['', 'text'])) {
if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) {
return '';
}
}
if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) {
return null;
}
return _p('response');
}
});
*/
function _p(prop, value) {
if (!props.hasOwnProperty(prop)) {
return;
}
if (arguments.length === 1) { // get
return Env.can('define_property') ? props[prop] : self[prop];
} else { // set
if (Env.can('define_property')) {
props[prop] = value;
} else {
self[prop] = value;
}
}
}
/*
function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) {
// TODO: http://tools.ietf.org/html/rfc3490#section-4.1
return str.toLowerCase();
}
*/
function _doXHR(data) {
var self = this;
_start_time = new Date().getTime();
_xhr = new RuntimeTarget();
function loadEnd() {
if (_xhr) { // it could have been destroyed by now
_xhr.destroy();
_xhr = null;
}
self.dispatchEvent('loadend');
self = null;
}
function exec(runtime) {
_xhr.bind('LoadStart', function(e) {
_p('readyState', XMLHttpRequest.LOADING);
self.dispatchEvent('readystatechange');
self.dispatchEvent(e);
if (_upload_events_flag) {
self.upload.dispatchEvent(e);
}
});
_xhr.bind('Progress', function(e) {
if (_p('readyState') !== XMLHttpRequest.LOADING) {
_p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example)
self.dispatchEvent('readystatechange');
}
self.dispatchEvent(e);
});
_xhr.bind('UploadProgress', function(e) {
if (_upload_events_flag) {
self.upload.dispatchEvent({
type: 'progress',
lengthComputable: false,
total: e.total,
loaded: e.loaded
});
}
});
_xhr.bind('Load', function(e) {
_p('readyState', XMLHttpRequest.DONE);
_p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0));
_p('statusText', httpCode[_p('status')] || "");
_p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType')));
if (!!~Basic.inArray(_p('responseType'), ['text', ''])) {
_p('responseText', _p('response'));
} else if (_p('responseType') === 'document') {
_p('responseXML', _p('response'));
}
_responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders');
self.dispatchEvent('readystatechange');
if (_p('status') > 0) { // status 0 usually means that server is unreachable
if (_upload_events_flag) {
self.upload.dispatchEvent(e);
}
self.dispatchEvent(e);
} else {
_error_flag = true;
self.dispatchEvent('error');
}
loadEnd();
});
_xhr.bind('Abort', function(e) {
self.dispatchEvent(e);
loadEnd();
});
_xhr.bind('Error', function(e) {
_error_flag = true;
_p('readyState', XMLHttpRequest.DONE);
self.dispatchEvent('readystatechange');
_upload_complete_flag = true;
self.dispatchEvent(e);
loadEnd();
});
runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', {
url: _url,
method: _method,
async: _async,
user: _user,
password: _password,
headers: _headers,
mimeType: _mimeType,
encoding: _encoding,
responseType: self.responseType,
withCredentials: self.withCredentials,
options: _options
}, data);
}
// clarify our requirements
if (typeof(_options.required_caps) === 'string') {
_options.required_caps = Runtime.parseCaps(_options.required_caps);
}
_options.required_caps = Basic.extend({}, _options.required_caps, {
return_response_type: self.responseType
});
if (data instanceof FormData) {
_options.required_caps.send_multipart = true;
}
if (!_same_origin_flag) {
_options.required_caps.do_cors = true;
}
if (_options.ruid) { // we do not need to wait if we can connect directly
exec(_xhr.connectRuntime(_options));
} else {
_xhr.bind('RuntimeInit', function(e, runtime) {
exec(runtime);
});
_xhr.bind('RuntimeError', function(e, err) {
self.dispatchEvent('RuntimeError', err);
});
_xhr.connectRuntime(_options);
}
}
function _reset() {
_p('responseText', "");
_p('responseXML', null);
_p('response', null);
_p('status', 0);
_p('statusText', "");
_start_time = _timeoutset_time = null;
}
}
XMLHttpRequest.UNSENT = 0;
XMLHttpRequest.OPENED = 1;
XMLHttpRequest.HEADERS_RECEIVED = 2;
XMLHttpRequest.LOADING = 3;
XMLHttpRequest.DONE = 4;
XMLHttpRequest.prototype = EventTarget.instance;
return XMLHttpRequest;
});
// Included from: src/javascript/runtime/flash/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global ActiveXObject:true */
/**
Defines constructor for Flash runtime.
@class moxie/runtime/flash/Runtime
@private
*/
define("moxie/runtime/flash/Runtime", [
"moxie/core/utils/Basic",
"moxie/core/utils/Env",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/runtime/Runtime"
], function(Basic, Env, Dom, x, Runtime) {
var type = 'flash', extensions = {};
/**
Get the version of the Flash Player
@method getShimVersion
@private
@return {Number} Flash Player version
*/
function getShimVersion() {
var version;
try {
version = navigator.plugins['Shockwave Flash'];
version = version.description;
} catch (e1) {
try {
version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
} catch (e2) {
version = '0.0';
}
}
version = version.match(/\d+/g);
return parseFloat(version[0] + '.' + version[1]);
}
/**
Constructor for the Flash Runtime
@class FlashRuntime
@extends Runtime
*/
function FlashRuntime(options) {
var I = this, initTimer;
options = Basic.extend({ swf_url: Env.swf_url }, options);
Runtime.call(this, options, type, {
access_binary: function(value) {
return value && I.mode === 'browser';
},
access_image_binary: function(value) {
return value && I.mode === 'browser';
},
display_media: Runtime.capTrue,
do_cors: Runtime.capTrue,
drag_and_drop: false,
report_upload_progress: function() {
return I.mode === 'client';
},
resize_image: Runtime.capTrue,
return_response_headers: false,
return_response_type: function(responseType) {
if (responseType === 'json' && !!window.JSON) {
return true;
}
return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser';
},
return_status_code: function(code) {
return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]);
},
select_file: Runtime.capTrue,
select_multiple: Runtime.capTrue,
send_binary_string: function(value) {
return value && I.mode === 'browser';
},
send_browser_cookies: function(value) {
return value && I.mode === 'browser';
},
send_custom_headers: function(value) {
return value && I.mode === 'browser';
},
send_multipart: Runtime.capTrue,
slice_blob: function(value) {
return value && I.mode === 'browser';
},
stream_upload: function(value) {
return value && I.mode === 'browser';
},
summon_file_dialog: false,
upload_filesize: function(size) {
return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client';
},
use_http_method: function(methods) {
return !Basic.arrayDiff(methods, ['GET', 'POST']);
}
}, {
// capabilities that require specific mode
access_binary: function(value) {
return value ? 'browser' : 'client';
},
access_image_binary: function(value) {
return value ? 'browser' : 'client';
},
report_upload_progress: function(value) {
return value ? 'browser' : 'client';
},
return_response_type: function(responseType) {
return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser'];
},
return_status_code: function(code) {
return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser'];
},
send_binary_string: function(value) {
return value ? 'browser' : 'client';
},
send_browser_cookies: function(value) {
return value ? 'browser' : 'client';
},
send_custom_headers: function(value) {
return value ? 'browser' : 'client';
},
stream_upload: function(value) {
return value ? 'client' : 'browser';
},
upload_filesize: function(size) {
return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser';
}
}, 'client');
// minimal requirement for Flash Player version
if (getShimVersion() < 10) {
this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before
}
Basic.extend(this, {
getShim: function() {
return Dom.get(this.uid);
},
shimExec: function(component, action) {
var args = [].slice.call(arguments, 2);
return I.getShim().exec(this.uid, component, action, args);
},
init: function() {
var html, el, container;
container = this.getShimContainer();
// if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc)
Basic.extend(container.style, {
position: 'absolute',
top: '-8px',
left: '-8px',
width: '9px',
height: '9px',
overflow: 'hidden'
});
// insert flash object
html = '<object id="' + this.uid + '" type="application/x-shockwave-flash" data="' + options.swf_url + '" ';
if (Env.browser === 'IE') {
html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
}
html += 'width="100%" height="100%" style="outline:0">' +
'<param name="movie" value="' + options.swf_url + '" />' +
'<param name="flashvars" value="uid=' + escape(this.uid) + '&target=' + Env.global_event_dispatcher + '" />' +
'<param name="wmode" value="transparent" />' +
'<param name="allowscriptaccess" value="always" />' +
'</object>';
if (Env.browser === 'IE') {
el = document.createElement('div');
container.appendChild(el);
el.outerHTML = html;
el = container = null; // just in case
} else {
container.innerHTML = html;
}
// Init is dispatched by the shim
initTimer = setTimeout(function() {
if (I && !I.initialized) { // runtime might be already destroyed by this moment
I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));
}
}, 5000);
},
destroy: (function(destroy) { // extend default destroy method
return function() {
destroy.call(I);
clearTimeout(initTimer); // initialization check might be still onwait
options = initTimer = destroy = I = null;
};
}(this.destroy))
}, extensions);
}
Runtime.addConstructor(type, FlashRuntime);
return extensions;
});
// Included from: src/javascript/runtime/flash/file/Blob.js
/**
* Blob.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/Blob
@private
*/
define("moxie/runtime/flash/file/Blob", [
"moxie/runtime/flash/Runtime",
"moxie/file/Blob"
], function(extensions, Blob) {
var FlashBlob = {
slice: function(blob, start, end, type) {
var self = this.getRuntime();
if (start < 0) {
start = Math.max(blob.size + start, 0);
} else if (start > 0) {
start = Math.min(start, blob.size);
}
if (end < 0) {
end = Math.max(blob.size + end, 0);
} else if (end > 0) {
end = Math.min(end, blob.size);
}
blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || '');
if (blob) {
blob = new Blob(self.uid, blob);
}
return blob;
}
};
return (extensions.Blob = FlashBlob);
});
// Included from: src/javascript/runtime/flash/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileInput
@private
*/
define("moxie/runtime/flash/file/FileInput", [
"moxie/runtime/flash/Runtime"
], function(extensions) {
var FileInput = {
init: function(options) {
this.getRuntime().shimExec.call(this, 'FileInput', 'init', {
name: options.name,
accept: options.accept,
multiple: options.multiple
});
this.trigger('ready');
}
};
return (extensions.FileInput = FileInput);
});
// Included from: src/javascript/runtime/flash/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileReader
@private
*/
define("moxie/runtime/flash/file/FileReader", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Encode"
], function(extensions, Encode) {
var _result = '';
function _formatData(data, op) {
switch (op) {
case 'readAsText':
return Encode.atob(data, 'utf8');
case 'readAsBinaryString':
return Encode.atob(data);
case 'readAsDataURL':
return data;
}
return null;
}
var FileReader = {
read: function(op, blob) {
var target = this, self = target.getRuntime();
// special prefix for DataURL read mode
if (op === 'readAsDataURL') {
_result = 'data:' + (blob.type || '') + ';base64,';
}
target.bind('Progress', function(e, data) {
if (data) {
_result += _formatData(data, op);
}
});
return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid);
},
getResult: function() {
return _result;
},
destroy: function() {
_result = null;
}
};
return (extensions.FileReader = FileReader);
});
// Included from: src/javascript/runtime/flash/file/FileReaderSync.js
/**
* FileReaderSync.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/file/FileReaderSync
@private
*/
define("moxie/runtime/flash/file/FileReaderSync", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Encode"
], function(extensions, Encode) {
function _formatData(data, op) {
switch (op) {
case 'readAsText':
return Encode.atob(data, 'utf8');
case 'readAsBinaryString':
return Encode.atob(data);
case 'readAsDataURL':
return data;
}
return null;
}
var FileReaderSync = {
read: function(op, blob) {
var result, self = this.getRuntime();
result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid);
if (!result) {
return null; // or throw ex
}
// special prefix for DataURL read mode
if (op === 'readAsDataURL') {
result = 'data:' + (blob.type || '') + ';base64,' + result;
}
return _formatData(result, op, blob.type);
}
};
return (extensions.FileReaderSync = FileReaderSync);
});
// Included from: src/javascript/runtime/Transporter.js
/**
* Transporter.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define("moxie/runtime/Transporter", [
"moxie/core/utils/Basic",
"moxie/core/utils/Encode",
"moxie/runtime/RuntimeClient",
"moxie/core/EventTarget"
], function(Basic, Encode, RuntimeClient, EventTarget) {
function Transporter() {
var mod, _runtime, _data, _size, _pos, _chunk_size;
RuntimeClient.call(this);
Basic.extend(this, {
uid: Basic.guid('uid_'),
state: Transporter.IDLE,
result: null,
transport: function(data, type, options) {
var self = this;
options = Basic.extend({
chunk_size: 204798
}, options);
// should divide by three, base64 requires this
if ((mod = options.chunk_size % 3)) {
options.chunk_size += 3 - mod;
}
_chunk_size = options.chunk_size;
_reset.call(this);
_data = data;
_size = data.length;
if (Basic.typeOf(options) === 'string' || options.ruid) {
_run.call(self, type, this.connectRuntime(options));
} else {
// we require this to run only once
var cb = function(e, runtime) {
self.unbind("RuntimeInit", cb);
_run.call(self, type, runtime);
};
this.bind("RuntimeInit", cb);
this.connectRuntime(options);
}
},
abort: function() {
var self = this;
self.state = Transporter.IDLE;
if (_runtime) {
_runtime.exec.call(self, 'Transporter', 'clear');
self.trigger("TransportingAborted");
}
_reset.call(self);
},
destroy: function() {
this.unbindAll();
_runtime = null;
this.disconnectRuntime();
_reset.call(this);
}
});
function _reset() {
_size = _pos = 0;
_data = this.result = null;
}
function _run(type, runtime) {
var self = this;
_runtime = runtime;
//self.unbind("RuntimeInit");
self.bind("TransportingProgress", function(e) {
_pos = e.loaded;
if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) {
_transport.call(self);
}
}, 999);
self.bind("TransportingComplete", function() {
_pos = _size;
self.state = Transporter.DONE;
_data = null; // clean a bit
self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || '');
}, 999);
self.state = Transporter.BUSY;
self.trigger("TransportingStarted");
_transport.call(self);
}
function _transport() {
var self = this,
chunk,
bytesLeft = _size - _pos;
if (_chunk_size > bytesLeft) {
_chunk_size = bytesLeft;
}
chunk = Encode.btoa(_data.substr(_pos, _chunk_size));
_runtime.exec.call(self, 'Transporter', 'receive', chunk, _size);
}
}
Transporter.IDLE = 0;
Transporter.BUSY = 1;
Transporter.DONE = 2;
Transporter.prototype = EventTarget.instance;
return Transporter;
});
// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/flash/xhr/XMLHttpRequest
@private
*/
define("moxie/runtime/flash/xhr/XMLHttpRequest", [
"moxie/runtime/flash/Runtime",
"moxie/core/utils/Basic",
"moxie/file/Blob",
"moxie/file/File",
"moxie/file/FileReaderSync",
"moxie/xhr/FormData",
"moxie/runtime/Transporter"
], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) {
var XMLHttpRequest = {
send: function(meta, data) {
var target = this, self = target.getRuntime();
function send() {
meta.transport = self.mode;
self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data);
}
function appendBlob(name, blob) {
self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid);
data = null;
send();
}
function attachBlob(blob, cb) {
var tr = new Transporter();
tr.bind("TransportingComplete", function() {
cb(this.result);
});
tr.transport(blob.getSource(), blob.type, {
ruid: self.uid
});
}
// copy over the headers if any
if (!Basic.isEmptyObj(meta.headers)) {
Basic.each(meta.headers, function(value, header) {
self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object
});
}
// transfer over multipart params and blob itself
if (data instanceof FormData) {
var blobField;
data.each(function(value, name) {
if (value instanceof Blob) {
blobField = name;
} else {
self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value);
}
});
if (!data.hasBlob()) {
data = null;
send();
} else {
var blob = data.getBlob();
if (blob.isDetached()) {
attachBlob(blob, function(attachedBlob) {
blob.destroy();
appendBlob(blobField, attachedBlob);
});
} else {
appendBlob(blobField, blob);
}
}
} else if (data instanceof Blob) {
if (data.isDetached()) {
attachBlob(data, function(attachedBlob) {
data.destroy();
data = attachedBlob.uid;
send();
});
} else {
data = data.uid;
send();
}
} else {
send();
}
},
getResponse: function(responseType) {
var frs, blob, self = this.getRuntime();
blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob');
if (blob) {
blob = new File(self.uid, blob);
if ('blob' === responseType) {
return blob;
}
try {
frs = new FileReaderSync();
if (!!~Basic.inArray(responseType, ["", "text"])) {
return frs.readAsText(blob);
} else if ('json' === responseType && !!window.JSON) {
return JSON.parse(frs.readAsText(blob));
}
} finally {
blob.destroy();
}
}
return null;
},
abort: function(upload_complete_flag) {
var self = this.getRuntime();
self.shimExec.call(this, 'XMLHttpRequest', 'abort');
this.dispatchEvent('readystatechange');
// this.dispatchEvent('progress');
this.dispatchEvent('abort');
//if (!upload_complete_flag) {
// this.dispatchEvent('uploadprogress');
//}
}
};
return (extensions.XMLHttpRequest = XMLHttpRequest);
});
// Included from: src/javascript/runtime/html4/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global File:true */
/**
Defines constructor for HTML4 runtime.
@class moxie/runtime/html4/Runtime
@private
*/
define("moxie/runtime/html4/Runtime", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/Runtime",
"moxie/core/utils/Env"
], function(Basic, x, Runtime, Env) {
var type = 'html4', extensions = {};
function Html4Runtime(options) {
var I = this
, Test = Runtime.capTest
, True = Runtime.capTrue
;
Runtime.call(this, options, type, {
access_binary: Test(window.FileReader || window.File && File.getAsDataURL),
access_image_binary: false,
display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))),
do_cors: false,
drag_and_drop: false,
filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest
return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10);
}()),
resize_image: function() {
return extensions.Image && I.can('access_binary') && Env.can('create_canvas');
},
report_upload_progress: false,
return_response_headers: false,
return_response_type: function(responseType) {
if (responseType === 'json' && !!window.JSON) {
return true;
}
return !!~Basic.inArray(responseType, ['text', 'document', '']);
},
return_status_code: function(code) {
return !Basic.arrayDiff(code, [200, 404]);
},
select_file: function() {
return Env.can('use_fileinput');
},
select_multiple: false,
send_binary_string: false,
send_custom_headers: false,
send_multipart: true,
slice_blob: false,
stream_upload: function() {
return I.can('select_file');
},
summon_file_dialog: Test(function() { // yeah... some dirty sniffing here...
return (Env.browser === 'Firefox' && Env.version >= 4) ||
(Env.browser === 'Opera' && Env.version >= 12) ||
!!~Basic.inArray(Env.browser, ['Chrome', 'Safari']);
}()),
upload_filesize: True,
use_http_method: function(methods) {
return !Basic.arrayDiff(methods, ['GET', 'POST']);
}
});
Basic.extend(this, {
init : function() {
this.trigger("Init");
},
destroy: (function(destroy) { // extend default destroy method
return function() {
destroy.call(I);
destroy = I = null;
};
}(this.destroy))
});
Basic.extend(this.getShim(), extensions);
}
Runtime.addConstructor(type, Html4Runtime);
return extensions;
});
// Included from: src/javascript/core/utils/Events.js
/**
* Events.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
define('moxie/core/utils/Events', [
'moxie/core/utils/Basic'
], function(Basic) {
var eventhash = {}, uid = 'moxie_' + Basic.guid();
// IE W3C like event funcs
function preventDefault() {
this.returnValue = false;
}
function stopPropagation() {
this.cancelBubble = true;
}
/**
Adds an event handler to the specified object and store reference to the handler
in objects internal Plupload registry (@see removeEvent).
@method addEvent
@for Utils
@static
@param {Object} obj DOM element like object to add handler to.
@param {String} name Name to add event listener to.
@param {Function} callback Function to call when event occurs.
@param {String} [key] that might be used to add specifity to the event record.
*/
var addEvent = function(obj, name, callback, key) {
var func, events;
name = name.toLowerCase();
// Add event listener
if (obj.addEventListener) {
func = callback;
obj.addEventListener(name, func, false);
} else if (obj.attachEvent) {
func = function() {
var evt = window.event;
if (!evt.target) {
evt.target = evt.srcElement;
}
evt.preventDefault = preventDefault;
evt.stopPropagation = stopPropagation;
callback(evt);
};
obj.attachEvent('on' + name, func);
}
// Log event handler to objects internal mOxie registry
if (!obj[uid]) {
obj[uid] = Basic.guid();
}
if (!eventhash.hasOwnProperty(obj[uid])) {
eventhash[obj[uid]] = {};
}
events = eventhash[obj[uid]];
if (!events.hasOwnProperty(name)) {
events[name] = [];
}
events[name].push({
func: func,
orig: callback, // store original callback for IE
key: key
});
};
/**
Remove event handler from the specified object. If third argument (callback)
is not specified remove all events with the specified name.
@method removeEvent
@static
@param {Object} obj DOM element to remove event listener(s) from.
@param {String} name Name of event listener to remove.
@param {Function|String} [callback] might be a callback or unique key to match.
*/
var removeEvent = function(obj, name, callback) {
var type, undef;
name = name.toLowerCase();
if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) {
type = eventhash[obj[uid]][name];
} else {
return;
}
for (var i = type.length - 1; i >= 0; i--) {
// undefined or not, key should match
if (type[i].orig === callback || type[i].key === callback) {
if (obj.removeEventListener) {
obj.removeEventListener(name, type[i].func, false);
} else if (obj.detachEvent) {
obj.detachEvent('on'+name, type[i].func);
}
type[i].orig = null;
type[i].func = null;
type.splice(i, 1);
// If callback was passed we are done here, otherwise proceed
if (callback !== undef) {
break;
}
}
}
// If event array got empty, remove it
if (!type.length) {
delete eventhash[obj[uid]][name];
}
// If mOxie registry has become empty, remove it
if (Basic.isEmptyObj(eventhash[obj[uid]])) {
delete eventhash[obj[uid]];
// IE doesn't let you remove DOM object property with - delete
try {
delete obj[uid];
} catch(e) {
obj[uid] = undef;
}
}
};
/**
Remove all kind of events from the specified object
@method removeAllEvents
@static
@param {Object} obj DOM element to remove event listeners from.
@param {String} [key] unique key to match, when removing events.
*/
var removeAllEvents = function(obj, key) {
if (!obj || !obj[uid]) {
return;
}
Basic.each(eventhash[obj[uid]], function(events, name) {
removeEvent(obj, name, key);
});
};
return {
addEvent: addEvent,
removeEvent: removeEvent,
removeAllEvents: removeAllEvents
};
});
// Included from: src/javascript/runtime/html4/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/html4/file/FileInput
@private
*/
define("moxie/runtime/html4/file/FileInput", [
"moxie/runtime/html4/Runtime",
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/utils/Events",
"moxie/core/utils/Mime",
"moxie/core/utils/Env"
], function(extensions, Basic, Dom, Events, Mime, Env) {
function FileInput() {
var _uid, _files = [], _mimes = [], _options;
function addInput() {
var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid;
uid = Basic.guid('uid_');
shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE
if (_uid) { // move previous form out of the view
currForm = Dom.get(_uid + '_form');
if (currForm) {
Basic.extend(currForm.style, { top: '100%' });
}
}
// build form in DOM, since innerHTML version not able to submit file for some reason
form = document.createElement('form');
form.setAttribute('id', uid + '_form');
form.setAttribute('method', 'post');
form.setAttribute('enctype', 'multipart/form-data');
form.setAttribute('encoding', 'multipart/form-data');
Basic.extend(form.style, {
overflow: 'hidden',
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%'
});
input = document.createElement('input');
input.setAttribute('id', uid);
input.setAttribute('type', 'file');
input.setAttribute('name', _options.name || 'Filedata');
input.setAttribute('accept', _mimes.join(','));
Basic.extend(input.style, {
fontSize: '999px',
opacity: 0
});
form.appendChild(input);
shimContainer.appendChild(form);
// prepare file input to be placed underneath the browse_button element
Basic.extend(input.style, {
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%'
});
if (Env.browser === 'IE' && Env.version < 10) {
Basic.extend(input.style, {
filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"
});
}
input.onchange = function() { // there should be only one handler for this
var file;
if (!this.value) {
return;
}
if (this.files) {
file = this.files[0];
} else {
file = {
name: this.value
};
}
_files = [file];
this.onchange = function() {}; // clear event handler
addInput.call(comp);
// after file is initialized as o.File, we need to update form and input ids
comp.bind('change', function onChange() {
var input = Dom.get(uid), form = Dom.get(uid + '_form'), file;
comp.unbind('change', onChange);
if (comp.files.length && input && form) {
file = comp.files[0];
input.setAttribute('id', file.uid);
form.setAttribute('id', file.uid + '_form');
// set upload target
form.setAttribute('target', file.uid + '_iframe');
}
input = form = null;
}, 998);
input = form = null;
comp.trigger('change');
};
// route click event to the input
if (I.can('summon_file_dialog')) {
browseButton = Dom.get(_options.browse_button);
Events.removeEvent(browseButton, 'click', comp.uid);
Events.addEvent(browseButton, 'click', function(e) {
if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file]
input.click();
}
e.preventDefault();
}, comp.uid);
}
_uid = uid;
shimContainer = currForm = browseButton = null;
}
Basic.extend(this, {
init: function(options) {
var comp = this, I = comp.getRuntime(), shimContainer;
// figure out accept string
_options = options;
_mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension'));
shimContainer = I.getShimContainer();
(function() {
var browseButton, zIndex, top;
browseButton = Dom.get(options.browse_button);
// Route click event to the input[type=file] element for browsers that support such behavior
if (I.can('summon_file_dialog')) {
if (Dom.getStyle(browseButton, 'position') === 'static') {
browseButton.style.position = 'relative';
}
zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1;
browseButton.style.zIndex = zIndex;
shimContainer.style.zIndex = zIndex - 1;
}
/* Since we have to place input[type=file] on top of the browse_button for some browsers,
browse_button loses interactivity, so we restore it here */
top = I.can('summon_file_dialog') ? browseButton : shimContainer;
Events.addEvent(top, 'mouseover', function() {
comp.trigger('mouseenter');
}, comp.uid);
Events.addEvent(top, 'mouseout', function() {
comp.trigger('mouseleave');
}, comp.uid);
Events.addEvent(top, 'mousedown', function() {
comp.trigger('mousedown');
}, comp.uid);
Events.addEvent(Dom.get(options.container), 'mouseup', function() {
comp.trigger('mouseup');
}, comp.uid);
browseButton = null;
}());
addInput.call(this);
shimContainer = null;
// trigger ready event asynchronously
comp.trigger({
type: 'ready',
async: true
});
},
getFiles: function() {
return _files;
},
disable: function(state) {
var input;
if ((input = Dom.get(_uid))) {
input.disabled = !!state;
}
},
destroy: function() {
var I = this.getRuntime()
, shim = I.getShim()
, shimContainer = I.getShimContainer()
;
Events.removeAllEvents(shimContainer, this.uid);
Events.removeAllEvents(_options && Dom.get(_options.container), this.uid);
Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid);
if (shimContainer) {
shimContainer.innerHTML = '';
}
shim.removeInstance(this.uid);
_uid = _files = _mimes = _options = shimContainer = shim = null;
}
});
}
return (extensions.FileInput = FileInput);
});
// Included from: src/javascript/runtime/html5/Runtime.js
/**
* Runtime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global File:true */
/**
Defines constructor for HTML5 runtime.
@class moxie/runtime/html5/Runtime
@private
*/
define("moxie/runtime/html5/Runtime", [
"moxie/core/utils/Basic",
"moxie/core/Exceptions",
"moxie/runtime/Runtime",
"moxie/core/utils/Env"
], function(Basic, x, Runtime, Env) {
var type = "html5", extensions = {};
function Html5Runtime(options) {
var I = this
, Test = Runtime.capTest
, True = Runtime.capTrue
;
var caps = Basic.extend({
access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL),
access_image_binary: function() {
return I.can('access_binary') && !!extensions.Image;
},
display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')),
do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()),
drag_and_drop: Test(function() {
// this comes directly from Modernizr: http://www.modernizr.com/
var div = document.createElement('div');
// IE has support for drag and drop since version 5, but doesn't support dropping files from desktop
return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (Env.browser !== 'IE' || Env.version > 9);
}()),
filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest
return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10);
}()),
return_response_headers: True,
return_response_type: function(responseType) {
if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported
return true;
}
return Env.can('return_response_type', responseType);
},
return_status_code: True,
report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload),
resize_image: function() {
return I.can('access_binary') && Env.can('create_canvas');
},
select_file: function() {
return Env.can('use_fileinput') && window.File;
},
select_folder: function() {
return I.can('select_file') && Env.browser === 'Chrome' && Env.version >= 21;
},
select_multiple: function() {
// it is buggy on Safari Windows and iOS
return I.can('select_file') &&
!(Env.browser === 'Safari' && Env.os === 'Windows') &&
!(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.4", '<'));
},
send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))),
send_custom_headers: Test(window.XMLHttpRequest),
send_multipart: function() {
return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string');
},
slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)),
stream_upload: function(){
return I.can('slice_blob') && I.can('send_multipart');
},
summon_file_dialog: Test(function() { // yeah... some dirty sniffing here...
return (Env.browser === 'Firefox' && Env.version >= 4) ||
(Env.browser === 'Opera' && Env.version >= 12) ||
(Env.browser === 'IE' && Env.version >= 10) ||
!!~Basic.inArray(Env.browser, ['Chrome', 'Safari']);
}()),
upload_filesize: True
},
arguments[2]
);
Runtime.call(this, options, (arguments[1] || type), caps);
Basic.extend(this, {
init : function() {
this.trigger("Init");
},
destroy: (function(destroy) { // extend default destroy method
return function() {
destroy.call(I);
destroy = I = null;
};
}(this.destroy))
});
Basic.extend(this.getShim(), extensions);
}
Runtime.addConstructor(type, Html5Runtime);
return extensions;
});
// Included from: src/javascript/runtime/html5/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/html5/file/FileReader
@private
*/
define("moxie/runtime/html5/file/FileReader", [
"moxie/runtime/html5/Runtime",
"moxie/core/utils/Encode",
"moxie/core/utils/Basic"
], function(extensions, Encode, Basic) {
function FileReader() {
var _fr, _convertToBinary = false;
Basic.extend(this, {
read: function(op, blob) {
var target = this;
_fr = new window.FileReader();
_fr.addEventListener('progress', function(e) {
target.trigger(e);
});
_fr.addEventListener('load', function(e) {
target.trigger(e);
});
_fr.addEventListener('error', function(e) {
target.trigger(e, _fr.error);
});
_fr.addEventListener('loadend', function() {
_fr = null;
});
if (Basic.typeOf(_fr[op]) === 'function') {
_convertToBinary = false;
_fr[op](blob.getSource());
} else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+
_convertToBinary = true;
_fr.readAsDataURL(blob.getSource());
}
},
getResult: function() {
return _fr && _fr.result ? (_convertToBinary ? _toBinary(_fr.result) : _fr.result) : null;
},
abort: function() {
if (_fr) {
_fr.abort();
}
},
destroy: function() {
_fr = null;
}
});
function _toBinary(str) {
return Encode.atob(str.substring(str.indexOf('base64,') + 7));
}
}
return (extensions.FileReader = FileReader);
});
// Included from: src/javascript/runtime/html4/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/html4/file/FileReader
@private
*/
define("moxie/runtime/html4/file/FileReader", [
"moxie/runtime/html4/Runtime",
"moxie/runtime/html5/file/FileReader"
], function(extensions, FileReader) {
return (extensions.FileReader = FileReader);
});
// Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/html4/xhr/XMLHttpRequest
@private
*/
define("moxie/runtime/html4/xhr/XMLHttpRequest", [
"moxie/runtime/html4/Runtime",
"moxie/core/utils/Basic",
"moxie/core/utils/Dom",
"moxie/core/utils/Url",
"moxie/core/Exceptions",
"moxie/core/utils/Events",
"moxie/file/Blob",
"moxie/xhr/FormData"
], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) {
function XMLHttpRequest() {
var _status, _response, _iframe;
function cleanup(cb) {
var target = this, uid, form, inputs, i, hasFile = false;
if (!_iframe) {
return;
}
uid = _iframe.id.replace(/_iframe$/, '');
form = Dom.get(uid + '_form');
if (form) {
inputs = form.getElementsByTagName('input');
i = inputs.length;
while (i--) {
switch (inputs[i].getAttribute('type')) {
case 'hidden':
inputs[i].parentNode.removeChild(inputs[i]);
break;
case 'file':
hasFile = true; // flag the case for later
break;
}
}
inputs = [];
if (!hasFile) { // we need to keep the form for sake of possible retries
form.parentNode.removeChild(form);
}
form = null;
}
// without timeout, request is marked as canceled (in console)
setTimeout(function() {
Events.removeEvent(_iframe, 'load', target.uid);
if (_iframe.parentNode) { // #382
_iframe.parentNode.removeChild(_iframe);
}
// check if shim container has any other children, if - not, remove it as well
var shimContainer = target.getRuntime().getShimContainer();
if (!shimContainer.children.length) {
shimContainer.parentNode.removeChild(shimContainer);
}
shimContainer = _iframe = null;
cb();
}, 1);
}
Basic.extend(this, {
send: function(meta, data) {
var target = this, I = target.getRuntime(), uid, form, input, blob;
_status = _response = null;
function createIframe() {
var container = I.getShimContainer() || document.body
, temp = document.createElement('div')
;
// IE 6 won't be able to set the name using setAttribute or iframe.name
temp.innerHTML = '<iframe id="' + uid + '_iframe" name="' + uid + '_iframe" src="javascript:""" style="display:none"></iframe>';
_iframe = temp.firstChild;
container.appendChild(_iframe);
/* _iframe.onreadystatechange = function() {
console.info(_iframe.readyState);
};*/
Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8
var el;
try {
el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document;
// try to detect some standard error pages
if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error
_status = el.title.replace(/^(\d+).*$/, '$1');
} else {
_status = 200;
// get result
_response = Basic.trim(el.body.innerHTML);
// we need to fire these at least once
target.trigger({
type: 'progress',
loaded: _response.length,
total: _response.length
});
if (blob) { // if we were uploading a file
target.trigger({
type: 'uploadprogress',
loaded: blob.size || 1025,
total: blob.size || 1025
});
}
}
} catch (ex) {
if (Url.hasSameOrigin(meta.url)) {
// if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm
// which obviously results to cross domain error (wtf?)
_status = 404;
} else {
cleanup.call(target, function() {
target.trigger('error');
});
return;
}
}
cleanup.call(target, function() {
target.trigger('load');
});
}, target.uid);
} // end createIframe
// prepare data to be sent and convert if required
if (data instanceof FormData && data.hasBlob()) {
blob = data.getBlob();
uid = blob.uid;
input = Dom.get(uid);
form = Dom.get(uid + '_form');
if (!form) {
throw new x.DOMException(x.DOMException.NOT_FOUND_ERR);
}
} else {
uid = Basic.guid('uid_');
form = document.createElement('form');
form.setAttribute('id', uid + '_form');
form.setAttribute('method', meta.method);
form.setAttribute('enctype', 'multipart/form-data');
form.setAttribute('encoding', 'multipart/form-data');
form.setAttribute('target', uid + '_iframe');
I.getShimContainer().appendChild(form);
}
if (data instanceof FormData) {
data.each(function(value, name) {
if (value instanceof Blob) {
if (input) {
input.setAttribute('name', name);
}
} else {
var hidden = document.createElement('input');
Basic.extend(hidden, {
type : 'hidden',
name : name,
value : value
});
// make sure that input[type="file"], if it's there, comes last
if (input) {
form.insertBefore(hidden, input);
} else {
form.appendChild(hidden);
}
}
});
}
// set destination url
form.setAttribute("action", meta.url);
createIframe();
form.submit();
target.trigger('loadstart');
},
getStatus: function() {
return _status;
},
getResponse: function(responseType) {
if ('json' === responseType) {
// strip off <pre>..</pre> tags that might be enclosing the response
if (Basic.typeOf(_response) === 'string' && !!window.JSON) {
try {
return JSON.parse(_response.replace(/^\s*<pre[^>]*>/, '').replace(/<\/pre>\s*$/, ''));
} catch (ex) {
return null;
}
}
} else if ('document' === responseType) {
}
return _response;
},
abort: function() {
var target = this;
if (_iframe && _iframe.contentWindow) {
if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome
_iframe.contentWindow.stop();
} else if (_iframe.contentWindow.document.execCommand) { // IE
_iframe.contentWindow.document.execCommand('Stop');
} else {
_iframe.src = "about:blank";
}
}
cleanup.call(this, function() {
// target.dispatchEvent('readystatechange');
target.dispatchEvent('abort');
});
}
});
}
return (extensions.XMLHttpRequest = XMLHttpRequest);
});
// Included from: src/javascript/runtime/silverlight/Runtime.js
/**
* RunTime.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global ActiveXObject:true */
/**
Defines constructor for Silverlight runtime.
@class moxie/runtime/silverlight/Runtime
@private
*/
define("moxie/runtime/silverlight/Runtime", [
"moxie/core/utils/Basic",
"moxie/core/utils/Env",
"moxie/core/utils/Dom",
"moxie/core/Exceptions",
"moxie/runtime/Runtime"
], function(Basic, Env, Dom, x, Runtime) {
var type = "silverlight", extensions = {};
function isInstalled(version) {
var isVersionSupported = false, control = null, actualVer,
actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0;
try {
try {
control = new ActiveXObject('AgControl.AgControl');
if (control.IsVersionSupported(version)) {
isVersionSupported = true;
}
control = null;
} catch (e) {
var plugin = navigator.plugins["Silverlight Plug-In"];
if (plugin) {
actualVer = plugin.description;
if (actualVer === "1.0.30226.2") {
actualVer = "2.0.30226.2";
}
actualVerArray = actualVer.split(".");
while (actualVerArray.length > 3) {
actualVerArray.pop();
}
while ( actualVerArray.length < 4) {
actualVerArray.push(0);
}
reqVerArray = version.split(".");
while (reqVerArray.length > 4) {
reqVerArray.pop();
}
do {
requiredVersionPart = parseInt(reqVerArray[index], 10);
actualVersionPart = parseInt(actualVerArray[index], 10);
index++;
} while (index < reqVerArray.length && requiredVersionPart === actualVersionPart);
if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) {
isVersionSupported = true;
}
}
}
} catch (e2) {
isVersionSupported = false;
}
return isVersionSupported;
}
/**
Constructor for the Silverlight Runtime
@class SilverlightRuntime
@extends Runtime
*/
function SilverlightRuntime(options) {
var I = this, initTimer;
options = Basic.extend({ xap_url: Env.xap_url }, options);
Runtime.call(this, options, type, {
access_binary: Runtime.capTrue,
access_image_binary: Runtime.capTrue,
display_media: Runtime.capTrue,
do_cors: Runtime.capTrue,
drag_and_drop: false,
report_upload_progress: Runtime.capTrue,
resize_image: Runtime.capTrue,
return_response_headers: function(value) {
return value && I.mode === 'client';
},
return_response_type: function(responseType) {
if (responseType !== 'json') {
return true;
} else {
return !!window.JSON;
}
},
return_status_code: function(code) {
return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]);
},
select_file: Runtime.capTrue,
select_multiple: Runtime.capTrue,
send_binary_string: Runtime.capTrue,
send_browser_cookies: function(value) {
return value && I.mode === 'browser';
},
send_custom_headers: function(value) {
return value && I.mode === 'client';
},
send_multipart: Runtime.capTrue,
slice_blob: Runtime.capTrue,
stream_upload: true,
summon_file_dialog: false,
upload_filesize: Runtime.capTrue,
use_http_method: function(methods) {
return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']);
}
}, {
// capabilities that require specific mode
return_response_headers: function(value) {
return value ? 'client' : 'browser';
},
return_status_code: function(code) {
return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser'];
},
send_browser_cookies: function(value) {
return value ? 'browser' : 'client';
},
send_custom_headers: function(value) {
return value ? 'client' : 'browser';
},
use_http_method: function(methods) {
return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser'];
}
});
// minimal requirement
if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') {
this.mode = false;
}
Basic.extend(this, {
getShim: function() {
return Dom.get(this.uid).content.Moxie;
},
shimExec: function(component, action) {
var args = [].slice.call(arguments, 2);
return I.getShim().exec(this.uid, component, action, args);
},
init : function() {
var container;
container = this.getShimContainer();
container.innerHTML = '<object id="' + this.uid + '" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">' +
'<param name="source" value="' + options.xap_url + '"/>' +
'<param name="background" value="Transparent"/>' +
'<param name="windowless" value="true"/>' +
'<param name="enablehtmlaccess" value="true"/>' +
'<param name="initParams" value="uid=' + this.uid + ',target=' + Env.global_event_dispatcher + '"/>' +
'</object>';
// Init is dispatched by the shim
initTimer = setTimeout(function() {
if (I && !I.initialized) { // runtime might be already destroyed by this moment
I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR));
}
}, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac)
},
destroy: (function(destroy) { // extend default destroy method
return function() {
destroy.call(I);
clearTimeout(initTimer); // initialization check might be still onwait
options = initTimer = destroy = I = null;
};
}(this.destroy))
}, extensions);
}
Runtime.addConstructor(type, SilverlightRuntime);
return extensions;
});
// Included from: src/javascript/runtime/silverlight/file/Blob.js
/**
* Blob.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/silverlight/file/Blob
@private
*/
define("moxie/runtime/silverlight/file/Blob", [
"moxie/runtime/silverlight/Runtime",
"moxie/core/utils/Basic",
"moxie/runtime/flash/file/Blob"
], function(extensions, Basic, Blob) {
return (extensions.Blob = Basic.extend({}, Blob));
});
// Included from: src/javascript/runtime/silverlight/file/FileInput.js
/**
* FileInput.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/silverlight/file/FileInput
@private
*/
define("moxie/runtime/silverlight/file/FileInput", [
"moxie/runtime/silverlight/Runtime"
], function(extensions) {
var FileInput = {
init: function(options) {
function toFilters(accept) {
var filter = '';
for (var i = 0; i < accept.length; i++) {
filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.');
}
return filter;
}
this.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple);
this.trigger('ready');
}
};
return (extensions.FileInput = FileInput);
});
// Included from: src/javascript/runtime/silverlight/file/FileReader.js
/**
* FileReader.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/silverlight/file/FileReader
@private
*/
define("moxie/runtime/silverlight/file/FileReader", [
"moxie/runtime/silverlight/Runtime",
"moxie/core/utils/Basic",
"moxie/runtime/flash/file/FileReader"
], function(extensions, Basic, FileReader) {
return (extensions.FileReader = Basic.extend({}, FileReader));
});
// Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js
/**
* FileReaderSync.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/silverlight/file/FileReaderSync
@private
*/
define("moxie/runtime/silverlight/file/FileReaderSync", [
"moxie/runtime/silverlight/Runtime",
"moxie/core/utils/Basic",
"moxie/runtime/flash/file/FileReaderSync"
], function(extensions, Basic, FileReaderSync) {
return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync));
});
// Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js
/**
* XMLHttpRequest.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/**
@class moxie/runtime/silverlight/xhr/XMLHttpRequest
@private
*/
define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [
"moxie/runtime/silverlight/Runtime",
"moxie/core/utils/Basic",
"moxie/runtime/flash/xhr/XMLHttpRequest"
], function(extensions, Basic, XMLHttpRequest) {
return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest));
});
expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/core/utils/Events"]);
})(this);/**
* o.js
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*/
/*global moxie:true */
/**
Globally exposed namespace with the most frequently used public classes and handy methods.
@class o
@static
@private
*/
(function(exports) {
"use strict";
var o = {}, inArray = exports.moxie.core.utils.Basic.inArray;
// directly add some public classes
// (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included)
(function addAlias(ns) {
var name, itemType;
for (name in ns) {
itemType = typeof(ns[name]);
if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) {
addAlias(ns[name]);
} else if (itemType === 'function') {
o[name] = ns[name];
}
}
})(exports.moxie);
// add some manually
o.Env = exports.moxie.core.utils.Env;
o.Mime = exports.moxie.core.utils.Mime;
o.Exceptions = exports.moxie.core.Exceptions;
// expose globally
exports.mOxie = o;
if (!exports.o) {
exports.o = o;
}
return o;
})(this);
;webshim.register('filereader', function($, webshim, window, document, undefined, featureOptions){
"use strict";
var mOxie, moxie, hasXDomain;
var FormData = $.noop;
var sel = 'input[type="file"].ws-filereader';
var loadMoxie = function (){
webshim.loader.loadList(['moxie']);
};
var _createFilePicker = function(){
var $input, picker, $parent, onReset;
var input = this;
if(webshim.implement(input, 'filepicker')){
input = this;
$input = $(this);
$parent = $input.parent();
onReset = function(){
if(!input.value){
$input.prop('value', '');
}
};
$input.attr('tabindex', '-1').on('mousedown.filereaderwaiting click.filereaderwaiting', false);
$parent.addClass('ws-loading');
picker = new mOxie.FileInput({
browse_button: this,
accept: $.prop(this, 'accept'),
multiple: $.prop(this, 'multiple')
});
$input.jProp('form').on('reset', function(){
setTimeout(onReset);
});
picker.onready = function(){
$input.off('.fileraderwaiting');
$parent.removeClass('ws-waiting');
};
picker.onchange = function(e){
webshim.data(input, 'fileList', e.target.files);
$input.trigger('change');
};
picker.onmouseenter = function(){
$input.trigger('mouseover');
$parent.addClass('ws-mouseenter');
};
picker.onmouseleave = function(){
$input.trigger('mouseout');
$parent.removeClass('ws-mouseenter');
};
picker.onmousedown = function(){
$input.trigger('mousedown');
$parent.addClass('ws-active');
};
picker.onmouseup = function(){
$input.trigger('mouseup');
$parent.removeClass('ws-active');
};
webshim.data(input, 'filePicker', picker);
webshim.ready('WINDOWLOAD', function(){
var lastWidth;
$input.onWSOff('updateshadowdom', function(){
var curWitdth = input.offsetWidth;
if(curWitdth && lastWidth != curWitdth){
lastWidth = curWitdth;
picker.refresh();
}
});
});
webshim.addShadowDom();
picker.init();
if(input.disabled){
picker.disable(true);
}
}
};
var getFileNames = function(file){
return file.name;
};
var createFilePicker = function(){
var elem = this;
loadMoxie();
$(elem)
.on('mousedown.filereaderwaiting click.filereaderwaiting', false)
.parent()
.addClass('ws-loading')
;
webshim.ready('moxie', function(){
createFilePicker.call(elem);
});
};
var noxhr = /^(?:script|jsonp)$/i;
var notReadyYet = function(){
loadMoxie();
webshim.error('filereader/formdata not ready yet. please wait for moxie to load `webshim.ready("moxie", callbackFn);`` or wait for the first change event on input[type="file"].ws-filereader.')
};
var inputValueDesc = webshim.defineNodeNameProperty('input', 'value', {
prop: {
get: function(){
var fileList = webshim.data(this, 'fileList');
if(fileList && fileList.map){
return fileList.map(getFileNames).join(', ');
}
return inputValueDesc.prop._supget.call(this);
}
}
}
);
var shimMoxiePath = webshim.cfg.basePath+'moxie/';
var crossXMLMessage = 'You nedd a crossdomain.xml to get all "filereader" / "XHR2" / "CORS" features to work. Or host moxie.swf/moxie.xap on your server an configure filereader options: "swfpath"/"xappath"';
var testMoxie = function(options){
return (options.wsType == 'moxie' || (options.data && options.data instanceof mOxie.FormData) || (options.crossDomain && $.support.cors !== false && hasXDomain != 'no' && !noxhr.test(options.dataType || '')));
};
var createMoxieTransport = function (options){
if(testMoxie(options)){
var ajax;
webshim.info('moxie transfer used for $.ajax');
if(hasXDomain == 'no'){
webshim.error(crossXMLMessage);
}
return {
send: function( headers, completeCallback ) {
var proressEvent = function(obj, name){
if(options[name]){
var called = false;
ajax.addEventListener('load', function(e){
if(!called){
options[name]({type: 'progress', lengthComputable: true, total: 1, loaded: 1});
} else if(called.lengthComputable && called.total > called.loaded){
options[name]({type: 'progress', lengthComputable: true, total: called.total, loaded: called.total});
}
});
obj.addEventListener('progress', function(e){
called = e;
options[name](e);
});
}
};
ajax = new moxie.xhr.XMLHttpRequest();
ajax.open(options.type, options.url, options.async, options.username, options.password);
proressEvent(ajax.upload, featureOptions.uploadprogress);
proressEvent(ajax.upload, featureOptions.progress);
ajax.addEventListener('load', function(e){
var responses = {
text: ajax.responseText,
xml: ajax.responseXML
};
completeCallback(ajax.status, ajax.statusText, responses, ajax.getAllResponseHeaders());
});
if(options.xhrFields && options.xhrFields.withCredentials){
ajax.withCredentials = true;
}
if(options.timeout){
ajax.timeout = options.timeout;
}
$.each(headers, function(name, value){
ajax.setRequestHeader(name, value);
});
ajax.send(options.data);
},
abort: function() {
if(ajax){
ajax.abort();
}
}
};
}
};
var transports = {
//based on script: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest
xdomain: (function(){
var httpRegEx = /^https?:\/\//i;
var getOrPostRegEx = /^get|post$/i;
var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i');
return function(options, userOptions, jqXHR) {
// Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page
if (!options.crossDomain || options.username || (options.xhrFields && options.xhrFields.withCredentials) || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url) || (options.data && options.data instanceof mOxie.FormData) || noxhr.test(options.dataType || '')) {
return;
}
var xdr = null;
webshim.info('xdomain transport used.');
return {
send: function(headers, complete) {
var postData = '';
var userType = (userOptions.dataType || '').toLowerCase();
xdr = new XDomainRequest();
if (/^\d+$/.test(userOptions.timeout)) {
xdr.timeout = userOptions.timeout;
}
xdr.ontimeout = function() {
complete(500, 'timeout');
};
xdr.onload = function() {
var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\r\nContent-Type: ' + xdr.contentType;
var status = {
code: xdr.status || 200,
message: xdr.statusText || 'OK'
};
var responses = {
text: xdr.responseText,
xml: xdr.responseXML
};
try {
if (userType === 'html' || /text\/html/i.test(xdr.contentType)) {
responses.html = xdr.responseText;
} else if (userType === 'json' || (userType !== 'text' && /\/json/i.test(xdr.contentType))) {
try {
responses.json = $.parseJSON(xdr.responseText);
} catch(e) {
}
} else if (userType === 'xml' && !xdr.responseXML) {
var doc;
try {
doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = false;
doc.loadXML(xdr.responseText);
} catch(e) {
}
responses.xml = doc;
}
} catch(parseMessage) {}
complete(status.code, status.message, responses, allResponseHeaders);
};
// set an empty handler for 'onprogress' so requests don't get aborted
xdr.onprogress = function(){};
xdr.onerror = function() {
complete(500, 'error', {
text: xdr.responseText
});
};
if (userOptions.data) {
postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data);
}
xdr.open(options.type, options.url);
xdr.send(postData);
},
abort: function() {
if (xdr) {
xdr.abort();
}
}
};
};
})(),
moxie: function (options, originalOptions, jqXHR){
if(testMoxie(options)){
loadMoxie(options);
var ajax;
var tmpTransport = {
send: function( headers, completeCallback ) {
ajax = true;
webshim.ready('moxie', function(){
if(ajax){
ajax = createMoxieTransport(options, originalOptions, jqXHR);
tmpTransport.send = ajax.send;
tmpTransport.abort = ajax.abort;
ajax.send(headers, completeCallback);
}
});
},
abort: function() {
ajax = false;
}
};
return tmpTransport;
}
}
};
if(!featureOptions.progress){
featureOptions.progress = 'onprogress';
}
if(!featureOptions.uploadprogress){
featureOptions.uploadprogress = 'onuploadprogress';
}
if(!featureOptions.swfpath){
featureOptions.swfpath = shimMoxiePath+'flash/Moxie.min.swf';
}
if(!featureOptions.xappath){
featureOptions.xappath = shimMoxiePath+'silverlight/Moxie.min.xap';
}
if($.support.cors !== false || !window.XDomainRequest){
delete transports.xdomain;
}
$.ajaxTransport("+*", function( options, originalOptions, jqXHR ) {
var ajax, type;
if(options.wsType || transports[transports]){
ajax = transports[transports](options, originalOptions, jqXHR);
}
if(!ajax){
for(type in transports){
ajax = transports[type](options, originalOptions, jqXHR);
if(ajax){break;}
}
}
return ajax;
});
webshim.defineNodeNameProperty('input', 'files', {
prop: {
writeable: false,
get: function(){
if(this.type != 'file'){return null;}
if(!$(this).hasClass('ws-filereader')){
webshim.info("please add the 'ws-filereader' class to your input[type='file'] to implement files-property");
}
return webshim.data(this, 'fileList') || [];
}
}
}
);
webshim.reflectProperties(['input'], ['accept']);
if($('<input />').prop('multiple') == null){
webshim.defineNodeNamesBooleanProperty(['input'], ['multiple']);
}
webshim.onNodeNamesPropertyModify('input', 'disabled', function(value, boolVal, type){
var picker = webshim.data(this, 'filePicker');
if(picker){
picker.disable(boolVal);
}
});
webshim.onNodeNamesPropertyModify('input', 'value', function(value, boolVal, type){
if(value === '' && this.type == 'file' && $(this).hasClass('ws-filereader')){
webshim.data(this, 'fileList', []);
}
});
window.FileReader = notReadyYet;
window.FormData = notReadyYet;
webshim.ready('moxie', function(){
var wsMimes = 'application/xml,xml';
moxie = window.moxie;
mOxie = window.mOxie;
mOxie.Env.swf_url = featureOptions.swfpath;
mOxie.Env.xap_url = featureOptions.xappath;
window.FileReader = mOxie.FileReader;
window.FormData = function(form){
var appendData, i, len, files, fileI, fileLen, inputName;
var moxieData = new mOxie.FormData();
if(form && $.nodeName(form, 'form')){
appendData = $(form).serializeArray();
for(i = 0; i < appendData.length; i++){
if(Array.isArray(appendData[i].value)){
appendData[i].value.forEach(function(val){
moxieData.append(appendData[i].name, val);
});
} else {
moxieData.append(appendData[i].name, appendData[i].value);
}
}
appendData = form.querySelectorAll('input[type="file"][name]');
for(i = 0, len = appendData.length; i < appendData.length; i++){
inputName = appendData[i].name;
if(inputName && !$(appendData[i]).is(':disabled')){
files = $.prop(appendData[i], 'files') || [];
if(files.length){
if(files.length > 1 || (moxieData.hasBlob && moxieData.hasBlob())){
webshim.error('FormData shim can only handle one file per ajax. Use multiple ajax request. One per file.');
}
for(fileI = 0, fileLen = files.length; fileI < fileLen; fileI++){
moxieData.append(inputName, files[fileI]);
}
}
}
}
}
return moxieData;
};
FormData = window.FormData;
createFilePicker = _createFilePicker;
transports.moxie = createMoxieTransport;
featureOptions.mimeTypes = (featureOptions.mimeTypes) ? wsMimes+','+featureOptions.mimeTypes : wsMimes;
try {
mOxie.Mime.addMimeType(featureOptions.mimeTypes);
} catch(e){
webshim.warn('mimetype to moxie error: '+e);
}
});
webshim.addReady(function(context, contextElem){
$(context.querySelectorAll(sel)).add(contextElem.filter(sel)).each(createFilePicker);
});
webshim.ready('WINDOWLOAD', loadMoxie);
if(webshim.cfg.debug !== false && featureOptions.swfpath.indexOf((location.protocol+'//'+location.hostname)) && featureOptions.swfpath.indexOf(('https://'+location.hostname))){
webshim.ready('WINDOWLOAD', function(){
var printMessage = function(){
if(hasXDomain == 'no'){
webshim.error(crossXMLMessage);
}
};
try {
hasXDomain = sessionStorage.getItem('wsXdomain.xml');
} catch(e){}
printMessage();
if(hasXDomain == null){
$.ajax({
url: 'crossdomain.xml',
type: 'HEAD',
dataType: 'xml',
success: function(){
hasXDomain = 'yes';
},
error: function(){
hasXDomain = 'no';
},
complete: function(){
try {
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
} catch(e){}
printMessage();
}
});
}
});
}
});
|
app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js | Kirishima21/mastodon | import React from 'react';
import { connect } from 'react-redux';
import { injectIntl } from 'react-intl';
import {
fetchPinnedAccountsSuggestions,
clearPinnedAccountsSuggestions,
changePinnedAccountsSuggestions
} from '../../../actions/accounts';
import Search from 'flavours/glitch/features/list_editor/components/search';
const mapStateToProps = state => ({
value: state.getIn(['pinnedAccountsEditor', 'suggestions', 'value']),
});
const mapDispatchToProps = dispatch => ({
onSubmit: value => dispatch(fetchPinnedAccountsSuggestions(value)),
onClear: () => dispatch(clearPinnedAccountsSuggestions()),
onChange: value => dispatch(changePinnedAccountsSuggestions(value)),
});
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Search));
|
docs/src/pages/components/drawers/PermanentDrawerLeft.js | kybarg/material-ui | import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import CssBaseline from '@material-ui/core/CssBaseline';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import List from '@material-ui/core/List';
import Typography from '@material-ui/core/Typography';
import Divider from '@material-ui/core/Divider';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import InboxIcon from '@material-ui/icons/MoveToInbox';
import MailIcon from '@material-ui/icons/Mail';
const drawerWidth = 240;
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
},
appBar: {
width: `calc(100% - ${drawerWidth}px)`,
marginLeft: drawerWidth,
},
drawer: {
width: drawerWidth,
flexShrink: 0,
},
drawerPaper: {
width: drawerWidth,
},
toolbar: theme.mixins.toolbar,
content: {
flexGrow: 1,
backgroundColor: theme.palette.background.default,
padding: theme.spacing(3),
},
}));
export default function PermanentDrawerLeft() {
const classes = useStyles();
return (
<div className={classes.root}>
<CssBaseline />
<AppBar position="fixed" className={classes.appBar}>
<Toolbar>
<Typography variant="h6" noWrap>
Permanent drawer
</Typography>
</Toolbar>
</AppBar>
<Drawer
className={classes.drawer}
variant="permanent"
classes={{
paper: classes.drawerPaper,
}}
anchor="left"
>
<div className={classes.toolbar} />
<Divider />
<List>
{['Inbox', 'Starred', 'Send email', 'Drafts'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
</List>
<Divider />
<List>
{['All mail', 'Trash', 'Spam'].map((text, index) => (
<ListItem button key={text}>
<ListItemIcon>{index % 2 === 0 ? <InboxIcon /> : <MailIcon />}</ListItemIcon>
<ListItemText primary={text} />
</ListItem>
))}
</List>
</Drawer>
<main className={classes.content}>
<div className={classes.toolbar} />
<Typography paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Rhoncus dolor purus non enim praesent elementum
facilisis leo vel. Risus at ultrices mi tempus imperdiet. Semper risus in hendrerit
gravida rutrum quisque non tellus. Convallis convallis tellus id interdum velit laoreet id
donec ultrices. Odio morbi quis commodo odio aenean sed adipiscing. Amet nisl suscipit
adipiscing bibendum est ultricies integer quis. Cursus euismod quis viverra nibh cras.
Metus vulputate eu scelerisque felis imperdiet proin fermentum leo. Mauris commodo quis
imperdiet massa tincidunt. Cras tincidunt lobortis feugiat vivamus at augue. At augue eget
arcu dictum varius duis at consectetur lorem. Velit sed ullamcorper morbi tincidunt. Lorem
donec massa sapien faucibus et molestie ac.
</Typography>
<Typography paragraph>
Consequat mauris nunc congue nisi vitae suscipit. Fringilla est ullamcorper eget nulla
facilisi etiam dignissim diam. Pulvinar elementum integer enim neque volutpat ac
tincidunt. Ornare suspendisse sed nisi lacus sed viverra tellus. Purus sit amet volutpat
consequat mauris. Elementum eu facilisis sed odio morbi. Euismod lacinia at quis risus sed
vulputate odio. Morbi tincidunt ornare massa eget egestas purus viverra accumsan in. In
hendrerit gravida rutrum quisque non tellus orci ac. Pellentesque nec nam aliquam sem et
tortor. Habitant morbi tristique senectus et. Adipiscing elit duis tristique sollicitudin
nibh sit. Ornare aenean euismod elementum nisi quis eleifend. Commodo viverra maecenas
accumsan lacus vel facilisis. Nulla posuere sollicitudin aliquam ultrices sagittis orci a.
</Typography>
</main>
</div>
);
}
|
src/index.js | sonaak/react-components | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import './index.css';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
|
ajax/libs/babel-core/4.7.0/browser.min.js | AMoo-Miki/cdnjs | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.babel=e()}}(function(){var e,n,l;return function t(e,n,l){function r(u,o){if(!n[u]){if(!e[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);var i=new Error("Cannot find module '"+u+"'");throw i.code="MODULE_NOT_FOUND",i}var c=n[u]={exports:{}};e[u][0].call(c.exports,function(n){var l=e[u][1][n];return r(l?l:n)},c,c.exports,t,e,n,l)}return n[u].exports}for(var a="function"==typeof require&&require,u=0;u<l.length;u++)r(l[u]);return r}({1:[function(e,n){(function(l){"use strict";var t=n.exports=e("../transformation");t.version=e("../../../package").version,t.transform=t,t.run=function(e){var n=void 0===arguments[1]?{}:arguments[1];return n.sourceMap="inline",new Function(t(e,n).code)()},t.load=function(e,n,r,a){var u=void 0===arguments[2]?{}:arguments[2],o=u;o.filename||(o.filename=e);var s=l.ActiveXObject?new l.ActiveXObject("Microsoft.XMLHTTP"):new l.XMLHttpRequest;s.open("GET",e,!0),"overrideMimeType"in s&&s.overrideMimeType("text/plain"),s.onreadystatechange=function(){if(4===s.readyState){var l=s.status;if(0!==l&&200!==l)throw new Error("Could not load "+e);var r=[s.responseText,u];a||t.run.apply(t,r),n&&n(r)}},s.send(null)};var r=function(){for(var e=[],n=["text/ecmascript-6","text/6to5","text/babel","module"],r=0,a=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(){var n=e[r];n instanceof Array&&(t.run.apply(t,n),r++,a())}),u=function(n,l){var r={};n.src?t.load(n.src,function(n){e[l]=n,a()},r,!0):(r.filename="embedded",e[l]=[n.innerHTML,r])},o=l.document.getElementsByTagName("script"),s=0;s<o.length;++s){var i=o[s];n.indexOf(i.type)>=0&&e.push(i)}for(s in e)u(e[s],s);a()};l.addEventListener?l.addEventListener("DOMContentLoaded",r,!1):l.attachEvent&&l.attachEvent("onload",r)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../../package":346,"../transformation":42}],2:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("repeating")),a=l(e("trim-right")),u=l(e("lodash/lang/isBoolean")),o=l(e("lodash/collection/includes")),s=l(e("lodash/lang/isNumber")),i=function(){function e(n,l){t(this,e),this.position=n,this._indent=l.indent.base,this.format=l,this.buf=""}return e.prototype.get=function(){return a(this.buf)},e.prototype.getIndent=function(){return this.format.compact||this.format.concise?"":r(this.format.indent.style,this._indent)},e.prototype.indentSize=function(){return this.getIndent().length},e.prototype.indent=function(){this._indent++},e.prototype.dedent=function(){this._indent--},e.prototype.semicolon=function(){this.push(";")},e.prototype.ensureSemicolon=function(){this.isLast(";")||this.semicolon()},e.prototype.rightBrace=function(){this.newline(!0),this.push("}")},e.prototype.keyword=function(e){this.push(e),this.space()},e.prototype.space=function(){this.format.compact||!this.buf||this.isLast(" ")||this.isLast("\n")||this.push(" ")},e.prototype.removeLast=function(e){this.format.compact||this.isLast(e)&&(this.buf=this.buf.substr(0,this.buf.length-1),this.position.unshift(e))},e.prototype.newline=function(e,n){if(!this.format.compact){if(this.format.concise)return void this.space();if(n||(n=!1),s(e)){if(e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,0>=e)return;for(;e>0;)this._newline(n),e--}else u(e)&&(n=e),this._newline(n)}},e.prototype._newline=function(e){this.endsWith("\n\n")||(e&&this.isLast("\n")&&this.removeLast("\n"),this.removeLast(" "),this._removeSpacesAfterLastNewline(),this._push("\n"))},e.prototype._removeSpacesAfterLastNewline=function(){var e=this.buf.lastIndexOf("\n");if(-1!==e){for(var n=this.buf.length-1;n>e&&" "===this.buf[n];)n--;n===e&&(this.buf=this.buf.substring(0,n+1))}},e.prototype.push=function(e,n){if(!this.format.compact&&this._indent&&!n&&"\n"!==e){var l=this.getIndent();e=e.replace(/\n/g,"\n"+l),this.isLast("\n")&&this._push(l)}this._push(e)},e.prototype._push=function(e){this.position.push(e),this.buf+=e},e.prototype.endsWith=function(e){return this.buf.slice(-e.length)===e},e.prototype.isLast=function(e){if(this.format.compact)return!1;var n=this.buf,l=n[n.length-1];return Array.isArray(e)?o(e,l):e===l},e}();n.exports=i},{"lodash/collection/includes":205,"lodash/lang/isBoolean":291,"lodash/lang/isNumber":295,repeating:329,"trim-right":345}],3:[function(e,n,l){"use strict";function t(e,n){n(e.program)}function r(e,n){n.sequence(e.body)}function a(e,n){0===e.body.length?this.push("{}"):(this.push("{"),this.newline(),n.sequence(e.body,{indent:!0}),this.removeLast("\n"),this.rightBrace())}l.File=t,l.Program=r,l.BlockStatement=a,l.__esModule=!0},{}],4:[function(e,n,l){"use strict";function t(e,n){this.push("class"),e.id&&(this.space(),n(e.id)),n(e.typeParameters),e.superClass&&(this.push(" extends "),n(e.superClass),n(e.superTypeParameters)),e["implements"]&&(this.push(" implements "),n.join(e["implements"],{separator:", "})),this.space(),n(e.body)}function r(e,n){0===e.body.length?this.push("{}"):(this.push("{"),this.newline(),this.indent(),n.sequence(e.body),this.dedent(),this.rightBrace())}function a(e,n){e["static"]&&this.push("static "),this._method(e,n)}l.ClassDeclaration=t,l.ClassBody=r,l.MethodDefinition=a,l.ClassExpression=t,l.__esModule=!0},{}],5:[function(e,n,l){"use strict";function t(e,n){this.keyword("for"),this.push("("),n(e.left),this.push(" of "),n(e.right),this.push(")")}function r(e,n){this.push(e.generator?"(":"["),n.join(e.blocks,{separator:" "}),this.space(),e.filter&&(this.keyword("if"),this.push("("),n(e.filter),this.push(")"),this.space()),n(e.body),this.push(e.generator?")":"]")}l.ComprehensionBlock=t,l.ComprehensionExpression=r,l.__esModule=!0},{}],6:[function(e,n,l){"use strict";function t(e,n){var l=/[a-z]$/.test(e.operator),t=e.argument;(y.isUpdateExpression(t)||y.isUnaryExpression(t))&&(l=!0),y.isUnaryExpression(t)&&"!"===t.operator&&(l=!1),this.push(e.operator),l&&this.push(" "),n(e.argument)}function r(e,n){e.prefix?(this.push(e.operator),n(e.argument)):(n(e.argument),this.push(e.operator))}function a(e,n){n(e.test),this.space(),this.push("?"),this.space(),n(e.consequent),this.space(),this.push(":"),this.space(),n(e.alternate)}function u(e,n){this.push("new "),n(e.callee),this.push("("),n.list(e.arguments),this.push(")")}function o(e,n){n.list(e.expressions)}function s(){this.push("this")}function i(e,n){n(e.callee),this.push("(");var l=",";e._prettyCall?(l+="\n",this.newline(),this.indent()):l+=" ",n.list(e.arguments,{separator:l}),e._prettyCall&&(this.newline(),this.dedent()),this.push(")")}function c(){this.semicolon()}function p(e,n){n(e.expression),this.semicolon()}function d(e,n){n(e.left),this.push(" "),this.push(e.operator),this.push(" "),n(e.right)}function f(e,n){var l=e.object;if(n(l),!e.computed&&y.isMemberExpression(e.property))throw new TypeError("Got a MemberExpression for MemberExpression property");var t=e.computed;y.isLiteral(e.property)&&m(e.property.value)&&(t=!0),t?(this.push("["),n(e.property),this.push("]")):(y.isLiteral(l)&&g(l.value)&&!x.test(l.value.toString())&&this.push("."),this.push("."),n(e.property))}var h=function(e){return e&&e.__esModule?e["default"]:e};l.UnaryExpression=t,l.UpdateExpression=r,l.ConditionalExpression=a,l.NewExpression=u,l.SequenceExpression=o,l.ThisExpression=s,l.CallExpression=i,l.EmptyStatement=c,l.ExpressionStatement=p,l.AssignmentExpression=d,l.MemberExpression=f;{var g=h(e("is-integer")),m=h(e("lodash/lang/isNumber")),y=h(e("../../types")),_=function(e){return function(n,l){this.push(e),(n.delegate||n.all)&&this.push("*"),n.argument&&(this.space(),l(n.argument))}};l.YieldExpression=_("yield"),l.AwaitExpression=_("await")}l.BinaryExpression=d,l.LogicalExpression=d,l.AssignmentPattern=d;var x=/e/i;l.__esModule=!0},{"../../types":122,"is-integer":189,"lodash/lang/isNumber":295}],7:[function(e,n,l){"use strict";function t(){this.push("any")}function r(e,n){n(e.elementType),this.push("["),this.push("]")}function a(){this.push("bool")}function u(e,n){e["static"]&&this.push("static "),n(e.key),n(e.typeAnnotation),this.semicolon()}function o(e,n){this.push("declare class "),this._interfaceish(e,n)}function s(e,n){this.push("declare function "),n(e.id),n(e.id.typeAnnotation.typeAnnotation),this.semicolon()}function i(e,n){this.push("declare module "),n(e.id),this.space(),n(e.body)}function c(e,n){this.push("declare var "),n(e.id),n(e.id.typeAnnotation),this.semicolon()}function p(e,n,l){n(e.typeParameters),this.push("("),n.list(e.params),e.rest&&(e.params.length&&(this.push(","),this.space()),this.push("..."),n(e.rest)),this.push(")"),"ObjectTypeProperty"===l.type||"ObjectTypeCallProperty"===l.type||"DeclareFunction"===l.type?this.push(":"):(this.space(),this.push("=>")),this.space(),n(e.returnType)}function d(e,n){n(e.name),e.optional&&this.push("?"),this.push(":"),this.space(),n(e.typeAnnotation)}function f(e,n){n(e.id),n(e.typeParameters)}function h(e,n){n(e.id),n(e.typeParameters),e["extends"].length&&(this.push(" extends "),n.join(e["extends"],{separator:", "})),this.space(),n(e.body)}function g(e,n){this.push("interface "),this._interfaceish(e,n)}function m(e,n){n.join(e.types,{separator:" & "})}function y(e,n){this.push("?"),n(e.typeAnnotation)}function _(){this.push("number")}function x(e){this._stringLiteral(e.value)}function b(){this.push("string")}function v(e,n){this.push("["),n.join(e.types,{separator:", "}),this.push("]")}function I(e,n){this.push("typeof "),n(e.argument)}function w(e,n){this.push("type "),n(e.id),n(e.typeParameters),this.space(),this.push("="),this.space(),n(e.right),this.semicolon()}function E(e,n){this.push(":"),this.space(),e.optional&&this.push("?"),n(e.typeAnnotation)}function k(e,n){this.push("<"),n.join(e.params,{separator:", "}),this.push(">")}function R(e,n){this.push("{");var l=e.properties.concat(e.callProperties,e.indexers);l.length&&(this.space(),n.list(l,{indent:!0,separator:"; "}),this.space()),this.push("}")}function S(e,n){e["static"]&&this.push("static "),n(e.value)}function C(e,n){e["static"]&&this.push("static "),this.push("["),n(e.id),this.push(":"),this.space(),n(e.key),this.push("]"),this.push(":"),this.space(),n(e.value)}function A(e,n){e["static"]&&this.push("static "),n(e.key),e.optional&&this.push("?"),O.isFunctionTypeAnnotation(e.value)||(this.push(":"),this.space()),n(e.value)}function M(e,n){n(e.qualification),this.push("."),n(e.id)}function j(e,n){n.join(e.types,{separator:" | "})}function T(e,n){this.push("("),n(e.expression),n(e.typeAnnotation),this.push(")")}function P(){this.push("void")}var L=function(e){return e&&e.__esModule?e["default"]:e};l.AnyTypeAnnotation=t,l.ArrayTypeAnnotation=r,l.BooleanTypeAnnotation=a,l.ClassProperty=u,l.DeclareClass=o,l.DeclareFunction=s,l.DeclareModule=i,l.DeclareVariable=c,l.FunctionTypeAnnotation=p,l.FunctionTypeParam=d,l.InterfaceExtends=f,l._interfaceish=h,l.InterfaceDeclaration=g,l.IntersectionTypeAnnotation=m,l.NullableTypeAnnotation=y,l.NumberTypeAnnotation=_,l.StringLiteralTypeAnnotation=x,l.StringTypeAnnotation=b,l.TupleTypeAnnotation=v,l.TypeofTypeAnnotation=I,l.TypeAlias=w,l.TypeAnnotation=E,l.TypeParameterInstantiation=k,l.ObjectTypeAnnotation=R,l.ObjectTypeCallProperty=S,l.ObjectTypeIndexer=C,l.ObjectTypeProperty=A,l.QualifiedTypeIdentifier=M,l.UnionTypeAnnotation=j,l.TypeCastExpression=T,l.VoidTypeAnnotation=P;var O=L(e("../../types"));l.ClassImplements=f,l.GenericTypeAnnotation=f,l.TypeParameterDeclaration=k,l.__esModule=!0},{"../../types":122}],8:[function(e,n,l){"use strict";function t(e,n){n(e.name),e.value&&(this.push("="),n(e.value))}function r(e){this.push(e.name)}function a(e,n){n(e.namespace),this.push(":"),n(e.name)}function u(e,n){n(e.object),this.push("."),n(e.property)}function o(e,n){this.push("{..."),n(e.argument),this.push("}")}function s(e,n){this.push("{"),n(e.expression),this.push("}")}function i(e,n){var l=this,t=e.openingElement;n(t),t.selfClosing||(this.indent(),h(e.children,function(e){g.isLiteral(e)?l.push(e.value):n(e)}),this.dedent(),n(e.closingElement))}function c(e,n){this.push("<"),n(e.name),e.attributes.length>0&&(this.push(" "),n.join(e.attributes,{separator:" "})),this.push(e.selfClosing?" />":">")}function p(e,n){this.push("</"),n(e.name),this.push(">")}function d(){}var f=function(e){return e&&e.__esModule?e["default"]:e};l.JSXAttribute=t,l.JSXIdentifier=r,l.JSXNamespacedName=a,l.JSXMemberExpression=u,l.JSXSpreadAttribute=o,l.JSXExpressionContainer=s,l.JSXElement=i,l.JSXOpeningElement=c,l.JSXClosingElement=p,l.JSXEmptyExpression=d;var h=f(e("lodash/collection/each")),g=f(e("../../types"));l.__esModule=!0},{"../../types":122,"lodash/collection/each":202}],9:[function(e,n,l){"use strict";function t(e,n){var l=this;n(e.typeParameters),this.push("("),n.list(e.params,{iterator:function(e){e.optional&&l.push("?"),n(e.typeAnnotation)}}),this.push(")"),e.returnType&&n(e.returnType)}function r(e,n){var l=e.value,t=e.kind,r=e.key;t&&"init"!==t?this.push(t+" "):l.generator&&this.push("*"),l.async&&this.push("async "),e.computed?(this.push("["),n(r),this.push("]")):n(r),this._params(l,n),this.push(" "),n(l.body)}function a(e,n){e.async&&this.push("async "),this.push("function"),e.generator&&this.push("*"),e.id?(this.push(" "),n(e.id)):this.space(),this._params(e,n),this.space(),n(e.body)}function u(e,n){e.async&&this.push("async "),1===e.params.length&&s.isIdentifier(e.params[0])?n(e.params[0]):this._params(e,n),this.push(" => "),n(e.body)}var o=function(e){return e&&e.__esModule?e["default"]:e};l._params=t,l._method=r,l.FunctionExpression=a,l.ArrowFunctionExpression=u;var s=o(e("../../types"));l.FunctionDeclaration=a,l.__esModule=!0},{"../../types":122}],10:[function(e,n,l){"use strict";function t(e,n){return p.isSpecifierDefault(e)?void n(p.getSpecifierName(e)):r.apply(this,arguments)}function r(e,n){n(e.id),e.name&&(this.push(" as "),n(e.name))}function a(){this.push("*")}function u(e,n){this.push("export ");var l=e.specifiers;if(e["default"]&&this.push("default "),e.declaration){if(n(e.declaration),p.isStatement(e.declaration))return}else 1===l.length&&p.isExportBatchSpecifier(l[0])?n(l[0]):(this.push("{"),l.length&&(this.space(),n.join(l,{separator:", "}),this.space()),this.push("}")),e.source&&(this.push(" from "),n(e.source));this.ensureSemicolon()}function o(e,n){var l=this;this.push("import "),e.isType&&this.push("type ");var t=e.specifiers;if(t&&t.length){var r=!1;c(e.specifiers,function(e,t){+t>0&&l.push(", ");var a=p.isSpecifierDefault(e);a||"ImportBatchSpecifier"===e.type||r||(r=!0,l.push("{ ")),n(e)}),r&&this.push(" }"),this.push(" from ")}n(e.source),this.semicolon()}function s(e,n){this.push("* as "),n(e.name)}var i=function(e){return e&&e.__esModule?e["default"]:e};l.ImportSpecifier=t,l.ExportSpecifier=r,l.ExportBatchSpecifier=a,l.ExportDeclaration=u,l.ImportDeclaration=o,l.ImportBatchSpecifier=s;var c=i(e("lodash/collection/each")),p=i(e("../../types"));l.__esModule=!0},{"../../types":122,"lodash/collection/each":202}],11:[function(e,n,l){"use strict";var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("lodash/collection/each"));r(["BindMemberExpression","BindFunctionExpression"],function(e){l[e]=function(){throw new ReferenceError("Trying to render non-standard playground node "+JSON.stringify(e))}})},{"lodash/collection/each":202}],12:[function(e,n,l){"use strict";function t(e,n){this.keyword("with"),this.push("("),n(e.object),this.push(")"),n.block(e.body)}function r(e,n){this.keyword("if"),this.push("("),n(e.test),this.push(")"),this.space(),n.indentOnComments(e.consequent),e.alternate&&(this.isLast("}")&&this.space(),this.push("else "),n.indentOnComments(e.alternate))}function a(e,n){this.keyword("for"),this.push("("),n(e.init),this.push(";"),e.test&&(this.push(" "),n(e.test)),this.push(";"),e.update&&(this.push(" "),n(e.update)),this.push(")"),n.block(e.body)}function u(e,n){this.keyword("while"),this.push("("),n(e.test),this.push(")"),n.block(e.body)}function o(e,n){this.keyword("do"),n(e.body),this.space(),this.keyword("while"),this.push("("),n(e.test),this.push(");")}function s(e,n){n(e.label),this.push(": "),n(e.body)}function i(e,n){this.keyword("try"),n(e.block),this.space(),n(e.handlers?e.handlers[0]:e.handler),e.finalizer&&(this.space(),this.push("finally "),n(e.finalizer))}function c(e,n){this.keyword("catch"),this.push("("),n(e.param),this.push(") "),n(e.body)}function p(e,n){this.push("throw "),n(e.argument),this.semicolon()}function d(e,n){this.keyword("switch"),this.push("("),n(e.discriminant),this.push(")"),this.space(),this.push("{"),n.sequence(e.cases,{indent:!0,addNewlines:function(n,l){return n||e.cases[e.cases.length-1]!==l?void 0:-1}}),this.push("}")}function f(e,n){e.test?(this.push("case "),n(e.test),this.push(":")):this.push("default:"),e.consequent.length&&(this.newline(),n.sequence(e.consequent,{indent:!0}))}function h(){this.push("debugger;")}function g(e,n,l){this.push(e.kind+" ");var t=!1;if(!b.isFor(l))for(var r=0;r<e.declarations.length;r++)e.declarations[r].init&&(t=!0);var a=",";a+=!this.format.compact&&t?"\n"+x(" ",e.kind.length+1):" ",n.list(e.declarations,{separator:a}),b.isFor(l)||this.semicolon()}function m(e,n){this.push("private "),n.join(e.declarations,{separator:", "}),this.semicolon()}function y(e,n){n(e.id),n(e.id.typeAnnotation),e.init&&(this.space(),this.push("="),this.space(),n(e.init))}var _=function(e){return e&&e.__esModule?e["default"]:e};l.WithStatement=t,l.IfStatement=r,l.ForStatement=a,l.WhileStatement=u,l.DoWhileStatement=o,l.LabeledStatement=s,l.TryStatement=i,l.CatchClause=c,l.ThrowStatement=p,l.SwitchStatement=d,l.SwitchCase=f,l.DebuggerStatement=h,l.VariableDeclaration=g,l.PrivateDeclaration=m,l.VariableDeclarator=y;{var x=_(e("repeating")),b=_(e("../../types")),v=function(e){return function(n,l){this.keyword("for"),this.push("("),l(n.left),this.push(" "+e+" "),l(n.right),this.push(")"),l.block(n.body)}},I=(l.ForInStatement=v("in"),l.ForOfStatement=v("of"),function(e,n){return function(l,t){this.push(e);var r=l[n||"label"];r&&(this.push(" "),t(r)),this.semicolon()}});l.ContinueStatement=I("continue"),l.ReturnStatement=I("return","argument"),l.BreakStatement=I("break")}l.__esModule=!0},{"../../types":122,repeating:329}],13:[function(e,n,l){"use strict";function t(e,n){n(e.tag),n(e.quasi)}function r(e){this._push(e.value.raw)}function a(e,n){var l=this;this.push("`");var t=e.quasis,r=t.length;o(t,function(t,a){n(t),r>a+1&&(l.push("${ "),n(e.expressions[a]),l.push(" }"))}),this._push("`")}var u=function(e){return e&&e.__esModule?e["default"]:e};l.TaggedTemplateExpression=t,l.TemplateElement=r,l.TemplateLiteral=a;var o=u(e("lodash/collection/each"));l.__esModule=!0},{"lodash/collection/each":202}],14:[function(e,n,l){"use strict";function t(e){this.push(e.name)}function r(e,n){this.push("..."),n(e.argument)}function a(e,n){n(e.object),this.push("::"),n(e.property)}function u(e,n){var l=e.properties;l.length?(this.push("{"),this.space(),n.list(l,{indent:!0}),this.space(),this.push("}")):this.push("{}")}function o(e,n){if(e.method||"get"===e.kind||"set"===e.kind)this._method(e,n);else{if(e.computed)this.push("["),n(e.key),this.push("]");else if(n(e.key),e.shorthand)return;this.push(":"),this.space(),n(e.value)}}function s(e,n){var l=this,t=e.elements,r=t.length;this.push("["),d(t,function(e,t){e?(t>0&&l.push(" "),n(e),r-1>t&&l.push(",")):l.push(",")}),this.push("]")}function i(e){var n=e.value,l=typeof n;"string"===l?this._stringLiteral(n):"number"===l?this.push(n+""):"boolean"===l?this.push(n?"true":"false"):e.regex?this.push("/"+e.regex.pattern+"/"+e.regex.flags):null===n&&this.push("null")}function c(e){e=JSON.stringify(e),e=e.replace(/[\u000A\u000D\u2028\u2029]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}),this.push(e)}var p=function(e){return e&&e.__esModule?e["default"]:e};l.Identifier=t,l.RestElement=r,l.VirtualPropertyExpression=a,l.ObjectExpression=u,l.Property=o,l.ArrayExpression=s,l.Literal=i,l._stringLiteral=c;var d=p(e("lodash/collection/each"));l.SpreadElement=r,l.SpreadProperty=r,l.ObjectPattern=u,l.ArrayPattern=s,l.__esModule=!0},{"lodash/collection/each":202}],15:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=t(e("detect-indent")),u=t(e("./whitespace")),o=t(e("repeating")),s=t(e("./source-map")),i=t(e("./position")),c=l(e("../messages")),p=t(e("./buffer")),d=t(e("lodash/object/extend")),f=t(e("lodash/collection/each")),h=t(e("./node")),g=t(e("../types")),m=function(){function n(e,l,t){r(this,n),l||(l={}),this.comments=e.comments||[],this.tokens=e.tokens||[],this.format=n.normalizeOptions(t,l),this.opts=l,this.ast=e,this.whitespace=new u(this.tokens,this.comments,this.format),this.position=new i,this.map=new s(this.position,l,t),this.buffer=new p(this.position,this.format)}return n.normalizeOptions=function(e,n){var l=" ";if(e){var t=a(e).indent;t&&" "!==t&&(l=t)}var r={comments:null==n.comments||n.comments,compact:n.compact,indent:{adjustMultilineComment:!0,style:l,base:0}};return"auto"===r.compact&&(r.compact=e.length>1e5,r.compact&&console.error(c.get("codeGeneratorDeopt",n.filename,"100KB"))),r},n.generators={templateLiterals:e("./generators/template-literals"),comprehensions:e("./generators/comprehensions"),expressions:e("./generators/expressions"),statements:e("./generators/statements"),playground:e("./generators/playground"),classes:e("./generators/classes"),methods:e("./generators/methods"),modules:e("./generators/modules"),types:e("./generators/types"),flow:e("./generators/flow"),base:e("./generators/base"),jsx:e("./generators/jsx")},n.prototype.generate=function(){var e=this.ast;this.print(e);var n=[];return f(e.comments,function(e){e._displayed||n.push(e)}),this._printComments(n),{map:this.map.get(),code:this.buffer.get()}},n.prototype.buildPrint=function(e){var n=this,l=function(l,t){return n.print(l,e,t)};return l.sequence=function(e){var t=void 0===arguments[1]?{}:arguments[1];return t.statement=!0,n.printJoin(l,e,t)},l.join=function(e,t){return n.printJoin(l,e,t)},l.list=function(e){var n=void 0===arguments[1]?{}:arguments[1],t=n;t.separator||(t.separator=", "),l.join(e,n)},l.block=function(e){return n.printBlock(l,e)},l.indentOnComments=function(e){return n.printAndIndentOnComments(l,e)},l},n.prototype.print=function(e,n){var l=this,t=void 0===arguments[2]?{}:arguments[2];if(e){n&&n._compact&&(e._compact=!0);var r=this.format.concise;e._compact&&(this.format.concise=!0);var a=function(r){if(t.statement||h.isUserWhitespacable(e,n)){var a=0;if(null==e.start||e._ignoreUserWhitespace){r||a++,t.addNewlines&&(a+=t.addNewlines(r,e)||0);var u=h.needsWhitespaceAfter;r&&(u=h.needsWhitespaceBefore),u(e,n)&&a++,l.buffer.buf||(a=0)}else a=r?l.whitespace.getNewlinesBefore(e):l.whitespace.getNewlinesAfter(e);l.newline(a)}};if(!this[e.type])throw new ReferenceError("unknown node of type "+JSON.stringify(e.type)+" with constructor "+JSON.stringify(e&&e.constructor.name));var u=h.needsParensNoLineTerminator(e,n),o=u||h.needsParens(e,n);o&&this.push("("),u&&this.indent(),this.printLeadingComments(e,n),a(!0),t.before&&t.before(),this.map.mark(e,"start"),this[e.type](e,this.buildPrint(e),n),u&&(this.newline(),this.dedent()),o&&this.push(")"),this.map.mark(e,"end"),t.after&&t.after(),a(!1),this.printTrailingComments(e,n),this.format.concise=r}},n.prototype.printJoin=function(e,n){var l=this,t=void 0===arguments[2]?{}:arguments[2];if(n&&n.length){var r=n.length;t.indent&&this.indent(),f(n,function(n,a){e(n,{statement:t.statement,addNewlines:t.addNewlines,after:function(){t.iterator&&t.iterator(n,a),t.separator&&r-1>a&&l.push(t.separator)}})}),t.indent&&this.dedent()}},n.prototype.printAndIndentOnComments=function(e,n){var l=!!n.leadingComments;l&&this.indent(),e(n),l&&this.dedent()},n.prototype.printBlock=function(e,n){g.isEmptyStatement(n)?this.semicolon():(this.push(" "),e(n))},n.prototype.generateComment=function(e){var n=e.value;return n="Line"===e.type?"//"+n:"/*"+n+"*/"},n.prototype.printTrailingComments=function(e,n){this._printComments(this.getComments("trailingComments",e,n))},n.prototype.printLeadingComments=function(e,n){this._printComments(this.getComments("leadingComments",e,n))},n.prototype.getComments=function(e,n,l){var t=this;if(g.isExpressionStatement(l))return[];var r=[],a=[n];return g.isExpressionStatement(n)&&a.push(n.argument),f(a,function(n){r=r.concat(t._getComments(e,n))}),r},n.prototype._getComments=function(e,n){return n&&n[e]||[]},n.prototype._printComments=function(e){var n=this;this.format.compact||this.format.comments&&e&&e.length&&f(e,function(e){var l=!1;if(f(n.ast.comments,function(n){return n.start===e.start?(n._displayed&&(l=!0),n._displayed=!0,!1):void 0}),!l){n.newline(n.whitespace.getNewlinesBefore(e));var t=n.position.column,r=n.generateComment(e);if(t&&!n.isLast(["\n"," ","[","{"])&&(n._push(" "),t++),"Block"===e.type&&n.format.indent.adjustMultilineComment){var a=e.loc.start.column;if(a){var u=new RegExp("\\n\\s{1,"+a+"}","g");r=r.replace(u,"\n")}var s=Math.max(n.indentSize(),t);r=r.replace(/\n/g,"\n"+o(" ",s))}0===t&&(r=n.getIndent()+r),n._push(r),n.newline(n.whitespace.getNewlinesAfter(e))}})},n}();f(p.prototype,function(e,n){m.prototype[n]=function(){return e.apply(this.buffer,arguments)}}),f(m.generators,function(e){d(m.prototype,e)}),n.exports=function(e,n,l){var t=new m(e,n,l);return t.generate()},n.exports.CodeGenerator=m},{"../messages":26,"../types":122,"./buffer":2,"./generators/base":3,"./generators/classes":4,"./generators/comprehensions":5,"./generators/expressions":6,"./generators/flow":7,"./generators/jsx":8,"./generators/methods":9,"./generators/modules":10,"./generators/playground":11,"./generators/statements":12,"./generators/template-literals":13,"./generators/types":14,"./node":16,"./position":19,"./source-map":20,"./whitespace":21,"detect-indent":181,"lodash/collection/each":202,"lodash/object/extend":303,repeating:329}],16:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=t(e("./whitespace")),u=l(e("./parentheses")),o=t(e("lodash/collection/each")),s=t(e("lodash/collection/some")),i=t(e("../../types")),c=function(e,n,l){if(e){for(var t,r=Object.keys(e),a=0;a<r.length;a++){var u=r[a];if(i.is(u,n)){var o=e[u];if(t=o(n,l),null!=t)break}}return t}},p=function(){function e(n,l){r(this,e),this.parent=l,this.node=n}return e.isUserWhitespacable=function(e){return i.isUserWhitespacable(e)},e.needsWhitespace=function(n,l,t){if(!n)return 0;i.isExpressionStatement(n)&&(n=n.expression);var r=c(a.nodes,n,l);if(!r){var u=c(a.list,n,l);if(u)for(var o=0;o<u.length&&!(r=e.needsWhitespace(u[o],n,t));o++);}return r&&r[t]||0},e.needsWhitespaceBefore=function(n,l){return e.needsWhitespace(n,l,"before")},e.needsWhitespaceAfter=function(n,l){return e.needsWhitespace(n,l,"after")},e.needsParens=function(e,n){if(!n)return!1;if(i.isNewExpression(n)&&n.callee===e){if(i.isCallExpression(e))return!0;var l=s(e,function(e){return i.isCallExpression(e)});if(l)return!0}return c(u,e,n)},e.needsParensNoLineTerminator=function(e,n){return n&&e.leadingComments&&e.leadingComments.length?i.isYieldExpression(n)||i.isAwaitExpression(n)?!0:i.isContinueStatement(n)||i.isBreakStatement(n)||i.isReturnStatement(n)||i.isThrowStatement(n)?!0:!1:!1},e}();n.exports=p,o(p,function(e,n){p.prototype[n]=function(){var e=new Array(arguments.length+2);e[0]=this.node,e[1]=this.parent;for(var l=0;l<e.length;l++)e[l+2]=arguments[l];return p[n].apply(null,e)}})},{"../../types":122,"./parentheses":17,"./whitespace":18,"lodash/collection/each":202,"lodash/collection/some":208}],17:[function(e,n,l){"use strict";function t(e,n){return m.isArrayTypeAnnotation(n)}function r(e,n){return m.isMemberExpression(n)&&n.object===e?!0:void 0}function a(e,n){return m.isExpressionStatement(n)?!0:m.isMemberExpression(n)&&n.object===e?!0:!1}function u(e,n){if((m.isCallExpression(n)||m.isNewExpression(n))&&n.callee===e)return!0;if(m.isUnaryLike(n))return!0;if(m.isMemberExpression(n)&&n.object===e)return!0;if(m.isBinary(n)){var l=n.operator,t=y[l],r=e.operator,a=y[r];if(t>a)return!0;if(t===a&&n.right===e)return!0}}function o(e,n){if("in"===e.operator){if(m.isVariableDeclarator(n))return!0;if(m.isFor(n))return!0}}function s(e,n){return m.isForStatement(n)?!1:m.isExpressionStatement(n)&&n.expression===e?!1:!0}function i(e,n){return m.isBinary(n)||m.isUnaryLike(n)||m.isCallExpression(n)||m.isMemberExpression(n)||m.isNewExpression(n)||m.isConditionalExpression(n)||m.isYieldExpression(n)}function c(e,n){return m.isExpressionStatement(n)}function p(e,n){return m.isMemberExpression(n)&&n.object===e}function d(e,n){return m.isExpressionStatement(n)?!0:m.isMemberExpression(n)&&n.object===e?!0:m.isCallExpression(n)&&n.callee===e?!0:void 0}function f(e,n){return m.isUnaryLike(n)?!0:m.isBinary(n)?!0:(m.isCallExpression(n)||m.isNewExpression(n))&&n.callee===e?!0:m.isConditionalExpression(n)&&n.test===e?!0:m.isMemberExpression(n)&&n.object===e?!0:!1}var h=function(e){return e&&e.__esModule?e["default"]:e};l.NullableTypeAnnotation=t,l.UpdateExpression=r,l.ObjectExpression=a,l.Binary=u,l.BinaryExpression=o,l.SequenceExpression=s,l.YieldExpression=i,l.ClassExpression=c,l.UnaryLike=p,l.FunctionExpression=d,l.ConditionalExpression=f;var g=h(e("lodash/collection/each")),m=h(e("../../types")),y={};g([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(e,n){g(e,function(e){y[e]=n})}),l.FunctionTypeAnnotation=t,l.AssignmentExpression=f,l.__esModule=!0},{"../../types":122,"lodash/collection/each":202}],18:[function(e,n,l){"use strict";function t(e){var n=void 0===arguments[1]?{}:arguments[1];if(c.isMemberExpression(e))t(e.object,n),e.computed&&t(e.property,n);else if(c.isBinary(e)||c.isAssignmentExpression(e))t(e.left,n),t(e.right,n);else if(c.isCallExpression(e))n.hasCall=!0,t(e.callee,n);else if(c.isFunction(e))n.hasFunction=!0;else if(c.isIdentifier(e)){var l=n;l.hasHelper||(l.hasHelper=r(e.callee))}return n}function r(e){return c.isMemberExpression(e)?r(e.object)||r(e.property):c.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:c.isCallExpression(e)?r(e.callee):c.isBinary(e)||c.isAssignmentExpression(e)?c.isIdentifier(e.left)&&r(e.left)||r(e.right):!1}function a(e){return c.isLiteral(e)||c.isObjectExpression(e)||c.isArrayExpression(e)||c.isIdentifier(e)||c.isMemberExpression(e)}var u=function(e){return e&&e.__esModule?e["default"]:e},o=u(e("lodash/lang/isBoolean")),s=u(e("lodash/collection/each")),i=u(e("lodash/collection/map")),c=u(e("../../types"));l.nodes={AssignmentExpression:function(e){var n=t(e.right);return n.hasCall&&n.hasHelper||n.hasFunction?{before:n.hasFunction,after:!0}:void 0},SwitchCase:function(e,n){return{before:e.consequent.length||n.cases[0]===e}},LogicalExpression:function(e){return c.isFunction(e.left)||c.isFunction(e.right)?{after:!0}:void 0},Literal:function(e){return"use strict"===e.value?{after:!0}:void 0},CallExpression:function(e){return c.isFunction(e.callee)||r(e)?{before:!0,after:!0}:void 0},VariableDeclaration:function(e){for(var n=0;n<e.declarations.length;n++){var l=e.declarations[n],u=r(l.id)&&!a(l.init);if(!u){var o=t(l.init);u=r(l.init)&&o.hasCall||o.hasFunction}if(u)return{before:!0,after:!0}}},IfStatement:function(e){return c.isBlockStatement(e.consequent)?{before:!0,after:!0}:void 0
}},l.nodes.Property=l.nodes.SpreadProperty=function(e,n){return n.properties[0]===e?{before:!0}:void 0},l.list={VariableDeclaration:function(e){return i(e.declarations,"init")},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties}},s({Function:!0,Class:!0,Loop:!0,LabeledStatement:!0,SwitchStatement:!0,TryStatement:!0},function(e,n){o(e)&&(e={after:e,before:e}),s([n].concat(c.FLIPPED_ALIAS_KEYS[n]||[]),function(n){l.nodes[n]=function(){return e}})})},{"../../types":122,"lodash/collection/each":202,"lodash/collection/map":206,"lodash/lang/isBoolean":291}],19:[function(e,n){"use strict";var l=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},t=function(){function e(){l(this,e),this.line=1,this.column=0}return e.prototype.push=function(e){for(var n=0;n<e.length;n++)"\n"===e[n]?(this.line++,this.column=0):this.column++},e.prototype.unshift=function(e){for(var n=0;n<e.length;n++)"\n"===e[n]?this.line--:this.column--},e}();n.exports=t},{}],20:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("source-map")),a=l(e("../types")),u=function(){function e(n,l,a){t(this,e),this.position=n,this.opts=l,l.sourceMap?(this.map=new r.SourceMapGenerator({file:l.sourceMapName,sourceRoot:l.sourceRoot}),this.map.setSourceContent(l.sourceFileName,a)):this.map=null}return e.prototype.get=function(){var e=this.map;return e?e.toJSON():e},e.prototype.mark=function(e,n){var l=e.loc;if(l){var t=this.map;if(t&&!a.isProgram(e)&&!a.isFile(e)){var r=this.position,u={line:r.line,column:r.column},o=l[n];t.addMapping({source:this.opts.sourceFileName,generated:u,original:o})}}},e}();n.exports=u},{"../types":122,"source-map":333}],21:[function(e,n){"use strict";function l(e,n,l){return e+=n,e>=l&&(e-=l),e}var t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=t(e("lodash/collection/sortBy")),u=function(){function e(n,l){r(this,e),this.tokens=a(n.concat(l),"start"),this.used={},this._lastFoundIndex=0}return e.prototype.getNewlinesBefore=function(e){for(var n,t,r,a=this.tokens,u=0;u<a.length;u++){var o=l(u,this._lastFoundIndex,this.tokens.length);if(r=a[o],e.start===r.start){n=a[o-1],t=r,this._lastFoundIndex=o;break}}return this.getNewlinesBetween(n,t)},e.prototype.getNewlinesAfter=function(e){for(var n,t,r,a=this.tokens,u=0;u<a.length;u++){var o=l(u,this._lastFoundIndex,this.tokens.length);if(r=a[o],e.end===r.end){n=r,t=a[o+1],this._lastFoundIndex=o;break}}if(t&&"eof"===t.type.type)return 1;var s=this.getNewlinesBetween(n,t);return"Line"!==e.type||s?s:1},e.prototype.getNewlinesBetween=function(e,n){if(!n||!n.loc)return 0;for(var l=e?e.loc.end.line:1,t=n.loc.start.line,r=0,a=l;t>a;a++)"undefined"==typeof this.used[a]&&(this.used[a]=!0,r++);return r},e}();n.exports=u},{"lodash/collection/sortBy":209}],22:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("line-numbers")),r=l(e("repeating")),a=l(e("js-tokens")),u=l(e("esutils")),o=l(e("chalk")),s=l(e("lodash/function/ary")),i={string:o.red,punctuator:o.white.bold,curly:o.green,parens:o.blue.bold,square:o.yellow,name:o.white,keyword:o.cyan,number:o.magenta,regex:o.magenta,comment:o.grey,invalid:o.inverse},c=/\r\n|[\n\r\u2028\u2029]/,p=function(e){var n=function(e){var n=a.matchToToken(e);if("name"===n.type&&u.keyword.isReservedWordES6(n.value))return"keyword";if("punctuator"===n.type)switch(n.value){case"{":case"}":return"curly";case"(":case")":return"parens";case"[":case"]":return"square"}return n.type};return e.replace(a,function(e){var l=n(arguments);if(l in i){var t=s(i[l],1);return e.split(c).map(t).join("\n")}return e})};n.exports=function(e,n,l){l=Math.max(l,0),o.supportsColor&&(e=p(e)),e=e.split(c);var a=Math.max(n-3,0),u=Math.min(e.length,n+3);return n||l||(a=0,u=e.length),"\n"+t(e.slice(a,u),{start:a+1,before:" ",after:" | ",transform:function(e){e.number===n&&(l&&(e.line+="\n"+e.before+r(" ",e.width)+e.after+r(" ",l-1)+"^"),e.before=e.before.replace(/^./,">"))}}).join("\n")}},{chalk:168,esutils:186,"js-tokens":192,"line-numbers":194,"lodash/function/ary":211,repeating:329}],23:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("../types"));n.exports=function(e,n,l){if(e&&"Program"===e.type)return t.file(e,n||[],l||[]);throw new Error("Not a valid ast?")}},{"../types":122}],24:[function(e,n){"use strict";n.exports=function(){return Object.create(null)}},{}],25:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("./normalize-ast")),r=l(e("estraverse")),a=l(e("./code-frame")),u=l(e("acorn-babel"));n.exports=function(e,n,l){try{var o=[],s=[],i=u.parse(n,{allowImportExportEverywhere:e.allowImportExportEverywhere,allowReturnOutsideFunction:!e._anal,ecmaVersion:e.experimental?7:6,playground:e.playground,strictMode:e.strictMode,onComment:o,locations:!0,onToken:s,ranges:!0});return r.attachComments(i,o,s),i=t(i,o,s),l?l(i):i}catch(c){if(!c._babel){c._babel=!0;var p=""+e.filename+": "+c.message,d=c.loc;if(d){var f=a(n,d.line,d.column+1);p+=f}c.stack&&(c.stack=c.stack.replace(c.message,p)),c.message=p}throw c}}},{"./code-frame":22,"./normalize-ast":23,"acorn-babel":125,estraverse:182}],26:[function(e,n,l){"use strict";function t(e){var n=o[e];if(!n)throw new ReferenceError("Unknown message "+JSON.stringify(e));for(var l=[],t=1;t<arguments.length;t++)l.push(arguments[t]);return l=r(l),n.replace(/\$(\d+)/g,function(e,n){return l[--n]})}function r(e){return e.map(function(e){if(null!=e&&e.inspect)return e.inspect();try{return JSON.stringify(e)||e+""}catch(n){return u.inspect(e)}})}var a=function(e){return e&&e.__esModule?e:{"default":e}};l.get=t,l.parseArgs=r;var u=a(e("util")),o=l.messages={tailCallReassignmentDeopt:"Function reference has been reassigned so it's probably be dereferenced so we can't optimise this with confidence",JSXNamespacedTags:"Namespace tags are not supported. ReactJSX is not XML.",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",classesIllegalConstructorKind:"Illegal kind for constructor method",scopeDuplicateDeclaration:"Duplicate declaration $1",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",settersInvalidParamLength:"Setters must have exactly one parameter",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemeberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",modulesIllegalExportName:"Illegal export $1",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",evalInStrictMode:"eval is not allowed in strict mode",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues"};l.__esModule=!0},{util:167}],27:[function(e){"use strict";var n=function(e){return e&&e.__esModule?e["default"]:e},l=n(e("estraverse")),t=n(e("lodash/object/extend")),r=n(e("ast-types")),a=n(e("./types"));t(l.VisitorKeys,a.VISITOR_KEYS);var u=r.Type.def,o=r.Type.or;u("File").bases("Node").build("program").field("program",u("Program")),u("AssignmentPattern").bases("Pattern").build("left","right").field("left",u("Pattern")).field("right",u("Expression")),u("ImportBatchSpecifier").bases("Specifier").build("name").field("name",u("Identifier")),u("RestElement").bases("Pattern").build("argument").field("argument",u("expression")),u("VirtualPropertyExpression").bases("Expression").build("object","property").field("object",u("Expression")).field("property",o(u("Identifier"),u("Expression"))),u("PrivateDeclaration").bases("Declaration").build("declarations").field("declarations",[u("Identifier")]),u("BindMemberExpression").bases("Expression").build("object","property","arguments").field("object",u("Expression")).field("property",o(u("Identifier"),u("Expression"))).field("arguments",[u("Expression")]),u("BindFunctionExpression").bases("Expression").build("callee","arguments").field("callee",u("Expression")).field("arguments",[u("Expression")]),r.finalize()},{"./types":122,"ast-types":139,estraverse:182,"lodash/object/extend":303}],28:[function(e,n){"use strict";function l(e,n,l){b(e,function(e){e.shouldRun||e.checkNode(n,l)})}var t=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},u=r(e("convert-source-map")),o=r(e("shebang-regex")),s=r(e("lodash/lang/isFunction")),i=r(e("source-map")),c=r(e("./index")),p=r(e("../generation")),d=r(e("lodash/object/defaults")),f=r(e("lodash/collection/includes")),h=r(e("lodash/object/assign")),g=r(e("../helpers/parse")),m=r(e("../traversal/scope")),y=r(e("slash")),_=t(e("../util")),x=r(e("path")),b=r(e("lodash/collection/each")),v=r(e("../types")),I={enter:function(e,n,t,r){l(r.stack,e,t)}},w=function(){function n(e){a(this,n),this.dynamicImportedNoDefault=[],this.dynamicImportIds={},this.dynamicImported=[],this.dynamicImports=[],this.usedHelpers={},this.dynamicData={},this.data={},this.lastStatements=[],this.opts=this.normalizeOptions(e),this.ast={},this.buildTransformers()}return n.helpers=["inherits","defaults","create-class","apply-constructor","tagged-template-literal","tagged-template-literal-loose","interop-require","to-array","to-consumable-array","sliced-to-array","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-require-wildcard","typeof","extends","get","set","class-call-check","object-destructuring-empty","temporal-undefined","temporal-assert-defined","self-global"],n.validOptions=["filename","filenameRelative","blacklist","whitelist","optional","loose","playground","experimental","modules","moduleIds","moduleId","resolveModuleSource","keepModuleIdExtensions","code","ast","comments","compact","auxiliaryComment","externalHelpers","returnUsedHelpers","inputSourceMap","sourceMap","sourceMapName","sourceFileName","sourceRoot","moduleRoot","format","reactCompat","ignore","only","extensions","accept"],n.prototype.normalizeOptions=function(e){e=h({},e);for(var l in e)if("_"!==l[0]&&n.validOptions.indexOf(l)<0)throw new ReferenceError("Unknown option: "+l);d(e,{keepModuleIdExtensions:!1,resolveModuleSource:null,returnUsedHelpers:!1,externalHelpers:!1,auxilaryComment:"",inputSourceMap:!1,experimental:!1,reactCompat:!1,playground:!1,moduleIds:!1,blacklist:[],whitelist:[],sourceMap:!1,optional:[],comments:!0,filename:"unknown",modules:"common",compact:"auto",loose:[],code:!0,ast:!0}),e.inputSourceMap&&(e.sourceMap=!0),e.filename=y(e.filename),e.sourceRoot&&(e.sourceRoot=y(e.sourceRoot)),e.moduleId&&(e.moduleIds=!0),e.basename=x.basename(e.filename,x.extname(e.filename)),e.blacklist=_.arrayify(e.blacklist),e.whitelist=_.arrayify(e.whitelist),e.optional=_.arrayify(e.optional),e.compact=_.booleanify(e.compact),e.loose=_.arrayify(e.loose),(f(e.loose,"all")||f(e.loose,!0))&&(e.loose=Object.keys(c.transformers)),d(e,{moduleRoot:e.sourceRoot}),d(e,{sourceRoot:e.moduleRoot}),d(e,{filenameRelative:e.filename}),d(e,{sourceFileName:e.filenameRelative,sourceMapName:e.filenameRelative}),e.playground&&(e.experimental=!0),e.externalHelpers&&this.set("helpersNamespace",v.identifier("babelHelpers")),e.blacklist=c._ensureTransformerNames("blacklist",e.blacklist),e.whitelist=c._ensureTransformerNames("whitelist",e.whitelist),e.optional=c._ensureTransformerNames("optional",e.optional),e.loose=c._ensureTransformerNames("loose",e.loose),e.reactCompat&&(e.optional.push("reactCompat"),console.error("The reactCompat option has been moved into the optional transformer `reactCompat`"));var t=function(n){var l=c.transformerNamespaces[n];"es7"===l&&(e.experimental=!0),"playground"===l&&(e.playground=!0)};return b(e.whitelist,t),b(e.optional,t),e},n.prototype.isLoose=function(e){return f(this.opts.loose,e)},n.prototype.buildTransformers=function(){var e=this,n={},l=[],t=[];b(c.transformers,function(r,a){var u=n[a]=r.buildPass(e);u.canRun(e)&&(t.push(u),r.secondPass&&l.push(u),r.manipulateOptions&&r.manipulateOptions(e.opts,e))}),this.transformerStack=t.concat(l),this.transformers=n},n.prototype.debug=function(e){var n=this.opts.filename;e&&(n+=": "+e),_.debug(n)},n.prototype.getModuleFormatter=function(n){var l=s(n)?n:c.moduleFormatters[n];if(!l){var t=_.resolve(n);t&&(l=e(t))}if(!l)throw new ReferenceError("Unknown module formatter type "+JSON.stringify(n));return new l(this)},n.prototype.parseInputSourceMap=function(e){var n=this.opts,l=u.fromSource(e);return l&&(n.inputSourceMap=l,e=u.removeComments(e)),e},n.prototype.parseShebang=function(e){var n=o.exec(e);return n&&(this.shebang=n[0],e=e.replace(o,"")),e},n.prototype.set=function(e,n){return this.data[e]=n},n.prototype.setDynamic=function(e,n){this.dynamicData[e]=n},n.prototype.get=function(e){var n=this.data[e];if(n)return n;var l=this.dynamicData[e];return l?this.set(e,l()):void 0},n.prototype.addImport=function(e,n,l){n||(n=e);var t=this.dynamicImportIds[n];if(!t){t=this.dynamicImportIds[n]=this.scope.generateUidIdentifier(n);var r=[v.importSpecifier(v.identifier("default"),t)],a=v.importDeclaration(r,v.literal(e));a._blockHoist=3,this.dynamicImported.push(a),l&&this.dynamicImportedNoDefault.push(a),this.moduleFormatter.importSpecifier(r[0],a,this.dynamicImports)}return t},n.prototype.isConsequenceExpressionStatement=function(e){return v.isExpressionStatement(e)&&this.lastStatements.indexOf(e)>=0},n.prototype.attachAuxiliaryComment=function(e){var n=this.opts.auxiliaryComment;if(n){var l=e;l.leadingComments||(l.leadingComments=[]),e.leadingComments.push({type:"Line",value:" "+n})}return e},n.prototype.addHelper=function(e){if(!f(n.helpers,e))throw new ReferenceError("Unknown helper "+e);var l=this.ast.program,t=l._declarations&&l._declarations[e];if(t)return t.id;this.usedHelpers[e]=!0;var r=this.get("helpersNamespace");if(r)return e=v.identifier(v.toIdentifier(e)),v.memberExpression(r,e);var a=_.template(e);a._compact=!0;var u=this.scope.generateUidIdentifier(e);return this.scope.push({key:e,id:u,init:a}),u},n.prototype.logDeopt=function(){},n.prototype.errorWithNode=function(e,n){var l=void 0===arguments[2]?SyntaxError:arguments[2],t=e.loc.start,r=new l("Line "+t.line+": "+n);return r.loc=t,r},n.prototype.addCode=function(e){return e=(e||"")+"",e=this.parseInputSourceMap(e),this.code=e,this.parseShebang(e)},n.prototype.parse=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(e){var n=this;e=this.addCode(e);var l=this.opts;return l.allowImportExportEverywhere=this.isLoose("es6.modules"),l.strictMode=this.transformers.strict.canRun(),g(l,e,function(e){return n.transform(e),n.generate()})}),n.prototype.transform=function(e){this.debug(),this.ast=e,this.lastStatements=v.getLastStatements(e.program),this.scope=new m(e.program,e,null,this);var n=this.moduleFormatter=this.getModuleFormatter(this.opts.modules);n.init&&this.transformers["es6.modules"].canRun()&&n.init(),this.checkNode(e),this.call("pre"),b(this.transformerStack,function(e){e.transform()}),this.call("post")},n.prototype.call=function(e){for(var n=this.transformerStack,l=0;l<n.length;l++){var t=n[l].transformer;t[e]&&t[e](this)}},n.prototype.checkNode=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(e,n){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.checkNode(e[t],n);else{var r=this.transformerStack;n||(n=this.scope),l(r,e,n),n.traverse(e,I,{stack:r})}}),n.prototype.mergeSourceMap=function(e){var n=this.opts,l=n.inputSourceMap;if(l){var t=new i.SourceMapConsumer(l),r=new i.SourceMapConsumer(e),a=i.SourceMapGenerator.fromSourceMap(r);a.applySourceMap(t);var u=a.toJSON();return u.sources=e.sources,u.file=e.file,u}return e},n.prototype.generate=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(){var e=this.opts,n=this.ast,l={code:"",map:null,ast:null};if(this.opts.returnUsedHelpers&&(l.usedHelpers=Object.keys(this.usedHelpers)),e.ast&&(l.ast=n),!e.code)return l;var t=p(n,e,this.code);return l.code=t.code,l.map=t.map,this.shebang&&(l.code=""+this.shebang+"\n"+l.code),l.map=this.mergeSourceMap(l.map),"inline"===e.sourceMap&&(l.code+="\n"+u.fromObject(l.map).toComment(),l.map=null),l}),n}();n.exports=w},{"../generation":15,"../helpers/parse":25,"../traversal/scope":119,"../types":122,"../util":124,"./index":42,"convert-source-map":176,"lodash/collection/each":202,"lodash/collection/includes":205,"lodash/lang/isFunction":293,"lodash/object/assign":301,"lodash/object/defaults":302,path:150,"shebang-regex":331,slash:332,"source-map":333}],29:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("./explode-assignable-expression")),r=l(e("../../types"));n.exports=function(e,n){var l=function(e){return e.operator===n.operator+"="},a=function(e,n){return r.assignmentExpression("=",e,n)};e.ExpressionStatement=function(e,u,o,s){if(!s.isConsequenceExpressionStatement(e)){var i=e.expression;if(l(i)){var c=[],p=t(i.left,c,s,o,!0);return c.push(r.expressionStatement(a(p.ref,n.build(p.uid,i.right)))),c}}},e.AssignmentExpression=function(e,u,o,s){if(l(e)){var i=[],c=t(e.left,i,s,o);return i.push(a(c.ref,n.build(c.uid,e.right))),r.toSequenceExpression(i,o)}},e.BinaryExpression=function(e){return e.operator===n.operator?n.build(e.left,e.right):void 0}}},{"../../types":122,"./explode-assignable-expression":34}],30:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("../../types"));n.exports=function r(e,n){var l=e.blocks.shift();if(l){var a=r(e,n);return a||(a=n(),e.filter&&(a=t.ifStatement(e.filter,t.blockStatement([a])))),t.forOfStatement(t.variableDeclaration("let",[t.variableDeclarator(l.left)]),l.right,t.blockStatement([a]))}}},{"../../types":122}],31:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("./explode-assignable-expression")),r=l(e("../../types"));n.exports=function(e,n){var l=function(e,n){return r.assignmentExpression("=",e,n)};e.ExpressionStatement=function(e,a,u,o){if(!o.isConsequenceExpressionStatement(e)){var s=e.expression;if(n.is(s,o)){var i=[],c=t(s.left,i,o,u);return i.push(r.ifStatement(n.build(c.uid,o),r.expressionStatement(l(c.ref,s.right)))),i}}},e.AssignmentExpression=function(e,a,u,o){if(n.is(e,o)){var s=[],i=t(e.left,s,o,u);return s.push(r.logicalExpression("&&",n.build(i.uid,o),l(i.ref,e.right))),s.push(i.ref),r.toSequenceExpression(s,u)}}}},{"../../types":122,"./explode-assignable-expression":34}],32:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("lodash/lang/isString")),a=l(e("../../messages")),u=t(e("esutils")),o=l(e("./react")),s=t(e("../../types"));n.exports=function(e,n){e.check=function(e){return s.isJSX(e)?!0:o.isCreateClass(e)?!0:!1},e.JSXIdentifier=function(e,n){return"this"===e.name&&s.isReferenced(e,n)?s.thisExpression():u.keyword.isIdentifierName(e.name)?void(e.type="Identifier"):s.literal(e.name)},e.JSXNamespacedName=function(e,n,l,t){throw t.errorWithNode(e,a.get("JSXNamespacedTags"))},e.JSXMemberExpression={exit:function(e){e.computed=s.isLiteral(e.property),e.type="MemberExpression"}},e.JSXExpressionContainer=function(e){return e.expression},e.JSXAttribute={enter:function(e){var n=e.value;s.isLiteral(n)&&r(n.value)&&(n.value=n.value.replace(/\n\s+/g," "))},exit:function(e){var n=e.value||s.literal(!0);return s.inherits(s.property("init",e.name,n),e)}},e.JSXOpeningElement={exit:function(e,t,r,a){var u,o=e.name,i=[];s.isIdentifier(o)?u=o.name:s.isLiteral(o)&&(u=o.value);var c={tagExpr:o,tagName:u,args:i};n.pre&&n.pre(c,a);var p=e.attributes;return p=p.length?l(p,a):s.literal(null),i.push(p),n.post&&n.post(c,a),c.call||s.callExpression(c.callee,i)}};var l=function(e,n){for(var l=[],t=[],r=function(){l.length&&(t.push(s.objectExpression(l)),l=[])};e.length;){var a=e.shift();s.isJSXSpreadAttribute(a)?(r(),t.push(a.argument)):l.push(a)}return r(),1===t.length?e=t[0]:(s.isObjectExpression(t[0])||t.unshift(s.objectExpression([])),e=s.callExpression(n.addHelper("extends"),t)),e};e.JSXElement={exit:function(e){for(var n=e.openingElement,l=0;l<e.children.length;l++){var t=e.children[l];s.isLiteral(t)&&"string"==typeof t.value?c(t,n.arguments):s.isJSXEmptyExpression(t)||n.arguments.push(t)}return n.arguments=i(n.arguments),n.arguments.length>=3&&(n._prettyCall=!0),s.inherits(n,e)}};var t=function(e){return s.isLiteral(e)&&r(e.value)},i=function(e){for(var n,l=[],r=0;r<e.length;r++){var a=e[r];t(a)&&t(n)?n.value+=a.value:(n=a,l.push(a))}return l},c=function(e,n){var l,t=e.value.split(/\r\n|\n|\r/),r=0;for(l=0;l<t.length;l++)t[l].match(/[^ \t]/)&&(r=l);for(l=0;l<t.length;l++){var a=t[l],u=0===l,o=l===t.length-1,i=l===r,c=a.replace(/\t/g," ");u||(c=c.replace(/^[ ]+/,"")),o||(c=c.replace(/[ ]+$/,"")),c&&(i||(c+=" "),n.push(s.literal(c)))}},p=function(e,n){for(var l=n.arguments[0].properties,t=!0,r=0;r<l.length;r++){var a=l[r];if(s.isIdentifier(a.key,{name:"displayName"})){t=!1;break}}t&&l.unshift(s.property("init",s.identifier("displayName"),s.literal(e)))};e.ExportDeclaration=function(e,n,l,t){e["default"]&&o.isCreateClass(e.declaration)&&p(t.opts.basename,e.declaration)},e.AssignmentExpression=e.Property=e.VariableDeclarator=function(e){var n,l;s.isAssignmentExpression(e)?(n=e.left,l=e.right):s.isProperty(e)?(n=e.key,l=e.value):s.isVariableDeclarator(e)&&(n=e.id,l=e.init),s.isMemberExpression(n)&&(n=n.property),s.isIdentifier(n)&&o.isCreateClass(l)&&p(n.name,l)}}},{"../../messages":26,"../../types":122,"./react":37,esutils:186,"lodash/lang/isString":299}],33:[function(e,n,l){"use strict";function t(e,n,l,t,r){var a;c.isIdentifier(n)?(a=n.name,t&&(a="computed:"+a)):a=c.isLiteral(n)?String(n.value):JSON.stringify(o.removeProperties(c.cloneDeep(n)));var u;u=i(e,a)?e[a]:{},e[a]=u,u._key=n,t&&(u._computed=!0),u[l]=r}function r(e){var n=c.objectExpression([]);return s(e,function(e){var l=c.objectExpression([]),t=c.property("init",e._key,l,e._computed);s(e,function(e,n){if("_"!==n[0]){var t=e;c.isMethodDefinition(e)&&(e=e.value);var r=c.property("init",c.identifier(n),e);c.inheritsComments(r,t),c.removeComments(t),l.properties.push(r)}}),n.properties.push(t)}),n}function a(e){var n=c.objectExpression([]);return s(e,function(e){var l=c.objectExpression([]),t=c.property("init",e._key,l,e._computed);e.value&&(e.writable=c.literal(!0)),e.configurable=c.literal(!0),e.enumerable=c.literal(!0),s(e,function(e,n){if("_"!==n[0]){e=c.clone(e);var t=e;c.isMethodDefinition(e)&&(e=e.value);var r=c.property("init",c.identifier(n),e);c.inheritsComments(r,t),c.removeComments(t),l.properties.push(r)}}),n.properties.push(t)}),n}var u=function(e){return e&&e.__esModule?e["default"]:e};l.push=t,l.toClassObject=r,l.toDefineObject=a;var o=(u(e("lodash/lang/cloneDeep")),u(e("../../traversal"))),s=u(e("lodash/collection/each")),i=u(e("lodash/object/has")),c=u(e("../../types"));l.__esModule=!0},{"../../traversal":117,"../../types":122,"lodash/collection/each":202,"lodash/lang/cloneDeep":288,"lodash/object/has":304}],34:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("../../types")),r=function(e,n,l,r){var a;if(t.isIdentifier(e)){if(r.hasBinding(e.name))return e;a=e}else{if(!t.isMemberExpression(e))throw new Error("We can't explode this node type "+e.type);if(a=e.object,t.isIdentifier(a)&&r.hasGlobal(a.name))return a}var u=r.generateUidBasedOnNode(a);return n.push(t.variableDeclaration("var",[t.variableDeclarator(u,a)])),u},a=function(e,n,l,r){var a=e.property,u=t.toComputedKey(e,a);if(t.isLiteral(u))return u;var o=r.generateUidBasedOnNode(a);return n.push(t.variableDeclaration("var",[t.variableDeclarator(o,a)])),o};n.exports=function(e,n,l,u,o){var s;s=t.isIdentifier(e)&&o?e:r(e,n,l,u);var i,c;if(t.isIdentifier(e))i=e,c=s;else{var p=a(e,n,l,u),d=e.computed||t.isLiteral(p);c=i=t.memberExpression(s,p,d)}return{uid:c,ref:i}}},{"../../types":122}],35:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("../../types"));n.exports=function(e){for(var n=0,l=0;l<e.params.length;l++)t.isAssignmentPattern(e.params[l])||(n=l+1);return n}},{"../../types":122}],36:[function(e,n,l){"use strict";function t(e,n,l){var t=f(e,n.name,l);return d(t,e,n,l)}function r(e,n,l){var t=c.toComputedKey(e,e.key);if(!c.isLiteral(t))return e;var r=c.toIdentifier(t.value),a=c.identifier(r),u=e.value,o=f(u,r,l);e.value=d(o,u,a,l)}function a(e,n,l){if(e.id)return e;var t;if(c.isProperty(n)&&"init"===n.kind&&!n.computed)t=n.key;else{if(!c.isVariableDeclarator(n))return e;t=n.id}if(!c.isIdentifier(t))return e;var r=c.toIdentifier(t.name);t=c.identifier(r);var a=f(e,r,l);return d(a,e,t,l)}var u=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e){return e&&e.__esModule?e["default"]:e};l.custom=t,l.property=r,l.bare=a;var s=o(e("./get-function-arity")),i=u(e("../../util")),c=o(e("../../types")),p={enter:function(e,n,l,t){if(this.isReferencedIdentifier({name:t.name})){var r=l.getBindingIdentifier(t.name);r===t.outerDeclar&&(t.selfReference=!0,this.stop())}}},d=function(e,n,l,t){if(e.selfReference){var r="property-method-assignment-wrapper";n.generator&&(r+="-generator");for(var a=i.template(r,{FUNCTION:n,FUNCTION_ID:l,FUNCTION_KEY:t.generateUidIdentifier(l.name),WRAPPER_KEY:t.generateUidIdentifier(l.name+"Wrapper")}),u=a.callee.body.body[0].declarations[0].init.params,o=0,c=s(n);c>o;o++)u.push(t.generateUidIdentifier("x"));return a}return n.id=l,n},f=function(e,n,l){var t={selfAssignment:!1,selfReference:!1,outerDeclar:l.getBindingIdentifier(n),references:[],name:n},r=null;return r?"param"===r.kind&&(t.selfReference=!0):l.traverse(e,p,t),t};l.__esModule=!0},{"../../types":122,"../../util":124,"./get-function-arity":35}],37:[function(e,n,l){"use strict";function t(e){if(!e||!u.isCallExpression(e))return!1;if(!o(e.callee))return!1;var n=e.arguments;if(1!==n.length)return!1;var l=n[0];return u.isObjectExpression(l)?!0:!1}function r(e){return e&&/^[a-z]|\-/.test(e)}var a=function(e){return e&&e.__esModule?e["default"]:e};l.isCreateClass=t,l.isCompatTag=r;{var u=a(e("../../types")),o=u.buildMatchMemberExpression("React.createClass");l.isReactComponent=u.buildMatchMemberExpression("React.Component")}l.__esModule=!0},{"../../types":122}],38:[function(e,n,l){"use strict";function t(e,n){return o.isLiteral(e)&&e.regex&&e.regex.flags.indexOf(n)>=0}function r(e){var n=e.regex.flags.split("");e.regex.flags.indexOf("u")<0||(u(n,"u"),e.regex.flags=n.join(""))}var a=function(e){return e&&e.__esModule?e["default"]:e};l.is=t,l.pullFlag=r;var u=a(e("lodash/array/pull")),o=a(e("../../types"));l.__esModule=!0},{"../../types":122,"lodash/array/pull":199}],39:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=l(e("../../types")),r={enter:function(e){t.isFunction(e)&&this.skip(),t.isAwaitExpression(e)&&(e.type="YieldExpression",e.all&&(e.all=!1,e.argument=t.callExpression(t.memberExpression(t.identifier("Promise"),t.identifier("all")),[e.argument])))}};n.exports=function(e,n,l){e.async=!1,e.generator=!0,l.traverse(e,r);var a=t.callExpression(n,[e]),u=e.id;if(e.id=null,t.isFunctionDeclaration(e)){var o=t.variableDeclaration("let",[t.variableDeclarator(u,a)]);return o._blockHoist=!0,o}return a}},{"../../types":122}],40:[function(e,n){"use strict";function l(e,n){return t(e,n)?i.isMemberExpression(n,{computed:!1})?!1:i.isCallExpression(n,{callee:e})?!1:!0:!1}function t(e,n){return i.isIdentifier(e,{name:"super"})&&i.isReferenced(e,n)}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}},u=function(e){if(Array.isArray(e)){for(var n=0,l=Array(e.length);n<e.length;n++)l[n]=e[n];return l}return Array.from(e)},o=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};n.exports=p;var s=a(e("../../messages")),i=r(e("../../types")),c={enter:function(e,n,l,t){var r=t.topLevel,a=t.self;if(i.isFunction(e)&&!i.isArrowFunctionExpression(e))return a.traverseLevel(e,!1),this.skip();if(i.isProperty(e,{method:!0})||i.isMethodDefinition(e))return this.skip();var u=r?i.thisExpression:a.getThisReference.bind(a),o=a.specHandle;return a.isLoose&&(o=a.looseHandle),o.call(a,u,e,n)}},p=function(){function e(n,l){o(this,e),this.topLevelThisReference=n.topLevelThisReference,this.methodNode=n.methodNode,this.superRef=n.superRef,this.isStatic=n.isStatic,this.hasSuper=!1,this.inClass=l,this.isLoose=n.isLoose,this.scope=n.scope,this.file=n.file,this.opts=n}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,n,l,t){return i.callExpression(this.file.addHelper("set"),[i.callExpression(i.memberExpression(i.identifier("Object"),i.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():i.memberExpression(this.getObjectRef(),i.identifier("prototype"))]),l?e:i.literal(e.name),n,t])},e.prototype.getSuperProperty=function(e,n,l){return i.callExpression(this.file.addHelper("get"),[i.callExpression(i.memberExpression(i.identifier("Object"),i.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():i.memberExpression(this.getObjectRef(),i.identifier("prototype"))]),n?e:i.literal(e.name),l])},e.prototype.replace=function(){this.traverseLevel(this.methodNode.value,!0)},e.prototype.traverseLevel=function(e,n){var l={self:this,topLevel:n};this.scope.traverse(e,c,l)},e.prototype.getThisReference=function(){if(this.topLevelThisReference)return this.topLevelThisReference;var e=this.topLevelThisReference=this.scope.generateUidIdentifier("this");return this.methodNode.value.body.body.unshift(i.variableDeclaration("var",[i.variableDeclarator(this.topLevelThisReference,i.thisExpression())])),e},e.prototype.getLooseSuperProperty=function(e,n){var l=this.methodNode,t=l.key,r=this.superRef||i.identifier("Function");return n.property===e?void 0:i.isCallExpression(n,{callee:e})?(n.arguments.unshift(i.thisExpression()),"constructor"===t.name?i.memberExpression(r,i.identifier("call")):(e=r,l["static"]||(e=i.memberExpression(e,i.identifier("prototype"))),e=i.memberExpression(e,t,l.computed),i.memberExpression(e,i.identifier("call")))):i.isMemberExpression(n)&&!l["static"]?i.memberExpression(r,i.identifier("prototype")):r},e.prototype.looseHandle=function(e,n,l){if(i.isIdentifier(n,{name:"super"}))return this.hasSuper=!0,this.getLooseSuperProperty(n,l);if(i.isCallExpression(n)){var t=n.callee;if(!i.isMemberExpression(t))return;if("super"!==t.object.name)return;this.hasSuper=!0,i.appendToMemberExpression(t,i.identifier("call")),n.arguments.unshift(e())}},e.prototype.specHandle=function(e,n,r){var a,o,c,p,d=this.methodNode;if(l(n,r))throw this.file.errorWithNode(n,s.get("classesIllegalBareSuper"));if(i.isCallExpression(n)){var f=n.callee;if(t(f,n)){if(a=d.key,o=d.computed,c=n.arguments,"constructor"!==d.key.name||!this.inClass){var h=d.key.name||"METHOD_NAME";throw this.file.errorWithNode(n,s.get("classesIllegalSuperCall",h))}}else i.isMemberExpression(f)&&t(f.object,f)&&(a=f.property,o=f.computed,c=n.arguments)}else if(i.isMemberExpression(n)&&t(n.object,n))a=n.property,o=n.computed;
else if(i.isAssignmentExpression(n)&&t(n.left.object,n.left)&&"set"===d.kind)return this.hasSuper=!0,this.setSuperProperty(n.left.property,n.right,n.left.computed,e());if(a){this.hasSuper=!0,p=e();var g=this.getSuperProperty(a,o,p);return c?1===c.length&&i.isSpreadElement(c[0])?i.callExpression(i.memberExpression(g,i.identifier("apply")),[p,c[0].argument]):i.callExpression(i.memberExpression(g,i.identifier("call")),[p].concat(u(c))):g}},e}();n.exports=p},{"../../messages":26,"../../types":122}],41:[function(e,n,l){"use strict";function t(e){var n=e.body[0];return u.isExpressionStatement(n)&&u.isLiteral(n.expression,{value:"use strict"})}function r(e,n){var l;t(e)&&(l=e.body.shift()),n(),l&&e.body.unshift(l)}var a=function(e){return e&&e.__esModule?e["default"]:e};l.has=t,l.wrap=r;var u=a(e("../../types"));l.__esModule=!0},{"../../types":122}],42:[function(e,n){"use strict";function l(e,n){var l=new o(n);return l.parse(e)}var t=function(e){return e&&e.__esModule?e["default"]:e};n.exports=l;var r=t(e("../helpers/normalize-ast")),a=t(e("./transformer")),u=t(e("../helpers/object")),o=t(e("./file")),s=t(e("lodash/collection/each"));l.fromAst=function(e,n,l){e=r(e);var t=new o(l);return t.addCode(n),t.transform(e),t.generate()},l._ensureTransformerNames=function(e,n){for(var t=[],r=0;r<n.length;r++){var a=n[r],u=l.deprecatedTransformerMap[a],o=l.aliasTransformerMap[a];if(o)t.push(o);else if(u)console.error("The transformer "+a+" has been renamed to "+u),n.push(u);else if(l.transformers[a])t.push(a);else{if(!l.namespaces[a])throw new ReferenceError("Unknown transformer "+a+" specified in "+e);t=t.concat(l.namespaces[a])}}return t},l.transformerNamespaces=u(),l.transformers=u(),l.namespaces=u(),l.deprecatedTransformerMap=e("./transformers/deprecated"),l.aliasTransformerMap=e("./transformers/aliases"),l.moduleFormatters=e("./modules");var i=t(e("./transformers"));s(i,function(e,n){var t=n.split(".")[0],r=l.namespaces,u=t;r[u]||(r[u]=[]),l.namespaces[t].push(n),l.transformerNamespaces[n]=t,l.transformers[n]=new a(n,e)})},{"../helpers/normalize-ast":23,"../helpers/object":24,"./file":28,"./modules":50,"./transformer":55,"./transformers":83,"./transformers/aliases":56,"./transformers/deprecated":57,"lodash/collection/each":202}],43:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e){return e&&e.__esModule?e:{"default":e}},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=t(e("../../messages")),u=l(e("lodash/object/extend")),o=l(e("../../helpers/object")),s=t(e("../../util")),i=l(e("../../types")),c={enter:function(e,n,l,t){if(i.isUpdateExpression(e)&&t.isLocalReference(e.argument,l)){this.skip();var r=i.assignmentExpression(e.operator[0]+"=",e.argument,i.literal(1)),a=t.remapExportAssignment(r);if(i.isExpressionStatement(n)||e.prefix)return a;var u=[];u.push(a);var o;return o="--"===e.operator?"+":"-",u.push(i.binaryExpression(o,e.argument,i.literal(1))),i.sequenceExpression(u)}return i.isAssignmentExpression(e)&&t.isLocalReference(e.left,l)?(this.skip(),t.remapExportAssignment(e)):void 0}},p={enter:function(e,n,l,t){i.isImportDeclaration(e)&&(t.hasLocalImports=!0,u(t.localImports,i.getBindingIdentifiers(e)),t.bumpImportOccurences(e))}},d={enter:function(e,n,l,t){var r=e&&e.declaration;i.isExportDeclaration(e)&&(t.hasLocalImports=!0,r&&i.isStatement(r)&&u(t.localExports,i.getBindingIdentifiers(r)),e["default"]||(t.hasNonDefaultExports=!0),e.source&&t.bumpImportOccurences(e))}},f=function(){function e(n){r(this,e),this.scope=n.scope,this.file=n,this.ids=o(),this.hasNonDefaultExports=!1,this.hasLocalExports=!1,this.hasLocalImports=!1,this.localImportOccurences=o(),this.localExports=o(),this.localImports=o(),this.getLocalExports(),this.getLocalImports(),this.remapAssignments()}return e.prototype.doDefaultExportInterop=function(e){return e["default"]&&!this.noInteropRequireExport&&!this.hasNonDefaultExports},e.prototype.bumpImportOccurences=function(e){var n=e.source.value,l=this.localImportOccurences,t=l,r=n;t[r]||(t[r]=0),l[n]+=e.specifiers.length},e.prototype.getLocalExports=function(){this.file.scope.traverse(this.file.ast,d,this)},e.prototype.getLocalImports=function(){this.file.scope.traverse(this.file.ast,p,this)},e.prototype.remapAssignments=function(){this.hasLocalImports&&this.file.scope.traverse(this.file.ast,c,this)},e.prototype.isLocalReference=function(e){var n=this.localImports;return i.isIdentifier(e)&&n[e.name]&&n[e.name]!==e},e.prototype.remapExportAssignment=function(e){return i.assignmentExpression("=",e.left,i.assignmentExpression(e.operator,i.memberExpression(i.identifier("exports"),e.left),e.right))},e.prototype.isLocalReference=function(e,n){var l=this.localExports,t=e.name;return i.isIdentifier(e)&&l[t]&&l[t]===n.getBindingIdentifier(t)},e.prototype.getModuleName=function(){var e=this.file.opts;if(e.moduleId)return e.moduleId;var n=e.filenameRelative,l="";if(e.moduleRoot&&(l=e.moduleRoot+"/"),!e.filenameRelative)return l+e.filename.replace(/^\//,"");if(e.sourceRoot){var t=new RegExp("^"+e.sourceRoot+"/?");n=n.replace(t,"")}return e.keepModuleIdExtensions||(n=n.replace(/\.(\w*?)$/,"")),l+=n,l=l.replace(/\\/g,"/")},e.prototype._pushStatement=function(e,n){return(i.isClass(e)||i.isFunction(e))&&e.id&&(n.push(i.toStatement(e)),e=e.id),e},e.prototype._hoistExport=function(e,n,l){return i.isFunctionDeclaration(e)&&(n._blockHoist=l||2),n},e.prototype.getExternalReference=function(e,n){var l=this.ids,t=e.source.value;return l[t]?l[t]:this.ids[t]=this._getExternalReference(e,n)},e.prototype.checkExportIdentifier=function(e){if(i.isIdentifier(e,{name:"__esModule"}))throw this.file.errorWithNode(e,a.get("modulesIllegalExportName",e.name))},e.prototype.exportSpecifier=function(e,n,l){if(n.source){var t=this.getExternalReference(n,l);i.isExportBatchSpecifier(e)?l.push(this.buildExportsWildcard(t,n)):(t=i.isSpecifierDefault(e)&&!this.noInteropRequireExport?i.callExpression(this.file.addHelper("interop-require"),[t]):i.memberExpression(t,i.getSpecifierId(e)),l.push(this.buildExportsAssignment(i.getSpecifierName(e),t,n)))}else l.push(this.buildExportsAssignment(i.getSpecifierName(e),e.id,n))},e.prototype.buildExportsWildcard=function(e){return i.expressionStatement(i.callExpression(this.file.addHelper("defaults"),[i.identifier("exports"),i.callExpression(this.file.addHelper("interop-require-wildcard"),[e])]))},e.prototype.buildExportsAssignment=function(e,n){return this.checkExportIdentifier(e),s.template("exports-assign",{VALUE:n,KEY:e},!0)},e.prototype.exportDeclaration=function(e,n){var l=e.declaration,t=l.id;e["default"]&&(t=i.identifier("default"));var r;if(i.isVariableDeclaration(l))for(var a=0;a<l.declarations.length;a++){var u=l.declarations[a];u.init=this.buildExportsAssignment(u.id,u.init,e).expression;var o=i.variableDeclaration(l.kind,[u]);0===a&&i.inherits(o,l),n.push(o)}else{var s=l;(i.isFunctionDeclaration(l)||i.isClassDeclaration(l))&&(s=l.id,n.push(l)),r=this.buildExportsAssignment(t,s,e),n.push(r),this._hoistExport(l,r)}},e}();n.exports=f},{"../../helpers/object":24,"../../messages":26,"../../types":122,"../../util":124,"lodash/object/extend":303}],44:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=l(e("../../util"));n.exports=function(e){var n=function(){this.noInteropRequireImport=!0,this.noInteropRequireExport=!0,e.apply(this,arguments)};return t.inherits(n,e),n}},{"../../util":124}],45:[function(e,n){"use strict";n.exports=e("./_strict")(e("./amd"))},{"./_strict":44,"./amd":46}],46:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(e.__proto__=n)},a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},u=t(e("./_default")),o=t(e("./common")),s=t(e("lodash/collection/includes")),i=t(e("lodash/object/values")),c=(l(e("../../util")),t(e("../../types"))),p=function(e){function n(){this.init=o.prototype.init,a(this,n),null!=e&&e.apply(this,arguments)}return r(n,e),n.prototype.buildDependencyLiterals=function(){var e=[];for(var n in this.ids)e.push(c.literal(n));return e},n.prototype.transform=function(e){var n=e.body,l=[c.literal("exports")];this.passModuleArg&&l.push(c.literal("module")),l=l.concat(this.buildDependencyLiterals()),l=c.arrayExpression(l);var t=i(this.ids);this.passModuleArg&&t.unshift(c.identifier("module")),t.unshift(c.identifier("exports"));var r=c.functionExpression(null,t,c.blockStatement(n)),a=[l,r],u=this.getModuleName();u&&a.unshift(c.literal(u));var o=c.callExpression(c.identifier("define"),a);e.body=[c.expressionStatement(o)]},n.prototype.getModuleName=function(){return this.file.opts.moduleIds?e.prototype.getModuleName.apply(this,arguments):null},n.prototype._getExternalReference=function(e){return this.scope.generateUidIdentifier(e.source.value)},n.prototype.importDeclaration=function(e){this.getExternalReference(e)},n.prototype.importSpecifier=function(e,n,l){var t=c.getSpecifierName(e),r=this.getExternalReference(n);s(this.file.dynamicImportedNoDefault,n)?this.ids[n.source.value]=r:c.isImportBatchSpecifier(e)||(r=s(this.file.dynamicImported,n)||!c.isSpecifierDefault(e)||this.noInteropRequireImport?c.memberExpression(r,c.getSpecifierId(e),!1):c.callExpression(this.file.addHelper("interop-require"),[r])),l.push(c.variableDeclaration("var",[c.variableDeclarator(t,r)]))},n.prototype.exportDeclaration=function(e){this.doDefaultExportInterop(e)&&(this.passModuleArg=!0),o.prototype.exportDeclaration.apply(this,arguments)},n}(u);n.exports=p},{"../../types":122,"../../util":124,"./_default":43,"./common":48,"lodash/collection/includes":205,"lodash/object/values":307}],47:[function(e,n){"use strict";n.exports=e("./_strict")(e("./common"))},{"./_strict":44,"./common":48}],48:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(e.__proto__=n)},a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},u=t(e("./_default")),o=t(e("lodash/collection/includes")),s=l(e("../../util")),i=t(e("../../types")),c=function(e){function n(){a(this,n),null!=e&&e.apply(this,arguments)}return r(n,e),n.prototype.init=function(){var e=this.file,n=e.scope;if(n.rename("module"),!this.noInteropRequireImport&&this.hasNonDefaultExports){var l="exports-module-declaration";this.file.isLoose("es6.modules")&&(l+="-loose"),e.ast.program.body.push(s.template(l,!0))}},n.prototype.importSpecifier=function(e,n,l){var t=i.getSpecifierName(e),r=this.getExternalReference(n,l);i.isSpecifierDefault(e)?(o(this.file.dynamicImportedNoDefault,n)||(r=this.noInteropRequireImport||o(this.file.dynamicImported,n)?i.memberExpression(r,i.identifier("default")):i.callExpression(this.file.addHelper("interop-require"),[r])),l.push(i.variableDeclaration("var",[i.variableDeclarator(t,r)]))):"ImportBatchSpecifier"===e.type?(this.noInteropRequireImport||(r=i.callExpression(this.file.addHelper("interop-require-wildcard"),[r])),l.push(i.variableDeclaration("var",[i.variableDeclarator(t,r)]))):l.push(i.variableDeclaration("var",[i.variableDeclarator(t,i.memberExpression(r,i.getSpecifierId(e)))]))},n.prototype.importDeclaration=function(e,n){n.push(s.template("require",{MODULE_NAME:e.source},!0))},n.prototype.exportDeclaration=function(n,l){if(this.doDefaultExportInterop(n)){var t=n.declaration,r=s.template("exports-default-assign",{VALUE:this._pushStatement(t,l)},!0);return i.isFunctionDeclaration(t)&&(r._blockHoist=3),void l.push(r)}e.prototype.exportDeclaration.apply(this,arguments)},n.prototype._getExternalReference=function(e,n){var l=e.source.value,t=i.callExpression(i.identifier("require"),[e.source]);if(this.localImportOccurences[l]>1){var r=this.scope.generateUidIdentifier(l);return n.push(i.variableDeclaration("var",[i.variableDeclarator(r,t)])),r}return t},n}(u);n.exports=c},{"../../types":122,"../../util":124,"./_default":43,"lodash/collection/includes":205}],49:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("../../types")),a=function(){function e(){t(this,e)}return e.prototype.exportDeclaration=function(e,n){var l=r.toStatement(e.declaration,!0);l&&n.push(r.inherits(l,e))},e.prototype.importDeclaration=function(){},e.prototype.importSpecifier=function(){},e.prototype.exportSpecifier=function(){},e}();n.exports=a},{"../../types":122}],50:[function(e,n){"use strict";n.exports={commonStrict:e("./common-strict"),amdStrict:e("./amd-strict"),umdStrict:e("./umd-strict"),common:e("./common"),system:e("./system"),ignore:e("./ignore"),amd:e("./amd"),umd:e("./umd")}},{"./amd":46,"./amd-strict":45,"./common":48,"./common-strict":47,"./ignore":49,"./system":51,"./umd":53,"./umd-strict":52}],51:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(e.__proto__=n)},a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},u=t(e("./_default")),o=t(e("./amd")),s=l(e("../../util")),i=t(e("lodash/array/last")),c=t(e("lodash/collection/each")),p=t(e("lodash/collection/map")),d=t(e("../../types")),f={enter:function(e,n,l,t){if(d.isFunction(e))return this.skip();if(d.isVariableDeclaration(e)){if("var"!==e.kind&&!d.isProgram(n))return;if(e._blockHoist)return;for(var r=[],a=0;a<e.declarations.length;a++){var u=e.declarations[a];if(t.push(d.variableDeclarator(u.id)),u.init){var o=d.expressionStatement(d.assignmentExpression("=",u.id,u.init));r.push(o)}}if(d.isFor(n)){if(n.left===e)return e.declarations[0].id;if(n.init===e)return d.toSequenceExpression(r,l)}return r}}},h={enter:function(e,n,l,t){d.isFunction(e)&&this.skip(),(d.isFunctionDeclaration(e)||e._blockHoist)&&(t.push(e),this.remove())}},g={enter:function(e,n,l,t){e._importSource===t.source&&(d.isVariableDeclaration(e)?c(e.declarations,function(e){t.hoistDeclarators.push(d.variableDeclarator(e.id)),t.nodes.push(d.expressionStatement(d.assignmentExpression("=",e.id,e.init)))}):t.nodes.push(e),this.remove())}},m=function(e){function n(e){a(this,n),this.exportIdentifier=e.scope.generateUidIdentifier("export"),this.noInteropRequireExport=!0,this.noInteropRequireImport=!0,u.apply(this,arguments)}return r(n,e),n.prototype.init=function(){},n.prototype._addImportSource=function(e,n){return e._importSource=n.source&&n.source.value,e},n.prototype.buildExportsWildcard=function(e,n){var l=this.scope.generateUidIdentifier("key"),t=d.memberExpression(e,l,!0),r=d.variableDeclaration("var",[d.variableDeclarator(l)]),a=e,u=d.blockStatement([d.expressionStatement(this.buildExportCall(l,t))]);return this._addImportSource(d.forInStatement(r,a,u),n)},n.prototype.buildExportsAssignment=function(e,n,l){var t=this.buildExportCall(d.literal(e.name),n,!0);return this._addImportSource(t,l)},n.prototype.remapExportAssignment=function(e){return this.buildExportCall(d.literal(e.left.name),e)},n.prototype.buildExportCall=function(e,n,l){var t=d.callExpression(this.exportIdentifier,[e,n]);return l?d.expressionStatement(t):t},n.prototype.importSpecifier=function(n,l,t){e.prototype.importSpecifier.apply(this,arguments),this._addImportSource(i(t),l)},n.prototype.buildRunnerSetters=function(e,n){var l=this.file.scope;return d.arrayExpression(p(this.ids,function(t,r){var a={hoistDeclarators:n,source:r,nodes:[]};return l.traverse(e,g,a),d.functionExpression(null,[t],d.blockStatement(a.nodes))}))},n.prototype.transform=function(e){var n=[],l=this.getModuleName(),t=d.literal(l),r=d.blockStatement(e.body),a=s.template("system",{MODULE_DEPENDENCIES:d.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,MODULE_NAME:t,SETTERS:this.buildRunnerSetters(r,n),EXECUTE:d.functionExpression(null,[],r)},!0),u=a.expression.arguments[2].body.body;l||a.expression.arguments.shift();var o=u.pop();if(this.file.scope.traverse(r,f,n),n.length){var i=d.variableDeclaration("var",n);i._blockHoist=!0,u.unshift(i)}this.file.scope.traverse(r,h,u),u.push(o),e.body=[a]},n}(o);n.exports=m},{"../../types":122,"../../util":124,"./_default":43,"./amd":46,"lodash/array/last":198,"lodash/collection/each":202,"lodash/collection/map":206}],52:[function(e,n){"use strict";n.exports=e("./_strict")(e("./umd"))},{"./_strict":44,"./umd":53}],53:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(e.__proto__=n)},a=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},u=t(e("./amd")),o=t(e("lodash/object/values")),s=l(e("../../util")),i=t(e("../../types")),c=function(e){function n(){a(this,n),null!=e&&e.apply(this,arguments)}return r(n,e),n.prototype.transform=function(e){var n=e.body,l=[];for(var t in this.ids)l.push(i.literal(t));var r=o(this.ids),a=[i.identifier("exports")];this.passModuleArg&&a.push(i.identifier("module")),a=a.concat(r);var u=i.functionExpression(null,a,i.blockStatement(n)),c=[i.literal("exports")];this.passModuleArg&&c.push(i.literal("module")),c=c.concat(l),c=[i.arrayExpression(c)];var p=s.template("test-exports"),d=s.template("test-module"),f=this.passModuleArg?i.logicalExpression("&&",p,d):p,h=[i.identifier("exports")];this.passModuleArg&&h.push(i.identifier("module")),h=h.concat(l.map(function(e){return i.callExpression(i.identifier("require"),[e])}));var g=this.getModuleName();g&&c.unshift(i.literal(g));var m=s.template("umd-runner-body",{AMD_ARGUMENTS:c,COMMON_TEST:f,COMMON_ARGUMENTS:h}),y=i.callExpression(m,[u]);e.body=[i.expressionStatement(y)]},n}(u);n.exports=c},{"../../types":122,"../../util":124,"./amd":46,"lodash/object/values":307}],54:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("lodash/collection/includes")),a=function(){function e(n,l){t(this,e),this.transformer=l,this.shouldRun=!l.check,this.handlers=l.handlers,this.file=n}return e.prototype.canRun=function(){var e=this.transformer,n=this.file.opts,l=e.key;if("_"===l[0])return!0;var t=n.blacklist;if(t.length&&r(t,l))return!1;var a=n.whitelist;return a.length?r(a,l):e.optional&&!r(n.optional,l)?!1:e.experimental&&!n.experimental?!1:e.playground&&!n.playground?!1:!0},e.prototype.checkNode=function(e){var n=this.transformer.check;return n?this.shouldRun=n(e):!0},e.prototype.transform=function(){if(this.shouldRun){var e=this.file;e.debug("Running transformer "+this.transformer.key),e.scope.traverse(e.ast,this.handlers,e)}},e}();n.exports=a},{"lodash/collection/includes":205}],55:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("./transformer-pass")),a=l(e("lodash/lang/isFunction")),u=l(e("../traversal")),o=l(e("lodash/lang/isObject")),s=l(e("lodash/object/assign")),i=l(e("lodash/collection/each")),c=function(){function e(n,l){t(this,e),l=s({},l);var r=function(e){var n=l[e];return delete l[e],n};this.manipulateOptions=r("manipulateOptions"),this.check=r("check"),this.post=r("post"),this.pre=r("pre"),this.experimental=!!r("experimental"),this.playground=!!r("playground"),this.secondPass=!!r("secondPass"),this.optional=!!r("optional"),this.handlers=this.normalize(l);var a=this;a.opts||(a.opts={}),this.key=n}return e.prototype.normalize=function(e){var n=this;return a(e)&&(e={ast:e}),u.explode(e),i(e,function(l,t){return"_"===t[0]?void(n[t]=l):void("enter"!==t&&"exit"!==t&&(a(l)&&(l={enter:l}),o(l)&&(l.enter||(l.enter=function(){}),l.exit||(l.exit=function(){}),e[t]=l)))}),e},e.prototype.buildPass=function(e){return new r(e,this)},e}();n.exports=c},{"../traversal":117,"./transformer-pass":54,"lodash/collection/each":202,"lodash/lang/isFunction":293,"lodash/lang/isObject":296,"lodash/object/assign":301}],56:[function(e,n){n.exports={useStrict:"strict"}},{}],57:[function(e,n){n.exports={selfContained:"runtime","unicode-regex":"regex.unicode","minification.deadCodeElimination":"utility.deadCodeElimination","minification.removeConsoleCalls":"utility.removeConsole","minification.removeDebugger":"utility.removeDebugger"}},{}],58:[function(e,n,l){"use strict";function t(e){var n=e.property;e.computed&&a.isLiteral(n)&&a.isValidIdentifier(n.value)?(e.property=a.identifier(n.value),e.computed=!1):e.computed||!a.isIdentifier(n)||a.isValidIdentifier(n.name)||(e.property=a.literal(n.name),e.computed=!0)}var r=function(e){return e&&e.__esModule?e["default"]:e};l.MemberExpression=t;var a=r(e("../../../types"));l.__esModule=!0},{"../../../types":122}],59:[function(e,n,l){"use strict";function t(e){var n=e.key;a.isLiteral(n)&&a.isValidIdentifier(n.value)?(e.key=a.identifier(n.value),e.computed=!1):e.computed||!a.isIdentifier(n)||a.isValidIdentifier(n.name)||(e.key=a.literal(n.name))}var r=function(e){return e&&e.__esModule?e["default"]:e};l.Property=t;var a=r(e("../../../types"));l.__esModule=!0},{"../../../types":122}],60:[function(e,n,l){"use strict";function t(e){return s.isProperty(e)&&("get"===e.kind||"set"===e.kind)}function r(e){var n={},l=!1;return e.properties=e.properties.filter(function(e){return"get"===e.kind||"set"===e.kind?(l=!0,o.push(n,e.key,e.kind,e.computed,e.value),!1):!0}),l?s.callExpression(s.memberExpression(s.identifier("Object"),s.identifier("defineProperties")),[e,o.toDefineObject(n)]):void 0}var a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e){return e&&e.__esModule?e:{"default":e}};l.check=t,l.ObjectExpression=r;var o=u(e("../../helpers/define-map")),s=a(e("../../../types"));l.__esModule=!0},{"../../../types":122,"../../helpers/define-map":33}],61:[function(e,n,l){"use strict";function t(e){return a.ensureBlock(e),e._aliasFunction="arrow",e.expression=!1,e.type="FunctionExpression",e}var r=function(e){return e&&e.__esModule?e["default"]:e};l.ArrowFunctionExpression=t;{var a=r(e("../../../types"));l.check=a.isArrowFunctionExpression}l.__esModule=!0},{"../../../types":122}],62:[function(e,n,l){"use strict";function t(e,n,l,t){var r=e._letReferences;r&&l.traverse(e,u,{letRefs:r,file:t})}var r=function(e){return e&&e.__esModule?e["default"]:e};l.BlockStatement=t;{var a=r(e("../../../types")),u={enter:function(e,n,l,t){if(this.isReferencedIdentifier()){var r=t.letRefs[e.name];if(r&&l.getBindingIdentifier(e.name)===r){var u=a.callExpression(t.file.addHelper("temporal-assert-defined"),[e,a.literal(e.name),t.file.addHelper("temporal-undefined")]);return this.skip(),a.isAssignmentExpression(n)||a.isUpdateExpression(n)?void(n._ignoreBlockScopingTDZ||(this.parentPath.node=a.sequenceExpression([u,n]))):a.logicalExpression("&&",u,e)}}}};l.optional=!0}l.Program=t,l.Loop=t,l.__esModule=!0},{"../../../types":122}],63:[function(e,n,l){"use strict";function t(e,n){if(!x.isVariableDeclaration(e))return!1;if(e._let)return!0;if("let"!==e.kind)return!1;if(r(e,n))for(var l=0;l<e.declarations.length;l++){var t=e.declarations[l],a=t;a.init||(a.init=x.identifier("undefined"))}return e._let=!0,e.kind="var",!0}function r(e,n){return!x.isFor(n)||!x.isFor(n,{left:e})}function a(e,n){return x.isVariableDeclaration(e,{kind:"var"})&&!t(e,n)}function u(e){for(var n=0;n<e.length;n++)delete e[n]._let}function o(e){return x.isVariableDeclaration(e)&&("let"===e.kind||"const"===e.kind)}function s(e,n,l,a){if(t(e,n)&&r(e)&&a.transformers["es6.blockScopingTDZ"].canRun()){for(var u=[e],o=0;o<e.declarations.length;o++){var s=e.declarations[o];if(s.init){var i=x.assignmentExpression("=",s.id,s.init);i._ignoreBlockScopingTDZ=!0,u.push(x.expressionStatement(i))}s.init=a.addHelper("temporal-undefined")}return e._blockHoist=2,u}}function i(e,n,l,r){var a=e.left||e.init;t(a,e)&&(x.ensureBlock(e),e.body._letDeclarators=[a]);var u=new A(e,e.body,n,l,r);u.run()}function c(e,n,l,t){if(!x.isLoop(n)){var r=new A(!1,e,n,l,t);r.run()}}function p(e,n,l,t){if(x.isReferencedIdentifier(e,n)){var r=t[e.name];if(r){var a=l.getBindingIdentifier(e.name);a===r.binding?e.name=r.uid:this&&this.skip()}}}function d(e,n,l,t){p(e,n,l,t),l.traverse(e,I,t)}var f=function(e){return e&&e.__esModule?e:{"default":e}},h=function(e){return e&&e.__esModule?e["default"]:e},g=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};l.check=o,l.VariableDeclaration=s,l.Loop=i,l.BlockStatement=c;var m=h(e("../../../traversal")),y=h(e("../../../helpers/object")),_=f(e("../../../util")),x=h(e("../../../types")),b=h(e("lodash/object/values")),v=h(e("lodash/object/extend"));l.Program=c;var I={enter:p},w={enter:function(e,n,l,t){return this.isFunction()?(l.traverse(e,E,t),this.skip()):void 0}},E={enter:function(e,n,l,t){this.isReferencedIdentifier()&&(l.hasOwnBinding(e.name)||t.letReferences[e.name]&&(t.closurify=!0))}},k={enter:function(e,n,l,t){if(this.isForStatement())a(e.init,e)&&(e.init=x.sequenceExpression(t.pushDeclar(e.init)));else if(this.isFor())a(e.left,e)&&(e.left=e.left.declarations[0].id);else{if(a(e,n))return t.pushDeclar(e).map(x.expressionStatement);if(this.isFunction())return this.skip()}}},R={enter:function(e,n,l,t){this.isLabeledStatement()&&t.innerLabels.push(e.label.name)}},S=function(e){return x.isBreakStatement(e)?"break":x.isContinueStatement(e)?"continue":void 0},C={enter:function(e,n,l,t){var r;if(this.isLoop()&&(t.ignoreLabeless=!0,l.traverse(e,C,t),t.ignoreLabeless=!1),this.isFunction()||this.isLoop())return this.skip();var a=S(e);if(a){if(e.label){if(t.innerLabels.indexOf(e.label.name)>=0)return;a=""+a+"|"+e.label.name}else{if(t.ignoreLabeless)return;if(x.isBreakStatement(e)&&x.isSwitchCase(n))return}t.hasBreakContinue=!0,t.map[a]=e,r=x.literal(a)}return this.isReturnStatement()&&(t.hasReturn=!0,r=x.objectExpression([x.property("init",x.identifier("v"),e.argument||x.identifier("undefined"))])),r?(r=x.returnStatement(r),x.inherits(r,e)):void 0}},A=function(){function e(n,l,t,r,a){g(this,e),this.loopParent=n,this.parent=t,this.scope=r,this.block=l,this.file=a,this.outsideLetReferences=y(),this.hasLetReferences=!1,this.letReferences=l._letReferences=y(),this.body=[]}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var n=this.getLetReferences();x.isFunction(this.parent)||x.isProgram(this.block)||this.hasLetReferences&&(n?this.wrapClosure():this.remap())}},e.prototype.remap=function(){var e=!1,n=this.letReferences,l=this.scope,t=y();for(var r in n){var a=n[r];if(l.parentHasBinding(r)||l.hasGlobal(r)){var u=l.generateUidIdentifier(a.name).name;a.name=u,e=!0,t[r]=t[u]={binding:a,uid:u}}}if(e){var o=this.loopParent;o&&(d(o.right,o,l,t),d(o.test,o,l,t),d(o.update,o,l,t)),l.traverse(this.block,I,t)}},e.prototype.wrapClosure=function(){var e=this.block,n=this.outsideLetReferences;if(this.loopParent)for(var l in n){var t=n[l];(this.scope.hasGlobal(t.name)||this.scope.parentHasBinding(t.name))&&(delete n[t.name],delete this.letReferences[t.name],this.scope.rename(t.name),this.letReferences[t.name]=t,n[t.name]=t)}this.has=this.checkLoop(),this.hoistVarDeclarations();var r=b(n),a=x.functionExpression(null,r,x.blockStatement(e.body));a._aliasFunction=!0,e.body=this.body;var u=x.callExpression(a,r),o=this.scope.generateUidIdentifier("ret"),s=m.hasType(a.body,this.scope,"YieldExpression",x.FUNCTION_TYPES);s&&(a.generator=!0,u=x.yieldExpression(u,!0));var i=m.hasType(a.body,this.scope,"AwaitExpression",x.FUNCTION_TYPES);i&&(a.async=!0,u=x.awaitExpression(u,!0)),this.build(o,u)},e.prototype.getLetReferences=function(){for(var e,n=this.block,l=n._letDeclarators||[],r=0;r<l.length;r++)e=l[r],v(this.outsideLetReferences,x.getBindingIdentifiers(e));if(n.body)for(r=0;r<n.body.length;r++)e=n.body[r],t(e,n)&&(l=l.concat(e.declarations));for(r=0;r<l.length;r++){e=l[r];var a=x.getBindingIdentifiers(e);v(this.letReferences,a),this.hasLetReferences=!0}if(this.hasLetReferences){u(l);var o={letReferences:this.letReferences,closurify:!1};return this.scope.traverse(this.block,w,o),o.closurify}},e.prototype.checkLoop=function(){var e={hasBreakContinue:!1,ignoreLabeless:!1,innerLabels:[],hasReturn:!1,isLoop:!!this.loopParent,map:{}};return this.scope.traverse(this.block,R,e),this.scope.traverse(this.block,C,e),e},e.prototype.hoistVarDeclarations=function(){m(this.block,k,this.scope,this)},e.prototype.pushDeclar=function(e){this.body.push(x.variableDeclaration(e.kind,e.declarations.map(function(e){return x.variableDeclarator(e.id)})));for(var n=[],l=0;l<e.declarations.length;l++){var t=e.declarations[l];if(t.init){var r=x.assignmentExpression("=",t.id,t.init);n.push(x.inherits(r,t))}}return n},e.prototype.build=function(e,n){var l=this.has;l.hasReturn||l.hasBreakContinue?this.buildHas(e,n):this.body.push(x.expressionStatement(n))},e.prototype.buildHas=function(e,n){var l=this.body;l.push(x.variableDeclaration("var",[x.variableDeclarator(e,n)]));var t,r=this.loopParent,a=this.has,u=[];if(a.hasReturn&&(t=_.template("let-scoping-return",{RETURN:e})),a.hasBreakContinue){if(!r)throw new Error("Has no loop parent but we're trying to reassign breaks and continues, something is going wrong here.");for(var o in a.map)u.push(x.switchCase(x.literal(o),[a.map[o]]));if(a.hasReturn&&u.push(x.switchCase(null,[t])),1===u.length){var s=u[0];l.push(this.file.attachAuxiliaryComment(x.ifStatement(x.binaryExpression("===",e,s.test),s.consequent[0])))}else l.push(this.file.attachAuxiliaryComment(x.switchStatement(e,u)))}else a.hasReturn&&l.push(this.file.attachAuxiliaryComment(t))},e}();l.__esModule=!0},{"../../../helpers/object":24,"../../../traversal":117,"../../../types":122,"../../../util":124,"lodash/object/extend":303,"lodash/object/values":307}],64:[function(e,n,l){"use strict";function t(e){return h.variableDeclaration("let",[h.variableDeclarator(e.id,h.toExpression(e))])}function r(e,n,l,t){return new g(e,n,l,t).run()}var a=function(e){return e&&e.__esModule?e:{"default":e}},u=function(e){return e&&e.__esModule?e["default"]:e},o=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};l.ClassDeclaration=t,l.ClassExpression=r;var s=u(e("../../helpers/replace-supers")),i=a(e("../../helpers/name-method")),c=a(e("../../helpers/define-map")),p=a(e("../../../messages")),d=a(e("../../../util")),f=u(e("../../../traversal")),h=u(e("../../../types")),g=(l.check=h.isClass,f.explode({MethodDefinition:{enter:function(){this.skip()}},Property:{enter:function(e){e.method&&this.skip()}},CallExpression:{enter:function(e,n,l,t){if(h.isIdentifier(e.callee,{name:"super"})&&(t.hasBareSuper=!0,!t.hasSuper))throw t.file.errorWithNode(e,"super call is only allowed in derived constructor")}},ThisExpression:{enter:function(e,n,l,t){if(t.hasSuper&&!t.hasBareSuper)throw t.file.errorWithNode(e,"'this' is not allowed before super()")}}}),function(){function e(n,l,t,r){o(this,e),this.parent=l,this.scope=t,this.node=n,this.file=r,this.hasInstanceMutators=!1,this.hasStaticMutators=!1,this.instanceMutatorMap={},this.staticMutatorMap={},this.hasConstructor=!1,this.className=n.id,this.classRef=n.id||t.generateUidIdentifier("class"),this.superName=n.superClass||h.identifier("Function"),this.hasSuper=!!n.superClass,this.isLoose=r.isLoose("es6.classes")
}return e.prototype.run=function(){var e,n=this.superName,l=(this.className,this.node.body.body,this.classRef),t=this.file,r=this.body=[],a=h.blockStatement([h.expressionStatement(h.callExpression(t.addHelper("class-call-check"),[h.thisExpression(),l]))]);this.className?(e=h.functionDeclaration(this.className,[],a),r.push(e)):e=h.functionExpression(null,[],a),this.constructor=e;var u=[],o=[];if(this.hasSuper&&(o.push(n),n=this.scope.generateUidBasedOnNode(n,this.file),u.push(n),this.superName=n,r.push(h.expressionStatement(h.callExpression(t.addHelper("inherits"),[l,n])))),this.buildBody(),this.className){if(1===r.length)return h.toExpression(r[0])}else e=i.bare(e,this.parent,this.scope),r.unshift(h.variableDeclaration("var",[h.variableDeclarator(l,e)])),h.inheritsComments(r[0],this.node);return r.push(h.returnStatement(l)),h.callExpression(h.functionExpression(null,u,h.blockStatement(r)),o)},e.prototype.buildBody=function(){for(var e=this.constructor,n=this.className,l=this.superName,t=this.node.body.body,r=this.body,a=0;a<t.length;a++){var u=t[a];if(h.isMethodDefinition(u)){var o=!u.computed&&h.isIdentifier(u.key,{name:"constructor"})||h.isLiteral(u.key,{value:"constructor"});o&&this.verifyConstructor(u);var i=new s({methodNode:u,objectRef:this.classRef,superRef:this.superName,isStatic:u["static"],isLoose:this.isLoose,scope:this.scope,file:this.file},!0);i.replace(),o?this.pushConstructor(u):this.pushMethod(u)}else h.isPrivateDeclaration(u)?(this.closure=!0,r.unshift(u)):h.isClassProperty(u)&&this.pushProperty(u)}if(!this.hasConstructor&&this.hasSuper&&h.evaluateTruthy(l,this.scope)!==!1){var p="class-super-constructor-call";this.isLoose&&(p+="-loose"),e.body.body.push(d.template(p,{CLASS_NAME:n,SUPER_NAME:this.superName},!0))}var f,g;if(this.hasInstanceMutators&&(f=c.toClassObject(this.instanceMutatorMap)),this.hasStaticMutators&&(g=c.toClassObject(this.staticMutatorMap)),f||g){f||(f=h.literal(null));var m=[this.classRef,f];g&&m.push(g),r.push(h.expressionStatement(h.callExpression(this.file.addHelper("create-class"),m)))}},e.prototype.verifyConstructor=function(e){return},e.prototype.pushMethod=function(e){var n=e.key,l=e.kind;if(""===l){if(i.property(e,this.file,this.scope),this.isLoose){var t=this.classRef;e["static"]||(t=h.memberExpression(t,h.identifier("prototype"))),n=h.memberExpression(t,n,e.computed);var r=h.expressionStatement(h.assignmentExpression("=",n,e.value));return h.inheritsComments(r,e),void this.body.push(r)}l="value"}var a=this.instanceMutatorMap;e["static"]?(this.hasStaticMutators=!0,a=this.staticMutatorMap):this.hasInstanceMutators=!0,c.push(a,n,l,e.computed,e)},e.prototype.pushProperty=function(e){if(e.value){var n;e["static"]?(n=h.memberExpression(this.classRef,e.key),this.body.push(h.expressionStatement(h.assignmentExpression("=",n,e.value)))):(n=h.memberExpression(h.thisExpression(),e.key),this.constructor.body.body.unshift(h.expressionStatement(h.assignmentExpression("=",n,e.value))))}},e.prototype.pushConstructor=function(e){if(e.kind)throw this.file.errorWithNode(e,p.get("classesIllegalConstructorKind"));var n=this.constructor,l=e.value;this.hasConstructor=!0,h.inherits(n,l),h.inheritsComments(n,e),n._ignoreUserWhitespace=!0,n.params=l.params,h.inherits(n.body,l.body),n.body.body=n.body.body.concat(l.body.body)},e}());l.__esModule=!0},{"../../../messages":26,"../../../traversal":117,"../../../types":122,"../../../util":124,"../../helpers/define-map":33,"../../helpers/name-method":36,"../../helpers/replace-supers":40}],65:[function(e,n,l){"use strict";function t(e){return i.isVariableDeclaration(e,{kind:"const"})}function r(e,n,l,t){l.traverse(e,c,{constants:l.getAllBindingsOfKind("const"),file:t})}function a(e){"const"===e.kind&&(e.kind="let")}var u=function(e){return e&&e.__esModule?e["default"]:e},o=function(e){return e&&e.__esModule?e:{"default":e}};l.check=t,l.Scopable=r,l.VariableDeclaration=a;var s=o(e("../../../messages")),i=u(e("../../../types")),c={enter:function(e,n,l,t){if(this.isAssignmentExpression()||this.isUpdateExpression()){var r=this.getBindingIdentifiers();for(var a in r){var u=r[a],o=t.constants[a];if(o){var i=o.identifier;if(u!==i&&l.bindingIdentifierEquals(a,i))throw t.file.errorWithNode(u,s.get("readOnly",a))}}}else this.isScope()&&this.skip()}};l.__esModule=!0},{"../../../messages":26,"../../../types":122}],66:[function(e,n,l){"use strict";function t(e,n,l,t){var r=e.left;if(f.isPattern(r)){var a=l.generateUidIdentifier("ref");return e.left=f.variableDeclaration("var",[f.variableDeclarator(a)]),f.ensureBlock(e),void e.body.body.unshift(f.variableDeclaration("var",[f.variableDeclarator(r,a)]))}if(f.isVariableDeclaration(r)){var u=r.declarations[0].id;if(f.isPattern(u)){var o=l.generateUidIdentifier("ref");e.left=f.variableDeclaration(r.kind,[f.variableDeclarator(o,null)]);var s=[],i=new g({kind:r.kind,file:t,scope:l,nodes:s});i.init(u,o),f.ensureBlock(e);var c=e.body;c.body=s.concat(c.body)}}}function r(e,n,l,t){var r=e.param;if(f.isPattern(r)){var a=l.generateUidIdentifier("ref");e.param=a;var u=[],o=new g({kind:"let",file:t,scope:l,nodes:u});return o.init(r,a),e.body.body=u.concat(e.body.body),e}}function a(e,n,l,t){var r=e.expression;if("AssignmentExpression"===r.type&&f.isPattern(r.left)&&!t.isConsequenceExpressionStatement(e)){var a=[],u=l.generateUidIdentifier("ref");a.push(f.variableDeclaration("var",[f.variableDeclarator(u,r.right)]));var o=new g({operator:r.operator,file:t,scope:l,nodes:a});return o.init(r.left,u),a}}function u(e,n,l,t){if(f.isPattern(e.left)){var r=l.generateUidIdentifier("temp");l.push({key:r.name,id:r});var a=[];a.push(f.assignmentExpression("=",r,e.right));var u=new g({operator:e.operator,file:t,scope:l,nodes:a});return u.init(e.left,r),a.push(r),f.toSequenceExpression(a,l)}}function o(e){for(var n=0;n<e.declarations.length;n++)if(f.isPattern(e.declarations[n].id))return!0;return!1}function s(e,n,l,t){if(!f.isForInStatement(n)&&!f.isForOfStatement(n)&&o(e)){for(var r,a=[],u=0;u<e.declarations.length;u++){r=e.declarations[u];var s=r.init,i=r.id,c=new g({nodes:a,scope:l,kind:e.kind,file:t});f.isPattern(i)&&s?(c.init(i,s),+u!==e.declarations.length-1&&f.inherits(a[a.length-1],r)):a.push(f.inherits(c.buildVariableAssignment(r.id,r.init),r))}if(!f.isProgram(n)&&!f.isBlockStatement(n)){for(r=null,u=0;u<a.length;u++){if(e=a[u],r||(r=f.variableDeclaration(e.kind,[])),!f.isVariableDeclaration(e)&&r.kind!==e.kind)throw t.errorWithNode(e,d.get("invalidParentForThisNode"));r.declarations=r.declarations.concat(e.declarations)}return r}return a}}var i=function(e){return e&&e.__esModule?e["default"]:e},c=function(e){return e&&e.__esModule?e:{"default":e}},p=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")};l.ForOfStatement=t,l.CatchClause=r,l.ExpressionStatement=a,l.AssignmentExpression=u,l.VariableDeclaration=s;{var d=c(e("../../../messages")),f=i(e("../../../types"));l.check=f.isPattern}l.ForInStatement=t,l.Function=function(e,n,l,t){var r=[],a=!1;if(e.params=e.params.map(function(n,u){if(!f.isPattern(n))return n;a=!0;var o=l.generateUidIdentifier("ref"),s=new g({blockHoist:e.params.length-u,nodes:r,scope:l,file:t,kind:"let"});return s.init(n,o),o}),a){t.checkNode(r),f.ensureBlock(e);var u=e.body;u.body=r.concat(u.body)}};var h=function(e){for(var n=0;n<e.elements.length;n++)if(f.isRestElement(e.elements[n]))return!0;return!1},g=function(){function e(n){p(this,e),this.blockHoist=n.blockHoist,this.operator=n.operator,this.nodes=n.nodes,this.scope=n.scope,this.file=n.file,this.kind=n.kind}return e.prototype.buildVariableAssignment=function(e,n){var l=this.operator;f.isMemberExpression(e)&&(l="=");var t;return t=l?f.expressionStatement(f.assignmentExpression(l,e,n)):f.variableDeclaration(this.kind,[f.variableDeclarator(e,n)]),t._blockHoist=this.blockHoist,t},e.prototype.buildVariableDeclaration=function(e,n){var l=f.variableDeclaration("var",[f.variableDeclarator(e,n)]);return l._blockHoist=this.blockHoist,l},e.prototype.push=function(e,n){f.isObjectPattern(e)?this.pushObjectPattern(e,n):f.isArrayPattern(e)?this.pushArrayPattern(e,n):f.isAssignmentPattern(e)?this.pushAssignmentPattern(e,n):this.nodes.push(this.buildVariableAssignment(e,n))},e.prototype.pushAssignmentPattern=function(e,n){var l=this.scope.generateUidBasedOnNode(n),t=f.variableDeclaration("var",[f.variableDeclarator(l,n)]);t._blockHoist=this.blockHoist,this.nodes.push(t),this.nodes.push(this.buildVariableAssignment(e.left,f.conditionalExpression(f.binaryExpression("===",l,f.identifier("undefined")),e.right,l)))},e.prototype.pushObjectSpread=function(e,n,l,t){for(var r=[],a=0;a<e.properties.length;a++){var u=e.properties[a];if(a>=t)break;if(!f.isSpreadProperty(u)){var o=u.key;f.isIdentifier(o)&&(o=f.literal(u.key.name)),r.push(o)}}r=f.arrayExpression(r);var s=f.callExpression(this.file.addHelper("object-without-properties"),[n,r]);this.nodes.push(this.buildVariableAssignment(l.argument,s))},e.prototype.pushObjectProperty=function(e,n){f.isLiteral(e.key)&&(e.computed=!0);var l=e.value,t=f.memberExpression(n,e.key,e.computed);f.isPattern(l)?this.push(l,t):this.nodes.push(this.buildVariableAssignment(l,t))},e.prototype.pushObjectPattern=function(e,n){if(e.properties.length||this.nodes.push(f.expressionStatement(f.callExpression(this.file.addHelper("object-destructuring-empty"),[n]))),e.properties.length>1&&f.isMemberExpression(n)){var l=this.scope.generateUidBasedOnNode(n,this.file);this.nodes.push(this.buildVariableDeclaration(l,n)),n=l}for(var t=0;t<e.properties.length;t++){var r=e.properties[t];f.isSpreadProperty(r)?this.pushObjectSpread(e,n,r,t):this.pushObjectProperty(r,n)}},e.prototype.canUnpackArrayPattern=function(e,n){if(!f.isArrayExpression(n))return!1;if(!(e.elements.length>n.elements.length)){if(e.elements.length<n.elements.length&&!h(e))return!1;for(var l=0;l<e.elements.length;l++)if(!e.elements[l])return!1;return!0}},e.prototype.pushUnpackedArrayPattern=function(e,n){for(var l=0;l<e.elements.length;l++){var t=e.elements[l];f.isRestElement(t)?this.push(t.argument,f.arrayExpression(n.elements.slice(l))):this.push(t,n.elements[l])}},e.prototype.pushArrayPattern=function(e,n){if(e.elements){if(this.canUnpackArrayPattern(e,n))return this.pushUnpackedArrayPattern(e,n);var l=!h(e)&&e.elements.length,t=this.scope.toArray(n,l);f.isIdentifier(t)?n=t:(n=this.scope.generateUidBasedOnNode(n),this.nodes.push(this.buildVariableDeclaration(n,t)),this.scope.assignTypeGeneric(n.name,"Array"));for(var r=0;r<e.elements.length;r++){var a=e.elements[r];if(a){var u;f.isRestElement(a)?(u=this.scope.toArray(n),r>0&&(u=f.callExpression(f.memberExpression(u,f.identifier("slice")),[f.literal(r)])),a=a.argument):u=f.memberExpression(n,f.literal(r),!0),this.push(a,u)}}}},e.prototype.init=function(e,n){if(!f.isArrayExpression(n)&&!f.isMemberExpression(n)&&!f.isIdentifier(n)){var l=this.scope.generateUidBasedOnNode(n);this.nodes.push(this.buildVariableDeclaration(l,n)),n=l}this.push(e,n)},e}();l.__esModule=!0},{"../../../messages":26,"../../../types":122}],67:[function(e,n,l){"use strict";function t(e,n,l,t){var r=p;t.isLoose("es6.forOf")&&(r=c);var a=r(e,n,l,t),u=a.declar,o=a.loop,i=o.body;return s.inheritsComments(o,e),s.ensureBlock(e),u&&i.body.push(u),i.body=i.body.concat(e.body.body),s.inherits(o,e),o._scopeInfo=e._scopeInfo,a.replaceParent?void(this.parentPath.node=a.node):a.node}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}};l.ForOfStatement=t;var u=a(e("../../../messages")),o=a(e("../../../util")),s=r(e("../../../types")),i=(l.check=s.isForOfStatement,{enter:function(e,n,l,t){if(this.isLoop())return t.ignoreLabeless=!0,l.traverse(e,i,t),t.ignoreLabeless=!1,this.skip();if(this.isBreakStatement()){if(!e.label&&t.ignoreLabeless)return;if(e.label&&e.label.name!==t.label)return;var r=s.expressionStatement(s.callExpression(s.memberExpression(t.iteratorKey,s.identifier("return")),[]));return r=t.wrapReturn(r),this.skip(),[r,e]}}}),c=function(e,n,l,t){var r,a,c=e.left;if(s.isIdentifier(c)||s.isPattern(c)||s.isMemberExpression(c))a=c;else{if(!s.isVariableDeclaration(c))throw t.errorWithNode(c,u.get("unknownForHead",c.type));a=l.generateUidIdentifier("ref"),r=s.variableDeclaration(c.kind,[s.variableDeclarator(c.declarations[0].id,a)])}var p=l.generateUidIdentifier("iterator"),d=l.generateUidIdentifier("isArray"),f=o.template("for-of-loose",{LOOP_OBJECT:p,IS_ARRAY:d,OBJECT:e.right,INDEX:l.generateUidIdentifier("i"),ID:a});return r||f.body.body.shift(),l.traverse(e,i,{iteratorKey:p,label:s.isLabeledStatement(n)&&n.label.name,wrapReturn:function(e){return s.ifStatement(s.logicalExpression("&&",s.unaryExpression("!",d,!0),s.memberExpression(p,s.identifier("return"))),e)}}),{declar:r,node:f,loop:f}},p=function(e,n,l,t){var r,a=e.left,c=l.generateUidIdentifier("step"),p=s.memberExpression(c,s.identifier("value"));if(s.isIdentifier(a)||s.isPattern(a)||s.isMemberExpression(a))r=s.expressionStatement(s.assignmentExpression("=",a,p));else{if(!s.isVariableDeclaration(a))throw t.errorWithNode(a,u.get("unknownForHead",a.type));r=s.variableDeclaration(a.kind,[s.variableDeclarator(a.declarations[0].id,p)])}var d=l.generateUidIdentifier("iterator"),f=o.template("for-of",{ITERATOR_HAD_ERROR_KEY:l.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:l.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:l.generateUidIdentifier("iteratorError"),ITERATOR_KEY:d,STEP_KEY:c,OBJECT:e.right,BODY:null}),h=s.isLabeledStatement(n),g=f[3].block.body,m=g[0];return h&&(g[0]=s.labeledStatement(n.label,m)),l.traverse(e,i,{iteratorKey:d,label:h&&n.label.name,wrapReturn:function(e){return s.ifStatement(s.memberExpression(d,s.identifier("return")),e)}}),{replaceParent:h,declar:r,loop:m,node:f}};l.__esModule=!0},{"../../../messages":26,"../../../types":122,"../../../util":124}],68:[function(e,n,l){"use strict";function t(e,n,l,t){if(!e.isType){var r=[];if(e.specifiers.length)for(var a=0;a<e.specifiers.length;a++)t.moduleFormatter.importSpecifier(e.specifiers[a],e,r,n);else t.moduleFormatter.importDeclaration(e,r,n);return 1===r.length&&(r[0]._blockHoist=e._blockHoist),r}}function r(e,n,l,t){if(!u.isTypeAlias(e.declaration)){var r,a=[];if(e.declaration){if(u.isVariableDeclaration(e.declaration)){var o=e.declaration.declarations[0];o.init=o.init||u.identifier("undefined")}t.moduleFormatter.exportDeclaration(e,a,n)}else if(e.specifiers)for(r=0;r<e.specifiers.length;r++)t.moduleFormatter.exportSpecifier(e.specifiers[r],e,a,n);if(e._blockHoist)for(r=0;r<a.length;r++)a[r]._blockHoist=e._blockHoist;return a}}var a=function(e){return e&&e.__esModule?e["default"]:e};l.ImportDeclaration=t,l.ExportDeclaration=r;var u=a(e("../../../types"));l.check=e("../internal/modules").check,l.__esModule=!0},{"../../../types":122,"../internal/modules":89}],69:[function(e,n,l){"use strict";function t(e){return s.isIdentifier(e,{name:"super"})}function r(e,n,l,t){if(e.method){var r=e.value,a=n.generateUidIdentifier("this"),u=new o({topLevelThisReference:a,getObjectRef:l,methodNode:e,isStatic:!0,scope:n,file:t});u.replace(),u.hasSuper&&r.body.body.unshift(s.variableDeclaration("var",[s.variableDeclarator(a,s.thisExpression())]))}}function a(e,n,l,t){for(var a,u=function(){return!a&&(a=l.generateUidIdentifier("obj")),a},o=0;o<e.properties.length;o++)r(e.properties[o],l,u,t);return a?(l.push({id:a}),s.assignmentExpression("=",a,e)):void 0}var u=function(e){return e&&e.__esModule?e["default"]:e};l.check=t,l.ObjectExpression=a;var o=u(e("../../helpers/replace-supers")),s=u(e("../../../types"));l.__esModule=!0},{"../../../types":122,"../../helpers/replace-supers":40}],70:[function(e,n,l){"use strict";function t(e){return o.isFunction(e)&&s(e)}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}};l.check=t;var u=a(e("../../../util")),o=r(e("../../../types")),s=function(e){for(var n=0;n<e.params.length;n++)if(!o.isIdentifier(e.params[n]))return!0;return!1},i={enter:function(e,n,l,t){this.isReferencedIdentifier()&&t.scope.hasOwnBinding(e.name)&&(t.scope.bindingIdentifierEquals(e.name,e)||(t.iife=!0,this.stop()))}};l.Function=function(e,n,l,t){if(s(e)){o.ensureBlock(e);var r=[],a=o.identifier("arguments");a._ignoreAliasFunctions=!0;for(var c=0,p={iife:!1,scope:l},d=function(n,l,s){var i=u.template("default-parameter",{VARIABLE_NAME:n,DEFAULT_VALUE:l,ARGUMENT_KEY:o.literal(s),ARGUMENTS:a},!0);t.checkNode(i),i._blockHoist=e.params.length-s,r.push(i)},f=0;f<e.params.length;f++){var h=e.params[f];if(o.isAssignmentPattern(h)){var g=h.left,m=h.right,y=l.generateUidIdentifier("x");y._isDefaultPlaceholder=!0,e.params[f]=y,p.iife||(o.isIdentifier(m)&&l.hasOwnBinding(m.name)?p.iife=!0:l.traverse(m,i,p)),d(g,m,f)}else o.isRestElement(h)||(c=f+1),o.isIdentifier(h)||l.traverse(h,i,p),t.transformers["es6.blockScopingTDZ"].canRun()&&o.isIdentifier(h)&&d(h,o.identifier("undefined"),f)}if(e.params=e.params.slice(0,c),p.iife){var _=o.functionExpression(null,[],e.body,e.generator);_._aliasFunction=!0,r.push(o.returnStatement(o.callExpression(_,[]))),e.body=o.blockStatement(r)}else e.body.body=r.concat(e.body.body)}},l.__esModule=!0},{"../../../types":122,"../../../util":124}],71:[function(e,n,l){"use strict";function t(e,n){var l,t=e.property;s.isLiteral(t)?(t.value+=n,t.raw=String(t.value)):(l=s.binaryExpression("+",t,s.literal(n)),e.property=l)}var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e},u=a(e("lodash/lang/isNumber")),o=r(e("../../../util")),s=a(e("../../../types")),i=(l.check=s.isRestElement,{enter:function(e,n,l,t){if(this.isScope()&&!l.bindingIdentifierEquals(t.name,t.outerBinding))return this.skip();if(this.isFunctionDeclaration()||this.isFunctionExpression())return t.noOptimise=!0,l.traverse(e,i,t),t.noOptimise=!1,this.skip();if(this.isReferencedIdentifier({name:t.name})){if(!t.noOptimise&&s.isMemberExpression(n)&&n.computed){var r=n.property;if(u(r.value)||s.isUnaryExpression(r)||s.isBinaryExpression(r))return void t.candidates.push(this)}t.canOptimise=!1,this.stop()}}}),c=function(e){return s.isRestElement(e.params[e.params.length-1])};l.Function=function(e,n,l,r){if(c(e)){var a=e.params.pop().argument,u=s.identifier("arguments");if(u._ignoreAliasFunctions=!0,s.isPattern(a)){var p=a;a=l.generateUidIdentifier("ref");var d=s.variableDeclaration("let",p.elements.map(function(e,n){var l=s.memberExpression(a,s.literal(n),!0);return s.variableDeclarator(e,l)}));r.checkNode(d),e.body.body.unshift(d)}var f={outerBinding:l.getBindingIdentifier(a.name),canOptimise:!0,candidates:[],method:e,name:a.name};if(l.traverse(e,i,f),f.canOptimise&&f.candidates.length)for(var h=0;h<f.candidates.length;h++){var g=f.candidates[h];g.node=u,t(g.parent,e.params.length)}else{var m=s.literal(e.params.length),y=l.generateUidIdentifier("key"),_=l.generateUidIdentifier("len"),x=y,b=_;e.params.length&&(x=s.binaryExpression("-",y,m),b=s.conditionalExpression(s.binaryExpression(">",_,m),s.binaryExpression("-",_,m),s.literal(0))),l.assignTypeGeneric(a.name,"Array");var v=o.template("rest",{ARGUMENTS:u,ARRAY_KEY:x,ARRAY_LEN:b,START:m,ARRAY:a,KEY:y,LEN:_});v._blockHoist=e.params.length+1,e.body.body.unshift(v)}}},l.__esModule=!0},{"../../../types":122,"../../../util":124,"lodash/lang/isNumber":295}],72:[function(e,n,l){"use strict";function t(e,n,l){for(var t=0;t<e.properties.length;t++){var r=e.properties[t];n.push(s.expressionStatement(s.assignmentExpression("=",s.memberExpression(l,r.key,r.computed||s.isLiteral(r.key)),r.value)))}}function r(e,n,l,t,r){for(var a,u,o=e.properties,i=0;i<o.length;i++)a=o[i],"init"===a.kind&&(u=a.key,!a.computed&&s.isIdentifier(u)&&(a.key=s.literal(u.name)));var c=!1;for(i=0;i<o.length;i++)a=o[i],a.computed&&(c=!0),("init"!==a.kind||!c||s.isLiteral(s.toComputedKey(a,a.key),{value:"__proto__"}))&&(t.push(a),o[i]=null);for(i=0;i<o.length;i++)if(a=o[i]){u=a.key;var p;p=a.computed&&s.isMemberExpression(u)&&s.isIdentifier(u.object,{name:"Symbol"})?s.assignmentExpression("=",s.memberExpression(l,u,!0),a.value):s.callExpression(r.addHelper("define-property"),[l,u,a.value]),n.push(s.expressionStatement(p))}if(1===n.length){var d=n[0].expression;if(s.isCallExpression(d))return d.arguments[0]=s.objectExpression(t),d}}function a(e){return s.isProperty(e)&&e.computed}function u(e,n,l,a){for(var u=!1,o=0;o<e.properties.length&&!(u=s.isProperty(e.properties[o],{computed:!0,kind:"init"}));o++);if(u){var i=[],c=l.generateUidBasedOnNode(n),p=[],d=s.functionExpression(null,[],s.blockStatement(p));d._aliasFunction=!0;var f=r;a.isLoose("es6.properties.computed")&&(f=t);var h=f(e,p,c,i,a);return h?h:(p.unshift(s.variableDeclaration("var",[s.variableDeclarator(c,s.objectExpression(i))])),p.push(s.returnStatement(c)),s.callExpression(d,[]))}}var o=function(e){return e&&e.__esModule?e["default"]:e};l.check=a,l.ObjectExpression=u;var s=o(e("../../../types"));l.__esModule=!0},{"../../../types":122}],73:[function(e,n,l){"use strict";function t(e){return u.isProperty(e)&&(e.method||e.shorthand)}function r(e){e.method&&(e.method=!1),e.shorthand&&(e.shorthand=!1,e.key=u.removeComments(u.clone(e.key)))}var a=function(e){return e&&e.__esModule?e["default"]:e};l.check=t,l.Property=r;var u=a(e("../../../types"));l.__esModule=!0},{"../../../types":122}],74:[function(e,n,l){"use strict";function t(e){return o.is(e,"y")}function r(e){return o.is(e,"y")?s.newExpression(s.identifier("RegExp"),[s.literal(e.regex.pattern),s.literal(e.regex.flags)]):void 0}var a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e){return e&&e.__esModule?e:{"default":e}};l.check=t,l.Literal=r;var o=u(e("../../helpers/regex")),s=a(e("../../../types"));l.__esModule=!0},{"../../../types":122,"../../helpers/regex":38}],75:[function(e,n,l){"use strict";function t(e){return s.is(e,"u")}function r(e){s.is(e,"u")&&(s.pullFlag(e,"y"),e.regex.pattern=o(e.regex.pattern,e.regex.flags))}var a=function(e){return e&&e.__esModule?e:{"default":e}},u=function(e){return e&&e.__esModule?e["default"]:e};l.check=t,l.Literal=r;var o=u(e("regexpu/rewrite-pattern")),s=a(e("../../helpers/regex"));l.__esModule=!0},{"../../helpers/regex":38,"regexpu/rewrite-pattern":328}],76:[function(e,n,l){"use strict";function t(e,n){return n.toArray(e.argument,!0)}function r(e){for(var n=0;n<e.length;n++)if(p.isSpreadElement(e[n]))return!0;return!1}function a(e,n){for(var l=[],r=[],a=function(){r.length&&(l.push(p.arrayExpression(r)),r=[])},u=0;u<e.length;u++){var o=e[u];p.isSpreadElement(o)?(a(),l.push(t(o,n))):r.push(o)}return a(),l}function u(e,n,l){var t=e.elements;if(r(t)){var u=a(t,l),o=u.shift();return p.isArrayExpression(o)||(u.unshift(o),o=p.arrayExpression([])),p.callExpression(p.memberExpression(o,p.identifier("concat")),u)}}function o(e,n,l){var t=e.arguments;if(r(t)){var u=p.identifier("undefined");e.arguments=[];var o;o=1===t.length&&"arguments"===t[0].argument.name?[t[0].argument]:a(t,l);var s=o.shift();e.arguments.push(o.length?p.callExpression(p.memberExpression(s,p.identifier("concat")),o):s);var i=e.callee;if(p.isMemberExpression(i)){var c=l.generateTempBasedOnNode(i.object);c?(i.object=p.assignmentExpression("=",c,i.object),u=c):u=i.object,p.appendToMemberExpression(i,p.identifier("apply"))}else e.callee=p.memberExpression(e.callee,p.identifier("apply"));e.arguments.unshift(u)}}function s(e,n,l,t){var u=e.arguments;if(r(u)){var o=p.isIdentifier(e.callee)&&c(p.NATIVE_TYPE_NAMES,e.callee.name),s=a(u,l);o&&s.unshift(p.arrayExpression([p.literal(null)]));var i=s.shift();return u=s.length?p.callExpression(p.memberExpression(i,p.identifier("concat")),s):i,o?p.newExpression(p.callExpression(p.memberExpression(t.addHelper("bind"),p.identifier("apply")),[e.callee,u]),[]):p.callExpression(t.addHelper("apply-constructor"),[e.callee,u])}}var i=function(e){return e&&e.__esModule?e["default"]:e};l.ArrayExpression=u,l.CallExpression=o,l.NewExpression=s;{var c=i(e("lodash/collection/includes")),p=i(e("../../../types"));l.check=p.isSpreadElement}l.__esModule=!0},{"../../../types":122,"lodash/collection/includes":205}],77:[function(e,n,l){"use strict";function t(e){return d.blockStatement([d.returnStatement(e)])}var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},o=a(e("lodash/collection/reduceRight")),s=r(e("../../../messages")),i=a(e("lodash/array/flatten")),c=r(e("../../../util")),p=a(e("lodash/collection/map")),d=a(e("../../../types"));l.Function=function(e,n,l,t){var r=new m(e,l,t);r.run()};var f={enter:function(e,n,l,t){if(this.isIfStatement())d.isReturnStatement(e.alternate)&&d.ensureBlock(e,"alternate"),d.isReturnStatement(e.consequent)&&d.ensureBlock(e,"consequent");else{if(this.isReturnStatement())return this.skip(),t.subTransform(e.argument);d.isTryStatement(n)?e===n.block?this.skip():n.finalizer&&e!==n.finalizer&&this.skip():this.isFunction()?this.skip():this.isVariableDeclaration()&&(this.skip(),t.vars.push(e))}}},h={enter:function(e,n,l,t){return this.isThisExpression()?(t.needsThis=!0,t.getThisId()):this.isReferencedIdentifier({name:"arguments"})?(t.needsArguments=!0,t.getArgumentsId()):this.isFunction()&&(this.skip(),this.isFunctionDeclaration())?(e=d.variableDeclaration("var",[d.variableDeclarator(e.id,d.toExpression(e))]),e._blockHoist=2,e):void 0}},g={enter:function(e,n,l,t){if(this.isExpressionStatement()){var r=e.expression;if(d.isAssignmentExpression(r))if(t.needsThis||r.left!==t.getThisId()){if(!t.needsArguments&&r.left===t.getArgumentsId()&&d.isArrayExpression(r.right))return p(r.right.elements,function(e){return d.expressionStatement(e)})}else this.remove()}}},m=function(){function e(n,l,t){u(this,e),this.hasTailRecursion=!1,this.needsArguments=!1,this.setsArguments=!1,this.needsThis=!1,this.ownerId=n.id,this.vars=[],this.scope=l,this.file=t,this.node=n}return e.prototype.getArgumentsId=function(){var e;return e=this,!e.argumentsId&&(e.argumentsId=this.scope.generateUidIdentifier("arguments")),e.argumentsId},e.prototype.getThisId=function(){var e;return e=this,!e.thisId&&(e.thisId=this.scope.generateUidIdentifier("this")),e.thisId},e.prototype.getLeftId=function(){var e;return e=this,!e.leftId&&(e.leftId=this.scope.generateUidIdentifier("left")),e.leftId},e.prototype.getFunctionId=function(){var e;return e=this,!e.functionId&&(e.functionId=this.scope.generateUidIdentifier("function")),e.functionId},e.prototype.getAgainId=function(){var e;return e=this,!e.againId&&(e.againId=this.scope.generateUidIdentifier("again")),e.againId},e.prototype.getParams=function(){var e=this.params;if(!e){e=this.node.params,this.paramDecls=[];for(var n=0;n<e.length;n++){var l=e[n];l._isDefaultPlaceholder||this.paramDecls.push(d.variableDeclarator(l,e[n]=this.scope.generateUidIdentifier("x")))}}return this.params=e},e.prototype.hasDeopt=function(){var e=this.scope.getBindingInfo(this.ownerId.name);return e&&e.reassigned},e.prototype.run=function(){var e=this.scope,n=this.node,l=this.ownerId;if(l&&(e.traverse(n,f,this),this.hasTailRecursion)){if(this.hasDeopt())return void this.file.logDeopt(n,s.get("tailCallReassignmentDeopt"));e.traverse(n,h,this),this.needsThis&&this.needsArguments||e.traverse(n,g,this);var t=d.ensureBlock(n).body;if(this.vars.length>0){var r=i(p(this.vars,function(e){return e.declarations},this)),a=o(r,function(e,n){return d.assignmentExpression("=",n.id,e)},d.identifier("undefined"));t.unshift(d.expressionStatement(a))}var u=this.paramDecls;u.length>0&&t.unshift(d.variableDeclaration("var",u)),t.unshift(d.expressionStatement(d.assignmentExpression("=",this.getAgainId(),d.literal(!1)))),n.body=c.template("tail-call-body",{AGAIN_ID:this.getAgainId(),THIS_ID:this.thisId,ARGUMENTS_ID:this.argumentsId,FUNCTION_ID:this.getFunctionId(),BLOCK:n.body});var m=[];if(this.needsThis&&m.push(d.variableDeclarator(this.getThisId(),d.thisExpression())),this.needsArguments||this.setsArguments){var y=d.variableDeclarator(this.getArgumentsId());this.needsArguments&&(y.init=d.identifier("arguments")),m.push(y)}var _=this.leftId;_&&m.push(d.variableDeclarator(_)),m.length>0&&n.body.body.unshift(d.variableDeclaration("var",m))}},e.prototype.subTransform=function(e){if(e){var n=this["subTransform"+e.type];return n?n.call(this,e):void 0}},e.prototype.subTransformConditionalExpression=function(e){var n=this.subTransform(e.consequent),l=this.subTransform(e.alternate);return n||l?(e.type="IfStatement",e.consequent=n?d.toBlock(n):t(e.consequent),e.alternate=l?d.isIfStatement(l)?l:d.toBlock(l):t(e.alternate),[e]):void 0},e.prototype.subTransformLogicalExpression=function(e){var n=this.subTransform(e.right);if(n){var l=this.getLeftId(),r=d.assignmentExpression("=",l,e.left);return"&&"===e.operator&&(r=d.unaryExpression("!",r)),[d.ifStatement(r,t(l))].concat(n)}},e.prototype.subTransformSequenceExpression=function(e){var n=e.expressions,l=this.subTransform(n[n.length-1]);return l?(1===--n.length&&(e=n[0]),[d.expressionStatement(e)].concat(l)):void 0},e.prototype.subTransformCallExpression=function(e){var n,l,t=e.callee;if(d.isMemberExpression(t,{computed:!1})&&d.isIdentifier(t.property)){switch(t.property.name){case"call":l=d.arrayExpression(e.arguments.slice(1));break;case"apply":l=e.arguments[1]||d.identifier("undefined");break;default:return}n=e.arguments[0],t=t.object}if(d.isIdentifier(t)&&this.scope.bindingIdentifierEquals(t.name,this.ownerId)&&(this.hasTailRecursion=!0,!this.hasDeopt())){var r=[];d.isThisExpression(n)||r.push(d.expressionStatement(d.assignmentExpression("=",this.getThisId(),n||d.identifier("undefined")))),l||(l=d.arrayExpression(e.arguments));var a=this.getArgumentsId(),u=this.getParams();r.push(d.expressionStatement(d.assignmentExpression("=",a,l)));var o,s;if(d.isArrayExpression(l)){var i=l.elements;for(o=0;o<i.length&&o<u.length;o++){s=u[o];var c=i[o]||(i[o]=d.identifier("undefined"));s._isDefaultPlaceholder||(i[o]=d.assignmentExpression("=",s,c))}}else for(this.setsArguments=!0,o=0;o<u.length;o++)s=u[o],s._isDefaultPlaceholder||r.push(d.expressionStatement(d.assignmentExpression("=",s,d.memberExpression(a,d.literal(o),!0))));return r.push(d.expressionStatement(d.assignmentExpression("=",this.getAgainId(),d.literal(!0)))),r.push(d.continueStatement(this.getFunctionId())),r}},e}()},{"../../../messages":26,"../../../types":122,"../../../util":124,"lodash/array/flatten":197,"lodash/collection/map":206,"lodash/collection/reduceRight":207}],78:[function(e,n,l){"use strict";function t(e){return o.isTemplateLiteral(e)||o.isTaggedTemplateExpression(e)}function r(e,n,l,t){for(var r=[],a=e.quasi,u=[],s=[],i=0;i<a.quasis.length;i++){var c=a.quasis[i];u.push(o.literal(c.value.cooked)),s.push(o.literal(c.value.raw))}u=o.arrayExpression(u),s=o.arrayExpression(s);var p="tagged-template-literal";return t.isLoose("es6.templateLiterals")&&(p+="-loose"),r.push(o.callExpression(t.addHelper(p),[u,s])),r=r.concat(a.expressions),o.callExpression(e.tag,r)}function a(e){var n,l=[];for(n=0;n<e.quasis.length;n++){var t=e.quasis[n];l.push(o.literal(t.value.cooked));var r=e.expressions.shift();r&&l.push(r)}if(l.length>1){var a=l[l.length-1];o.isLiteral(a,{value:""})&&l.pop();var u=s(l.shift(),l.shift());for(n=0;n<l.length;n++)u=s(u,l[n]);return u}return l[0]}var u=function(e){return e&&e.__esModule?e["default"]:e};l.check=t,l.TaggedTemplateExpression=r,l.TemplateLiteral=a;var o=u(e("../../../types")),s=function(e,n){return o.binaryExpression("+",e,n)};l.__esModule=!0},{"../../../types":122}],79:[function(e,n,l){"use strict";function t(e,n,l,t){var r=e.left;if(p.isVirtualPropertyExpression(r)){var a,u=e.right;p.isExpressionStatement(n)||(a=l.generateTempBasedOnNode(e.right),a&&(u=a)),"="!==e.operator&&(u=p.binaryExpression(e.operator[0],c.template("abstract-expression-get",{PROPERTY:e.property,OBJECT:e.object}),u));var o=c.template("abstract-expression-set",{PROPERTY:r.property,OBJECT:r.object,VALUE:u});return a&&(o=p.sequenceExpression([p.assignmentExpression("=",a,e.right),o])),d(n,o,u,t)
}}function r(e,n,l,t){var r=e.argument;if(p.isVirtualPropertyExpression(r)&&"delete"===e.operator){var a=c.template("abstract-expression-delete",{PROPERTY:r.property,OBJECT:r.object});return d(n,a,p.literal(!0),t)}}function a(e,n,l){var t=e.callee;if(p.isVirtualPropertyExpression(t)){var r=l.generateTempBasedOnNode(t.object),a=c.template("abstract-expression-call",{PROPERTY:t.property,OBJECT:r||t.object});return a.arguments=a.arguments.concat(e.arguments),r?p.sequenceExpression([p.assignmentExpression("=",r,t.object),a]):a}}function u(e){return c.template("abstract-expression-get",{PROPERTY:e.property,OBJECT:e.object})}function o(e){return p.variableDeclaration("const",e.declarations.map(function(e){return p.variableDeclarator(e,p.newExpression(p.identifier("WeakMap"),[]))}))}var s=function(e){return e&&e.__esModule?e["default"]:e},i=function(e){return e&&e.__esModule?e:{"default":e}};l.AssignmentExpression=t,l.UnaryExpression=r,l.CallExpression=a,l.VirtualPropertyExpression=u,l.PrivateDeclaration=o;var c=i(e("../../../util")),p=s(e("../../../types")),d=(l.experimental=!0,function(e,n,l,t){if(p.isExpressionStatement(e)&&!t.isConsequenceExpressionStatement(e))return n;var r=[];return p.isSequenceExpression(n)?r=n.expressions:r.push(n),r.push(l),p.sequenceExpression(r)});l.__esModule=!0},{"../../../types":122,"../../../util":124}],80:[function(e,n,l){"use strict";function t(e,n,l,t){var u=a;return e.generator&&(u=r),u(e,n,l,t)}function r(e){var n=[],l=p.functionExpression(null,[],p.blockStatement(n),!0);return l._aliasFunction=!0,n.push(s(e,function(){return p.expressionStatement(p.yieldExpression(e.body))})),p.callExpression(l,[])}function a(e,n,l,t){var r=l.generateUidBasedOnNode(n,t),a=c.template("array-comprehension-container",{KEY:r});a.callee._aliasFunction=!0;var u=a.callee.body,o=u.body;i.hasType(e,l,"YieldExpression",p.FUNCTION_TYPES)&&(a.callee.generator=!0,a=p.yieldExpression(a,!0));var d=o.pop();return o.push(s(e,function(){return c.template("array-push",{STATEMENT:e.body,KEY:r},!0)})),o.push(d),a}var u=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e){return e&&e.__esModule?e["default"]:e};l.ComprehensionExpression=t;{var s=o(e("../../helpers/build-comprehension")),i=o(e("../../../traversal")),c=u(e("../../../util")),p=o(e("../../../types"));l.experimental=!0}l.__esModule=!0},{"../../../traversal":117,"../../../types":122,"../../../util":124,"../../helpers/build-comprehension":30}],81:[function(e,n,l){"use strict";var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("../../helpers/build-binary-assignment-operator-transformer")),a=t(e("../../../types")),u=(l.experimental=!0,a.memberExpression(a.identifier("Math"),a.identifier("pow")));r(l,{operator:"**",build:function(e,n){return a.callExpression(u,[e,n])}}),l.__esModule=!0},{"../../../types":122,"../../helpers/build-binary-assignment-operator-transformer":29}],82:[function(e,n,l){"use strict";function t(e){e.whitelist.length&&e.whitelist.push("es6.destructuring")}function r(e,n,l,t){if(o(e)){for(var r=[],a=[],s=function(){a.length&&(r.push(u.objectExpression(a)),a=[])},i=0;i<e.properties.length;i++){var c=e.properties[i];u.isSpreadProperty(c)?(s(),r.push(c.argument)):a.push(c)}return s(),u.isObjectExpression(r[0])||r.unshift(u.objectExpression([])),u.callExpression(t.addHelper("extends"),r)}}var a=function(e){return e&&e.__esModule?e["default"]:e};l.manipulateOptions=t,l.ObjectExpression=r;var u=a(e("../../../types")),o=(l.experimental=!0,function(e){for(var n=0;n<e.properties.length;n++)if(u.isSpreadProperty(e.properties[n]))return!0;return!1});l.__esModule=!0},{"../../../types":122}],83:[function(e,n){"use strict";n.exports={strict:e("./other/strict"),_validation:e("./internal/validation"),"validation.undeclaredVariableCheck":e("./validation/undeclared-variable-check"),"validation.react":e("./validation/react"),"spec.functionName":e("./spec/function-name"),"spec.blockScopedFunctions":e("./spec/block-scoped-functions"),"es6.arrowFunctions":e("./es6/arrow-functions"),"playground.malletOperator":e("./playground/mallet-operator"),"playground.methodBinding":e("./playground/method-binding"),"playground.memoizationOperator":e("./playground/memoization-operator"),"playground.objectGetterMemoization":e("./playground/object-getter-memoization"),reactCompat:e("./other/react-compat"),flow:e("./other/flow"),react:e("./other/react"),_modules:e("./internal/modules"),"es7.comprehensions":e("./es7/comprehensions"),"es6.classes":e("./es6/classes"),asyncToGenerator:e("./other/async-to-generator"),bluebirdCoroutines:e("./other/bluebird-coroutines"),"es6.objectSuper":e("./es6/object-super"),"es7.objectRestSpread":e("./es7/object-rest-spread"),"es7.exponentiationOperator":e("./es7/exponentiation-operator"),"es6.templateLiterals":e("./es6/template-literals"),"es5.properties.mutators":e("./es5/properties.mutators"),"es6.properties.shorthand":e("./es6/properties.shorthand"),"es6.properties.computed":e("./es6/properties.computed"),"es6.forOf":e("./es6/for-of"),"es6.regex.sticky":e("./es6/regex.sticky"),"es6.regex.unicode":e("./es6/regex.unicode"),"es7.abstractReferences":e("./es7/abstract-references"),"es6.constants":e("./es6/constants"),"es6.parameters.rest":e("./es6/parameters.rest"),"es6.spread":e("./es6/spread"),"es6.parameters.default":e("./es6/parameters.default"),"es6.destructuring":e("./es6/destructuring"),"es6.blockScoping":e("./es6/block-scoping"),"es6.blockScopingTDZ":e("./es6/block-scoping-tdz"),"es6.tailCall":e("./es6/tail-call"),regenerator:e("./other/regenerator"),runtime:e("./other/runtime"),"es6.modules":e("./es6/modules"),_blockHoist:e("./internal/block-hoist"),"spec.protoToAssign":e("./spec/proto-to-assign"),_declarations:e("./internal/declarations"),_aliasFunctions:e("./internal/alias-functions"),"spec.typeofSymbol":e("./spec/typeof-symbol"),"spec.undefinedToVoid":e("./spec/undefined-to-void"),_strict:e("./internal/strict"),_moduleFormatter:e("./internal/module-formatter"),"es3.propertyLiterals":e("./es3/property-literals"),"es3.memberExpressionLiterals":e("./es3/member-expression-literals"),"utility.removeDebugger":e("./utility/remove-debugger"),"utility.removeConsole":e("./utility/remove-console"),"utility.inlineEnvironmentVariables":e("./utility/inline-environment-variables"),"utility.inlineExpressions":e("./utility/inline-expressions"),"utility.deadCodeElimination":e("./utility/dead-code-elimination"),_cleanUp:e("./internal/cleanup")}},{"./es3/member-expression-literals":58,"./es3/property-literals":59,"./es5/properties.mutators":60,"./es6/arrow-functions":61,"./es6/block-scoping":63,"./es6/block-scoping-tdz":62,"./es6/classes":64,"./es6/constants":65,"./es6/destructuring":66,"./es6/for-of":67,"./es6/modules":68,"./es6/object-super":69,"./es6/parameters.default":70,"./es6/parameters.rest":71,"./es6/properties.computed":72,"./es6/properties.shorthand":73,"./es6/regex.sticky":74,"./es6/regex.unicode":75,"./es6/spread":76,"./es6/tail-call":77,"./es6/template-literals":78,"./es7/abstract-references":79,"./es7/comprehensions":80,"./es7/exponentiation-operator":81,"./es7/object-rest-spread":82,"./internal/alias-functions":84,"./internal/block-hoist":85,"./internal/cleanup":86,"./internal/declarations":87,"./internal/module-formatter":88,"./internal/modules":89,"./internal/strict":90,"./internal/validation":91,"./other/async-to-generator":92,"./other/bluebird-coroutines":93,"./other/flow":94,"./other/react":96,"./other/react-compat":95,"./other/regenerator":97,"./other/runtime":98,"./other/strict":99,"./playground/mallet-operator":100,"./playground/memoization-operator":101,"./playground/method-binding":102,"./playground/object-getter-memoization":103,"./spec/block-scoped-functions":104,"./spec/function-name":105,"./spec/proto-to-assign":106,"./spec/typeof-symbol":107,"./spec/undefined-to-void":108,"./utility/dead-code-elimination":109,"./utility/inline-environment-variables":110,"./utility/inline-expressions":111,"./utility/remove-console":112,"./utility/remove-debugger":113,"./validation/react":114,"./validation/undeclared-variable-check":115}],84:[function(e,n,l){"use strict";function t(e,n,l){i(function(){return e.body},e,l)}function r(e,n,l){i(function(){return u.ensureBlock(e),e.body.body},e,l)}var a=function(e){return e&&e.__esModule?e["default"]:e};l.Program=t,l.FunctionDeclaration=r;var u=a(e("../../../types")),o={enter:function(e,n,l,t){if(this.isFunction()&&!e._aliasFunction)return this.skip();if(e._ignoreAliasFunctions)return this.skip();var r;if(this.isIdentifier()&&"arguments"===e.name)r=t.getArgumentsId;else{if(!this.isThisExpression())return;r=t.getThisId}return this.isReferenced()?r():void 0}},s={enter:function(e,n,l,t){return e._aliasFunction?(l.traverse(e,o,t),this.skip()):this.isFunction()?this.skip():void 0}},i=function(e,n,l){var t,r,a={getArgumentsId:function(){return!t&&(t=l.generateUidIdentifier("arguments")),t},getThisId:function(){return!r&&(r=l.generateUidIdentifier("this")),r}};l.traverse(n,s,a);var o,i=function(n,l){o||(o=e()),o.unshift(u.variableDeclaration("var",[u.variableDeclarator(n,l)]))};t&&i(t,u.identifier("arguments")),r&&i(r,u.thisExpression())};l.FunctionExpression=r,l.__esModule=!0},{"../../../types":122}],85:[function(e,n,l){"use strict";var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("lodash/collection/groupBy")),a=t(e("lodash/array/flatten")),u=t(e("lodash/object/values")),o=l.BlockStatement={exit:function(e){for(var n=!1,l=0;l<e.body.length;l++){var t=e.body[l];t&&null!=t._blockHoist&&(n=!0)}if(n){var o=r(e.body,function(e){var n=e._blockHoist;return null==n&&(n=1),n===!0&&(n=2),n});e.body=a(u(o).reverse())}}};l.Program=o,l.__esModule=!0},{"lodash/array/flatten":197,"lodash/collection/groupBy":204,"lodash/object/values":307}],86:[function(e,n,l){"use strict";l.SequenceExpression={exit:function(e){return 1===e.expressions.length?e.expressions[0]:void(e.expressions.length||this.remove())}},l.ExpressionStatement={exit:function(e){e.expression||this.remove()}};l.__esModule=!0},{}],87:[function(e,n,l){"use strict";function t(e,n,l,t){e._declarations&&u.wrap(e,function(){var n,l={};for(var r in e._declarations){var a=e._declarations[r];n=a.kind||"var";var u=o.variableDeclarator(a.id,a.init);if(a.init)e.body.unshift(t.attachAuxiliaryComment(o.variableDeclaration(n,[u])));else{var s=l,i=n;s[i]||(s[i]=[]),l[n].push(u)}}for(n in l)e.body.unshift(t.attachAuxiliaryComment(o.variableDeclaration(n,l[n])));e._declarations=null})}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}};l.BlockStatement=t;{var u=a(e("../../helpers/strict")),o=r(e("../../../types"));l.secondPass=!0}l.Program=t,l.__esModule=!0},{"../../../types":122,"../../helpers/strict":41}],88:[function(e,n,l){"use strict";function t(e,n,l,t){t.transformers["es6.modules"].canRun()&&(a.wrap(e,function(){e.body=t.dynamicImports.concat(e.body)}),t.moduleFormatter.transform&&t.moduleFormatter.transform(e))}var r=function(e){return e&&e.__esModule?e:{"default":e}};l.Program=t;var a=r(e("../../helpers/strict"));l.__esModule=!0},{"../../helpers/strict":41}],89:[function(e,n,l){"use strict";function t(e){return o.isImportDeclaration(e)||o.isExportDeclaration(e)}function r(e,n,l,t){var r=t.opts.resolveModuleSource;e.source&&r&&(e.source.value=r(e.source.value,t.opts.filename))}function a(e,n,l){if(r.apply(this,arguments),!e.isType){var t=e.declaration,a=function(){return t._ignoreUserWhitespace=!0,t};if(e["default"]){if(o.isClassDeclaration(t))return e.declaration=t.id,[a(),e];if(o.isClassExpression(t)){var u=l.generateUidIdentifier("default");return t=o.variableDeclaration("var",[o.variableDeclarator(u,t)]),e.declaration=u,[a(),e]}if(o.isFunctionDeclaration(t))return e._blockHoist=2,e.declaration=t.id,[a(),e]}else if(o.isFunctionDeclaration(t))return e.specifiers=[o.importSpecifier(t.id,t.id)],e.declaration=null,e._blockHoist=2,[a(),e]}}var u=function(e){return e&&e.__esModule?e["default"]:e};l.check=t,l.ImportDeclaration=r,l.ExportDeclaration=a;var o=u(e("../../../types"));l.__esModule=!0},{"../../../types":122}],90:[function(e,n,l){"use strict";function t(e,n,l,t){t.transformers.strict.canRun()&&e.body.unshift(a.expressionStatement(a.literal("use strict")))}var r=function(e){return e&&e.__esModule?e["default"]:e};l.Program=t;var a=r(e("../../../types"));l.__esModule=!0},{"../../../types":122}],91:[function(e,n,l){"use strict";function t(e,n,l,t){var r=e.left;if(s.isVariableDeclaration(r)){var a=r.declarations[0];if(a.init)throw t.errorWithNode(a,o.get("noAssignmentsInForHead"))}}function r(e,n,l,t){if("set"===e.kind){if(1!==e.value.params.length)throw t.errorWithNode(e.value,o.get("settersInvalidParamLength"));var r=e.value.params[0];if(s.isRestElement(r))throw t.errorWithNode(r,o.get("settersNoRest"))}}var a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e){return e&&e.__esModule?e:{"default":e}};l.ForOfStatement=t,l.Property=r;var o=u(e("../../../messages")),s=a(e("../../../types"));l.ForInStatement=t,l.MethodDefinition=r,l.__esModule=!0},{"../../../messages":26,"../../../types":122}],92:[function(e,n,l){"use strict";var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("../../helpers/remap-async-to-generator"));l.manipulateOptions=e("./bluebird-coroutines").manipulateOptions;l.optional=!0;l.Function=function(e,n,l,t){return e.async&&!e.generator?r(e,t.addHelper("async-to-generator"),l):void 0},l.__esModule=!0},{"../../helpers/remap-async-to-generator":39,"./bluebird-coroutines":93}],93:[function(e,n,l){"use strict";function t(e){e.experimental=!0,e.blacklist.push("regenerator")}var r=function(e){return e&&e.__esModule?e["default"]:e};l.manipulateOptions=t;{var a=r(e("../../helpers/remap-async-to-generator")),u=r(e("../../../types"));l.optional=!0}l.Function=function(e,n,l,t){return e.async&&!e.generator?a(e,u.memberExpression(t.addImport("bluebird",null,!0),u.identifier("coroutine")),l):void 0},l.__esModule=!0},{"../../../types":122,"../../helpers/remap-async-to-generator":39}],94:[function(e,n,l){"use strict";function t(){this.remove()}function r(e){e.typeAnnotation=null,e.value||this.remove()}function a(e){e["implements"]=null}function u(e){return e.expression}function o(e){e.isType&&this.remove()}function s(e){c.isTypeAlias(e.declaration)&&this.remove()}var i=function(e){return e&&e.__esModule?e["default"]:e};l.Flow=t,l.ClassProperty=r,l.Class=a,l.TypeCastExpression=u,l.ImportDeclaration=o,l.ExportDeclaration=s;var c=i(e("../../../types"));l.Function=function(e){for(var n=0;n<e.params.length;n++){var l=e.params[n];l.optional=!1}},l.__esModule=!0},{"../../../types":122}],95:[function(e,n,l){"use strict";function t(e){e.blacklist.push("react")}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}};l.manipulateOptions=t;{var u=a(e("../../helpers/react")),o=r(e("../../../types"));l.optional=!0}e("../../helpers/build-react-transformer")(l,{pre:function(e){e.callee=e.tagExpr},post:function(e){u.isCompatTag(e.tagName)&&(e.call=o.callExpression(o.memberExpression(o.memberExpression(o.identifier("React"),o.identifier("DOM")),e.tagExpr,o.isLiteral(e.tagExpr)),e.args))}}),l.__esModule=!0},{"../../../types":122,"../../helpers/build-react-transformer":32,"../../helpers/react":37}],96:[function(e,n,l){"use strict";function t(e,n,l,t){for(var r="React.createElement",a=0;a<t.ast.comments.length;a++){var u=t.ast.comments[a],i=s.exec(u.value);if(i){if(r=i[1],"React.DOM"===r)throw t.errorWithNode(u,"The @jsx React.DOM pragma has been deprecated as of React 0.12");break}}t.set("jsxIdentifier",r.split(".").map(o.identifier).reduce(function(e,n){return o.memberExpression(e,n)}))}var r=function(e){return e&&e.__esModule?e["default"]:e},a=function(e){return e&&e.__esModule?e:{"default":e}};l.Program=t;var u=a(e("../../helpers/react")),o=r(e("../../../types")),s=/^\*\s*@jsx\s+([^\s]+)/;e("../../helpers/build-react-transformer")(l,{pre:function(e){var n=e.tagName,l=e.args;l.push(u.isCompatTag(n)?o.literal(n):e.tagExpr)},post:function(e,n){e.callee=n.get("jsxIdentifier")}}),l.__esModule=!0},{"../../../types":122,"../../helpers/build-react-transformer":32,"../../helpers/react":37}],97:[function(e,n,l){"use strict";function t(e){return u.isFunction(e)&&(e.async||e.generator)}var r=function(e){return e&&e.__esModule?e["default"]:e};l.check=t;{var a=r(e("regenerator-babel")),u=r(e("../../../types"));l.Program={enter:function(e){a.transform(e),this.stop()}}}l.__esModule=!0},{"../../../types":122,"regenerator-babel":320}],98:[function(e,n,l){"use strict";function t(e){e.whitelist.length&&e.whitelist.push("es6.modules")}function r(e,n,l,t){l.traverse(e,y,t)}function a(e){e.setDynamic("helpersNamespace",function(){return e.addImport("babel-runtime/helpers","babelHelpers")}),e.setDynamic("coreIdentifier",function(){return e.addImport("babel-runtime/core-js","core")}),e.setDynamic("regeneratorIdentifier",function(){return e.addImport("babel-runtime/regenerator","regeneratorRuntime")})}function u(e,n,l,t){return this.isReferencedIdentifier({name:"regeneratorRuntime"})?t.get("regeneratorIdentifier"):void 0}var o=function(e){return e&&e.__esModule?e:{"default":e}},s=function(e){return e&&e.__esModule?e["default"]:e};l.manipulateOptions=t,l.Program=r,l.pre=a,l.Identifier=u;{var i=s(e("lodash/collection/includes")),c=o(e("../../../util")),p=s(e("core-js/library")),d=s(e("lodash/object/has")),f=s(e("../../../types")),h=f.buildMatchMemberExpression("Symbol.iterator"),g=function(e){return"_"!==e.name&&d(p,e.name)},m=["Symbol","Promise","Map","WeakMap","Set","WeakSet","Number"],y={enter:function(e,n,l,t){var r;if(this.isMemberExpression()&&this.isReferenced()){var a=e.object;if(r=e.property,!f.isReferenced(a,e))return;if(!e.computed&&g(a)&&d(p[a.name],r.name)&&!l.getBindingIdentifier(a.name))return this.skip(),f.prependToMemberExpression(e,t.get("coreIdentifier"))}else{if(this.isReferencedIdentifier()&&!f.isMemberExpression(n)&&i(m,e.name)&&!l.getBindingIdentifier(e.name))return f.memberExpression(t.get("coreIdentifier"),e);if(this.isCallExpression()){var u=e.callee;return e.arguments.length?!1:f.isMemberExpression(u)&&u.computed?(r=u.property,h(r)?c.template("corejs-iterator",{CORE_ID:t.get("coreIdentifier"),VALUE:u.object}):!1):!1}if(this.isBinaryExpression()){if("in"!==e.operator)return;var o=e.left;if(!h(o))return;return c.template("corejs-is-iterator",{CORE_ID:t.get("coreIdentifier"),VALUE:e.right})}}}};l.optional=!0}l.__esModule=!0},{"../../../types":122,"../../../util":124,"core-js/library":177,"lodash/collection/includes":205,"lodash/object/has":304}],99:[function(e,n,l){"use strict";function t(e){var n=e.body[0];c.isExpressionStatement(n)&&c.isLiteral(n.expression,{value:"use strict"})&&e.body.shift()}function r(){this.skip()}function a(){return c.identifier("undefined")}function u(e,n,l,t){if(c.isIdentifier(e.callee,{name:"eval"}))throw t.errorWithNode(e,i.get("evalInStrictMode"))}var o=function(e){return e&&e.__esModule?e["default"]:e},s=function(e){return e&&e.__esModule?e:{"default":e}};l.Program=t,l.FunctionExpression=r,l.ThisExpression=a,l.CallExpression=u;var i=s(e("../../../messages")),c=o(e("../../../types"));l.FunctionDeclaration=r,l.__esModule=!0},{"../../../messages":26,"../../../types":122}],100:[function(e,n,l){"use strict";{var t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e){return e&&e.__esModule?e:{"default":e}},a=r(e("../../../messages")),u=t(e("../../helpers/build-conditional-assignment-operator-transformer")),o=t(e("../../../types"));l.playground=!0}u(l,{is:function(e,n){if(o.isAssignmentExpression(e,{operator:"||="})){var l=e.left;if(!o.isMemberExpression(l)&&!o.isIdentifier(l))throw n.errorWithNode(l,a.get("expectedMemberExpressionOrIdentifier"));return!0}},build:function(e){return o.unaryExpression("!",e,!0)}}),l.__esModule=!0},{"../../../messages":26,"../../../types":122,"../../helpers/build-conditional-assignment-operator-transformer":31}],101:[function(e,n,l){"use strict";{var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("../../helpers/build-conditional-assignment-operator-transformer")),a=t(e("../../../types"));l.playground=!0}r(l,{is:function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(e){var n=a.isAssignmentExpression(e,{operator:"?="});return n&&a.assertMemberExpression(e.left),n}),build:function(e,n){return a.unaryExpression("!",a.callExpression(a.memberExpression(n.addHelper("has-own"),a.identifier("call")),[e.object,e.property]),!0)}}),l.__esModule=!0},{"../../../types":122,"../../helpers/build-conditional-assignment-operator-transformer":31}],102:[function(e,n,l){"use strict";function t(e,n,l){var t=e.object,r=e.property,a=l.generateTempBasedOnNode(e.object);a&&(t=a);var s=o.callExpression(o.memberExpression(o.memberExpression(t,r),o.identifier("bind")),[t].concat(u(e.arguments)));return a?o.sequenceExpression([o.assignmentExpression("=",a,e.object),s]):s}function r(e,n,l){var t=function(n){var t=l.generateUidIdentifier("val");return o.functionExpression(null,[t],o.blockStatement([o.returnStatement(o.callExpression(o.memberExpression(t,e.callee),n))]))},r=l.generateTemp("args");return o.sequenceExpression([o.assignmentExpression("=",r,o.arrayExpression(e.arguments)),t(e.arguments.map(function(e,n){return o.memberExpression(r,o.literal(n),!0)}))])}var a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e){if(Array.isArray(e)){for(var n=0,l=Array(e.length);n<e.length;n++)l[n]=e[n];return l}return Array.from(e)};l.BindMemberExpression=t,l.BindFunctionExpression=r;{var o=a(e("../../../types"));l.playground=!0}l.__esModule=!0},{"../../../types":122}],103:[function(e,n,l){"use strict";function t(e,n,l,t){if("memo"===e.kind){e.kind="get";var r=e.value;a.ensureBlock(r);var o=e.key;a.isIdentifier(o)&&!e.computed&&(o=a.literal(o.name));var s={key:o,file:t};return l.traverse(r,u,s),e}}var r=function(e){return e&&e.__esModule?e["default"]:e};l.MethodDefinition=t;var a=r(e("../../../types")),u=(l.playground=!0,{enter:function(e,n,l,t){return this.isFunction()?this.skip():void(this.isReturnStatement()&&e.argument&&(e.argument=a.memberExpression(a.callExpression(t.file.addHelper("define-property"),[a.thisExpression(),t.key,e.argument]),t.key,!0)))}});l.Property=t,l.__esModule=!0},{"../../../types":122}],104:[function(e,n,l){"use strict";function t(e,n,l,t){if(!(a.isFunction(n)&&n.body===e||a.isExportDeclaration(n)))for(var r=0;r<e.body.length;r++){var u=e.body[r];if(a.isFunctionDeclaration(u)){var o=a.variableDeclaration("let",[a.variableDeclarator(u.id,a.toExpression(u))]);o._blockHoist=2,u.id=null,e.body[r]=o,t.checkNode(o)}}}var r=function(e){return e&&e.__esModule?e["default"]:e};l.BlockStatement=t;var a=r(e("../../../types"));l.__esModule=!0},{"../../../types":122}],105:[function(e,n,l){"use strict";l.FunctionExpression=e("../../helpers/name-method").bare,l.__esModule=!0},{"../../helpers/name-method":36}],106:[function(e,n,l){"use strict";function t(e){return c.isLiteral(c.toComputedKey(e,e.key),{value:"__proto__"})}function r(e){var n=e.left;return c.isMemberExpression(n)&&c.isLiteral(c.toComputedKey(n,n.property),{value:"__proto__"})}function a(e,n,l){return c.expressionStatement(c.callExpression(l.addHelper("defaults"),[n,e.right]))}function u(e,n,l,t){if(r(e)){var u=[],o=e.left.object,s=l.generateTempBasedOnNode(e.left.object);return u.push(c.expressionStatement(c.assignmentExpression("=",s,o))),u.push(a(e,s,t)),s&&u.push(s),c.toSequenceExpression(u)}}function o(e,n,l,t){var u=e.expression;if(c.isAssignmentExpression(u,{operator:"="}))return r(u)?a(u,u.left.object,t):void 0}function s(e,n,l,r){for(var a,u=0;u<e.properties.length;u++){var o=e.properties[u];t(o)&&(a=o.value,p(e.properties,o))}if(a){var s=[c.objectExpression([]),a];return e.properties.length&&s.push(e),c.callExpression(r.addHelper("extends"),s)}}var i=function(e){return e&&e.__esModule?e["default"]:e};l.AssignmentExpression=u,l.ExpressionStatement=o,l.ObjectExpression=s;{var c=i(e("../../../types")),p=i(e("lodash/array/pull"));l.secondPass=!0,l.optional=!0}l.__esModule=!0},{"../../../types":122,"lodash/array/pull":199}],107:[function(e,n,l){"use strict";function t(e,n,l,t){if(this.skip(),"typeof"===e.operator){var r=a.callExpression(t.addHelper("typeof"),[e.argument]);if(a.isIdentifier(e.argument)){var u=a.literal("undefined");return a.conditionalExpression(a.binaryExpression("===",a.unaryExpression("typeof",e.argument),u),u,r)}return r}}var r=function(e){return e&&e.__esModule?e["default"]:e};l.UnaryExpression=t;{var a=r(e("../../../types"));l.optional=!0}l.__esModule=!0},{"../../../types":122}],108:[function(e,n,l){"use strict";function t(e){return"undefined"===e.name&&this.isReferenced()?a.unaryExpression("void",a.literal(0),!0):void 0}var r=function(e){return e&&e.__esModule?e["default"]:e};l.Identifier=t;{var a=r(e("../../../types"));l.optional=!0}l.__esModule=!0},{"../../../types":122}],109:[function(e,n,l){"use strict";function t(e){if(u.isBlockStatement(e)){for(var n=!1,l=0;l<e.body.length;l++){var t=e.body[l];u.isBlockScoped(t)&&(n=!0)}if(!n)return e.body}return e}function r(e,n,l){var t=u.evaluateTruthy(e.test,l);return t===!0?e.consequent:t===!1?e.alternate:void 0}var a=function(e){return e&&e.__esModule?e["default"]:e};l.ConditionalExpression=r;{var u=a(e("../../../types"));l.optional=!0,l.IfStatement={exit:function(e,n,l){var r=e.consequent,a=e.alternate,o=e.test,s=u.evaluateTruthy(o,l);return s===!0?t(r):s===!1?a?t(a):this.remove():(u.isBlockStatement(a)&&!a.body.length&&(a=e.alternate=null),void(u.isBlockStatement(r)&&!r.body.length&&u.isBlockStatement(a)&&a.body.length&&(e.consequent=e.alternate,e.alternate=null,e.test=u.unaryExpression("!",o,!0))))}}}l.__esModule=!0},{"../../../types":122}],110:[function(e,n,l){(function(n){"use strict";function t(e){if(u(e.object)){var l=a.toComputedKey(e,e.property);if(a.isLiteral(l))return a.valueToNode(n.env[l.value])}}var r=function(e){return e&&e.__esModule?e["default"]:e};l.MemberExpression=t;var a=r(e("../../../types")),u=(l.optional=!0,a.buildMatchMemberExpression("process.env"));l.__esModule=!0}).call(this,e("_process"))},{"../../../types":122,_process:151}],111:[function(e,n,l){"use strict";function t(e,n,l){var t=u.evaluate(e,l);return t.confident?u.valueToNode(t.value):void 0}function r(){}var a=function(e){return e&&e.__esModule?e["default"]:e};l.Expression=t,l.Identifier=r;{var u=a(e("../../../types"));l.optional=!0}l.__esModule=!0},{"../../../types":122}],112:[function(e,n,l){"use strict";function t(e,n){u(e.callee)&&(a.isExpressionStatement(n)?this.parentPath.remove():this.remove())}var r=function(e){return e&&e.__esModule?e["default"]:e};l.CallExpression=t;{var a=r(e("../../../types")),u=a.buildMatchMemberExpression("console",!0);l.optional=!0}l.__esModule=!0},{"../../../types":122}],113:[function(e,n,l){"use strict";function t(){this.get("expression").isIdentifier({name:"debugger"})&&this.remove()}var r=function(e){return e&&e.__esModule?e["default"]:e};l.ExpressionStatement=t;r(e("../../../types")),l.optional=!0;l.__esModule=!0},{"../../../types":122}],114:[function(e,n,l){"use strict";function t(e,n,l,t){s.isIdentifier(e.callee,{name:"require"})&&1===e.arguments.length&&i(e.arguments[0],t)}function r(e,n,l,t){i(e.source,t)}var a=function(e){return e&&e.__esModule?e["default"]:e},u=function(e){return e&&e.__esModule?e:{"default":e}};l.CallExpression=t,l.ModuleDeclaration=r;var o=u(e("../../../messages")),s=a(e("../../../types")),i=function(e,n){if(s.isLiteral(e)){var l=e.value,t=l.toLowerCase();if("react"===t&&l!==t)throw n.errorWithNode(e,o.get("didYouMean","react"))}};l.__esModule=!0},{"../../../messages":26,"../../../types":122}],115:[function(e,n,l){"use strict";function t(e,n,l,t){if(this.isReferenced()&&!l.hasBinding(e.name)){var r,a=l.getAllBindings(),s=-1;for(var i in a){var c=u(e.name,i);0>=c||c>3||s>=c||(r=i,s=c)}var p;throw p=r?o.get("undeclaredVariableSuggestion",e.name,r):o.get("undeclaredVariable",e.name),t.errorWithNode(e,p,ReferenceError)}}var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(e){return e&&e.__esModule?e["default"]:e};l.Identifier=t;{var u=a(e("leven")),o=r(e("../../../messages"));l.optional=!0}l.__esModule=!0},{"../../../messages":26,leven:193}],116:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},r=l(e("./path")),a=l(e("lodash/array/flatten")),u=l(e("lodash/array/compact")),o=function(){function e(n,l,r,a){t(this,e),this.shouldFlatten=!1,this.parentPath=a,this.scope=n,this.state=r,this.opts=l}return e.prototype.flatten=function(){this.shouldFlatten=!0},e.prototype.visitNode=function(e,n,l){var t=r.get(this.parentPath,this,e,n,l);return t.visit()},e.prototype.visit=function(e,n){var l=e[n];if(l){if(!Array.isArray(l))return this.visitNode(e,e,n);if(0!==l.length){for(var t=0;t<l.length;t++)if(l[t]&&this.visitNode(e,l,t))return!0;this.shouldFlatten&&(e[n]=a(e[n]),("body"===n||"expressions"===n)&&(e[n]=u(e[n])))}}},e}();n.exports=o},{"./path":118,"lodash/array/compact":196,"lodash/array/flatten":197}],117:[function(e,n){"use strict";function l(e,n,t,r){if(e){if(!n.noScope&&!t&&"Program"!==e.type&&"File"!==e.type)throw new Error("Must pass a scope unless traversing a Program/File got a "+e.type+" node");if(n||(n={}),n.enter||(n.enter=function(){}),n.exit||(n.exit=function(){}),Array.isArray(e))for(var a=0;a<e.length;a++)l.node(e[a],n,t,r);else l.node(e,n,t,r)}}function t(e){e._declarations=null,e.extendedRange=null,e._scopeInfo=null,e._paths=null,e.tokens=null,e.range=null,e.start=null,e.end=null,e.loc=null,e.raw=null,Array.isArray(e.trailingComments)&&r(e.trailingComments),Array.isArray(e.leadingComments)&&r(e.leadingComments);for(var n in e){var l=e[n];Array.isArray(l)&&delete l._paths}}function r(e){for(var n=0;n<e.length;n++)t(e[n])}function a(e,n,l,t){e.type===t.type&&(t.has=!0,this.skip())}var u=function(e){return e&&e.__esModule?e["default"]:e};n.exports=l;var o=u(e("./context")),s=u(e("lodash/collection/includes")),i=u(e("../types"));l.node=function(e,n,l,t,r){var a=i.VISITOR_KEYS[e.type];if(a)for(var u=new o(l,n,t,r),s=0;s<a.length;s++)if(u.visit(e,a[s]))return};var c={noScope:!0,exit:t};l.removeProperties=function(e){return l(e,c),t(e),e},l.explode=function(e){for(var n in e){var l=e[n],t=i.FLIPPED_ALIAS_KEYS[n];if(t)for(var r=0;r<t.length;r++){var a=e,u=t[r];a[u]||(a[u]=l)}}return e},l.hasType=function(e,n,t,r){if(s(r,e.type))return!1;if(e.type===t)return!0;var u={has:!1,type:t};return l(e,{blacklist:r,enter:a},n,u),u.has}},{"../types":122,"./context":116,"lodash/collection/includes":205}],118:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e["default"]:e},t=function(e,n,l){n&&Object.defineProperties(e,n),l&&Object.defineProperties(e.prototype,l)},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=l(e("./index")),u=l(e("lodash/collection/includes")),o=l(e("./scope")),s=l(e("../types")),i=function(){function e(n,l,t){r(this,e),this.parentPath=n,this.container=t,this.parent=l,this.data={}}return e.get=function(n,l,t,r,a){for(var u,o,s=r[a],i=(u=r,!u._paths&&(u._paths=[]),u._paths),c=0;c<i.length;c++){var p=i[c];if(p.node===s){o=p;break}}return o||(o=new e(n,t,r),i.push(o)),o.setContext(l,a),o},e.getScope=function(e,n,l){var t=l;return s.isScope(e,n)&&(t=new o(e,n,l)),t},e.prototype.setData=function(e,n){return this.data[e]=n},e.prototype.getData=function(e){return this.data[e]},e.prototype.setScope=function(){this.scope=e.getScope(this.node,this.parent,this.context.scope)},e.prototype.setContext=function(e,n){this.shouldRemove=!1,this.shouldSkip=!1,this.shouldStop=!1,this.context=e,this.state=e.state,this.opts=e.opts,this.key=n,this.setScope()},e.prototype.remove=function(){this.shouldRemove=!0,this.shouldSkip=!0},e.prototype.skip=function(){this.shouldSkip=!0},e.prototype.stop=function(){this.shouldStop=!0,this.shouldSkip=!0
},e.prototype.flatten=function(){this.context.flatten()},e.prototype.call=function(e){var n=this.node;if(n){var l=this.opts,t=l[e]||l;l[n.type]&&(t=l[n.type][e]||t);var r=t.call(this,n,this.parent,this.scope,this.state);r&&(this.node=r),this.shouldRemove&&(this.container[this.key]=null,this.flatten())}},e.prototype.isBlacklisted=function(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1},e.prototype.visit=function(){if(this.isBlacklisted())return!1;if(this.call("enter"),this.shouldSkip)return this.shouldStop;var e=this.node,n=this.opts;if(Array.isArray(e))for(var l=0;l<e.length;l++)a.node(e[l],n,this.scope,this.state,this);else a.node(e,n,this.scope,this.state,this),this.call("exit");return this.shouldStop},e.prototype.get=function(n){return e.get(this,this.context,this.node,this.node,n)},e.prototype.isReferencedIdentifier=function(e){return s.isReferencedIdentifier(this.node,this.parent,e)},e.prototype.isReferenced=function(){return s.isReferenced(this.node,this.parent)},e.prototype.isScope=function(){return s.isScope(this.node,this.parent)},e.prototype.getBindingIdentifiers=function(){return s.getBindingIdentifiers(this.node)},t(e,null,{node:{get:function(){return this.container[this.key]},set:function(e){var n=Array.isArray(e),l=e;n&&(l=e[0]),l&&s.inheritsComments(l,this.node),this.container[this.key]=e,this.setScope();var t=this.scope&&this.scope.file;if(t)if(n)for(var r=0;r<e.length;r++)t.checkNode(e[r],this.scope);else t.checkNode(e,this.scope);n&&(u(s.STATEMENT_OR_BLOCK_KEYS,this.key)&&!s.isBlockStatement(this.container)&&s.ensureBlock(this.container,this.key),this.flatten())},configurable:!0}}),e}();n.exports=i;for(var c=0;c<s.TYPES.length;c++)!function(){var e=s.TYPES[c],n="is"+e;i.prototype[n]=function(e){return s[n](this.node,e)}}()},{"../types":122,"./index":117,"./scope":119,"lodash/collection/includes":205}],119:[function(e,n){"use strict";var l=function(e){return e&&e.__esModule?e:{"default":e}},t=function(e){return e&&e.__esModule?e["default"]:e},r=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},a=t(e("lodash/collection/includes")),u=t(e("./index")),o=t(e("lodash/object/defaults")),s=l(e("../messages")),i=t(e("globals")),c=t(e("lodash/array/flatten")),p=t(e("lodash/object/extend")),d=t(e("../helpers/object")),f=t(e("lodash/collection/each")),h=t(e("../types")),g={enter:function(e,n,l,t){return h.isFor(e)&&f(h.FOR_INIT_KEYS,function(n){var l=e[n];h.isVar(l)&&t.scope.registerBinding("var",l)}),h.isFunction(e)?this.skip():void(t.blockId&&e===t.blockId||h.isBlockScoped(e)||h.isExportDeclaration(e)&&h.isDeclaration(e.declaration)||h.isDeclaration(e)&&t.scope.registerDeclaration(e))}},m={enter:function(e,n,l,t){h.isReferencedIdentifier(e,n)&&!l.hasBinding(e.name)?t.addGlobal(e):h.isLabeledStatement(e)?t.addGlobal(e):(h.isAssignmentExpression(e)||h.isUpdateExpression(e)||h.isUnaryExpression(e)&&"delete"===e.operator)&&l.registerBindingReassignment(e)}},y={enter:function(e,n,l,t){h.isFunctionDeclaration(e)||h.isBlockScoped(e)?t.registerDeclaration(e):h.isScope(e,n)&&this.skip()}},_=function(){function e(n,l,t,a){r(this,e),this.parent=t,this.file=t?t.file:a,this.parentBlock=l,this.block=n,this.crawl()}return e.globals=c([i.builtin,i.browser,i.node].map(Object.keys)),e.contextVariables=["this","arguments"],e.prototype.traverse=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(e,n,l){u(e,n,this,l)}),e.prototype.generateTemp=function(e){var n=this.generateUidIdentifier(e||"temp");return this.push({key:n.name,id:n}),n},e.prototype.generateUidIdentifier=function(e){var n=h.identifier(this.generateUid(e));return this.getFunctionParent().registerBinding("uid",n),n},e.prototype.generateUid=function(e){e=h.toIdentifier(e).replace(/^_+/,"");var n,l=0;do n=this._generateUid(e,l),l++;while(this.hasBinding(n)||this.hasGlobal(n));return n},e.prototype._generateUid=function(e,n){var l=e;return n>1&&(l+=n),"_"+l},e.prototype.generateUidBasedOnNode=function(e){var n=e;h.isAssignmentExpression(e)?n=e.left:h.isVariableDeclarator(e)?n=e.id:h.isProperty(n)&&(n=n.key);var l=[],t=function(e){var n=function(){return e.apply(this,arguments)};return n.toString=function(){return e.toString()},n}(function(e){h.isMemberExpression(e)?(t(e.object),t(e.property)):h.isIdentifier(e)?l.push(e.name):h.isLiteral(e)?l.push(e.value):h.isCallExpression(e)&&t(e.callee)});t(n);var r=l.join("$");return r=r.replace(/^_/,"")||"ref",this.generateUidIdentifier(r)},e.prototype.generateTempBasedOnNode=function(e){if(h.isIdentifier(e)&&this.hasBinding(e.name))return null;var n=this.generateUidBasedOnNode(e);return this.push({key:n.name,id:n}),n},e.prototype.checkBlockScopedCollisions=function(e,n,l){var t=this.getOwnBindingInfo(n);if(t&&"param"!==e&&!("hoisted"===e&&"let"===t.kind||"let"!==t.kind&&"const"!==t.kind&&"module"!==t.kind))throw this.file.errorWithNode(l,s.get("scopeDuplicateDeclaration",n),TypeError)},e.prototype.rename=function(e,n){n||(n=this.generateUidIdentifier(e).name);var l=this.getBindingInfo(e);if(l){var t=l.identifier,r=l.scope;r.traverse(r.block,{enter:function(l,r,a){if(h.isReferencedIdentifier(l,r)&&l.name===e)l.name=n;else if(h.isDeclaration(l)){var u=h.getBindingIdentifiers(l);for(var o in u)o===e&&(u[o].name=n)}else h.isScope(l,r)&&(a.bindingIdentifierEquals(e,t)||this.skip())}}),this.clearOwnBinding(e),r.bindings[n]=l,t.name=n}},e.prototype.inferType=function(e){var n;if(h.isVariableDeclarator(e)&&(n=e.init),h.isArrayExpression(n))return h.genericTypeAnnotation(h.identifier("Array"));if(!h.isObjectExpression(n)&&!h.isLiteral(n)){if(h.isCallExpression(n)&&h.isIdentifier(n.callee)){var l=this.getBindingInfo(n.callee.name);if(l){var t=l.node;return!l.reassigned&&h.isFunction(t)&&e.returnType}}h.isIdentifier(n)}},e.prototype.isTypeGeneric=function(e,n){var l=this.getBindingInfo(e);if(!l)return!1;var t=l.typeAnnotation;return h.isGenericTypeAnnotation(t)&&h.isIdentifier(t.id,{name:n})},e.prototype.assignTypeGeneric=function(e,n){this.assignType(e,h.genericTypeAnnotation(h.identifier(n)))},e.prototype.assignType=function(e,n){var l=this.getBindingInfo(e);l&&(l.typeAnnotation=n)},e.prototype.getTypeAnnotation=function(e,n,l){var t,r={annotation:null,inferred:!1};return n.typeAnnotation&&(t=n.typeAnnotation),t||(r.inferred=!0,t=this.inferType(l)),t&&(h.isTypeAnnotation(t)&&(t=t.typeAnnotation),r.annotation=t),r},e.prototype.toArray=function(e,n){var l=this.file;if(h.isIdentifier(e)&&this.isTypeGeneric(e.name,"Array"))return e;if(h.isArrayExpression(e))return e;if(h.isIdentifier(e,{name:"arguments"}))return h.callExpression(h.memberExpression(l.addHelper("slice"),h.identifier("call")),[e]);var t="to-array",r=[e];return n===!0?t="to-consumable-array":n&&(r.push(h.literal(n)),t="sliced-to-array"),h.callExpression(l.addHelper(t),r)},e.prototype.clearOwnBinding=function(e){delete this.bindings[e]},e.prototype.registerDeclaration=function(e){if(h.isFunctionDeclaration(e))this.registerBinding("hoisted",e);else if(h.isVariableDeclaration(e))for(var n=0;n<e.declarations.length;n++)this.registerBinding(e.kind,e.declarations[n]);else h.isClassDeclaration(e)?this.registerBinding("let",e):h.isImportDeclaration(e)||h.isExportDeclaration(e)?this.registerBinding("module",e):this.registerBinding("unknown",e)},e.prototype.registerBindingReassignment=function(e){var n=h.getBindingIdentifiers(e);for(var l in n){var t=this.getBindingInfo(l);t&&(t.reassigned=!0,t.typeAnnotationInferred&&(t.typeAnnotation=null))}},e.prototype.registerBinding=function(e,n){if(!e)throw new ReferenceError("no `kind`");var l=h.getBindingIdentifiers(n);for(var t in l){var r=l[t];this.checkBlockScopedCollisions(e,t,r);var a=this.getTypeAnnotation(t,r,n);this.bindings[t]={typeAnnotationInferred:a.inferred,typeAnnotation:a.annotation,reassigned:!1,identifier:r,scope:this,node:n,kind:e}}},e.prototype.registerVariableDeclaration=function(e){for(var n=e.declarations,l=0;l<n.length;l++)this.registerBinding(e.kind,n[l])},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasGlobal=function(e){var n=this;do if(n.globals[e])return!0;while(n=n.parent);return!1},e.prototype.crawl=function(){var e,n=this.block,l=n._scopeInfo;if(l)return void p(this,l);if(l=n._scopeInfo={bindings:d(),globals:d()},p(this,l),h.isLoop(n)){for(e=0;e<h.FOR_INIT_KEYS.length;e++){var t=n[h.FOR_INIT_KEYS[e]];h.isBlockScoped(t)&&this.registerBinding("let",t)}h.isBlockStatement(n.body)&&(n=n.body)}if(h.isFunctionExpression(n)&&n.id&&(h.isProperty(this.parentBlock,{method:!0})||this.registerBinding("var",n.id)),h.isFunction(n)){for(e=0;e<n.params.length;e++)this.registerBinding("param",n.params[e]);this.traverse(n.body,y,this)}(h.isBlockStatement(n)||h.isProgram(n))&&this.traverse(n,y,this),h.isCatchClause(n)&&this.registerBinding("let",n.param),h.isComprehensionExpression(n)&&this.registerBinding("let",n),(h.isProgram(n)||h.isFunction(n))&&this.traverse(n,g,{blockId:n.id,scope:this}),h.isProgram(n)&&this.traverse(n,m,this)},e.prototype.push=function(e){var n=this.block;if((h.isLoop(n)||h.isCatchClause(n)||h.isFunction(n))&&(h.ensureBlock(n),n=n.body),!h.isBlockStatement(n)&&!h.isProgram(n))throw new TypeError("cannot add a declaration here in node type "+n.type);var l=n;l._declarations||(l._declarations={}),n._declarations[e.key]={kind:e.kind||"var",id:e.id,init:e.init}},e.prototype.getFunctionParent=function(){for(var e=this;e.parent&&!h.isFunction(e.block);)e=e.parent;return e},e.prototype.getAllBindings=function(){var e=d(),n=this;do o(e,n.bindings),n=n.parent;while(n);return e},e.prototype.getAllBindingsOfKind=function(e){var n=d(),l=this;do{for(var t in l.bindings){var r=l.bindings[t];r.kind===e&&(n[t]=r)}l=l.parent}while(l);return n},e.prototype.bindingIdentifierEquals=function(e,n){return this.getBindingIdentifier(e)===n},e.prototype.getBindingInfo=function(e){var n=this;do{var l=n.getOwnBindingInfo(e);if(l)return l}while(n=n.parent)},e.prototype.getOwnBindingInfo=function(e){return this.bindings[e]},e.prototype.getBindingIdentifier=function(e){var n=this.getBindingInfo(e);return n&&n.identifier},e.prototype.getOwnBindingIdentifier=function(e){var n=this.bindings[e];return n&&n.identifier},e.prototype.getOwnImmutableBindingValue=function(e){return this._immutableBindingInfoToValue(this.getOwnBindingInfo(e))},e.prototype.getImmutableBindingValue=function(e){return this._immutableBindingInfoToValue(this.getBindingInfo(e))},e.prototype._immutableBindingInfoToValue=function(e){if(e&&!e.reassigned){var n=e.node;if(h.isVariableDeclarator(n)){if(!h.isIdentifier(n.id))return;n=n.init}return h.isImmutable(n)?n:void 0}},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBindingInfo(e)},e.prototype.hasBinding=function(n){return n?this.hasOwnBinding(n)?!0:this.parentHasBinding(n)?!0:a(e.globals,n)?!0:a(e.contextVariables,n)?!0:!1:!1},e.prototype.parentHasBinding=function(e){return this.parent&&this.parent.hasBinding(e)},e}();n.exports=_},{"../helpers/object":24,"../messages":26,"../types":122,"./index":117,globals:188,"lodash/array/flatten":197,"lodash/collection/each":202,"lodash/collection/includes":205,"lodash/object/defaults":302,"lodash/object/extend":303}],120:[function(e,n){n.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While","Scopable"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While","Scopable"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration","ModuleDeclaration"],ImportDeclaration:["Statement","Declaration","ModuleDeclaration"],PrivateDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scopable","Function","Expression"],FunctionDeclaration:["Scopable","Function","Statement","Declaration"],FunctionExpression:["Scopable","Function","Expression"],ImportSpecifier:["ModuleSpecifier"],ExportSpecifier:["ModuleSpecifier"],BlockStatement:["Statement","Scopable"],Program:["Scopable"],CatchClause:["Scopable"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class","Expression"],ForOfStatement:["Scopable","Statement","For","Loop"],ForInStatement:["Scopable","Statement","For","Loop"],ForStatement:["Scopable","Statement","For","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],AssignmentPattern:["Pattern"],Property:["UserWhitespacable"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],AwaitExpression:["Expression"],BindFunctionExpression:["Expression"],BindMemberExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression","Scopable"],ConditionalExpression:["Expression"],Identifier:["Expression"],Literal:["Expression"],MemberExpression:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],UpdateExpression:["Expression"],VirtualPropertyExpression:["Expression"],JSXEmptyExpression:["Expression"],JSXMemberExpression:["Expression"],YieldExpression:["Expression"],AnyTypeAnnotation:["Flow"],ArrayTypeAnnotation:["Flow"],BooleanTypeAnnotation:["Flow"],ClassImplements:["Flow"],DeclareClass:["Flow"],DeclareFunction:["Flow"],DeclareModule:["Flow"],DeclareVariable:["Flow"],FunctionTypeAnnotation:["Flow"],FunctionTypeParam:["Flow"],GenericTypeAnnotation:["Flow"],InterfaceExtends:["Flow"],InterfaceDeclaration:["Flow"],IntersectionTypeAnnotation:["Flow"],NullableTypeAnnotation:["Flow"],NumberTypeAnnotation:["Flow"],StringLiteralTypeAnnotation:["Flow"],StringTypeAnnotation:["Flow"],TupleTypeAnnotation:["Flow"],TypeofTypeAnnotation:["Flow"],TypeAlias:["Flow"],TypeAnnotation:["Flow"],TypeCastExpression:["Flow"],TypeParameterDeclaration:["Flow"],TypeParameterInstantiation:["Flow"],ObjectTypeAnnotation:["Flow"],ObjectTypeCallProperty:["Flow"],ObjectTypeIndexer:["Flow"],ObjectTypeProperty:["Flow"],QualifiedTypeIdentifier:["Flow"],UnionTypeAnnotation:["Flow"],VoidTypeAnnotation:["Flow"],JSXAttribute:["JSX"],JSXClosingElement:["JSX"],JSXElement:["JSX","Expression"],JSXEmptyExpression:["JSX"],JSXExpressionContainer:["JSX"],JSXIdentifier:["JSX"],JSXMemberExpression:["JSX"],JSXNamespacedName:["JSX"],JSXOpeningElement:["JSX"],JSXSpreadAttribute:["JSX"]}},{}],121:[function(e,n){n.exports={ArrayExpression:{elements:null},ArrowFunctionExpression:{params:null,body:null},AssignmentExpression:{operator:null,left:null,right:null},BinaryExpression:{operator:null,left:null,right:null},BlockStatement:{body:null},CallExpression:{callee:null,arguments:null},ConditionalExpression:{test:null,consequent:null,alternate:null},ExpressionStatement:{expression:null},File:{program:null,comments:null,tokens:null},FunctionExpression:{id:null,params:null,body:null,generator:!1},FunctionDeclaration:{id:null,params:null,body:null,generator:!1},GenericTypeAnnotation:{id:null,typeParameters:null},Identifier:{name:null},IfStatement:{test:null,consequent:null,alternate:null},ImportDeclaration:{specifiers:null,source:null},ImportSpecifier:{id:null,name:null},LabeledStatement:{label:null,body:null},Literal:{value:null},LogicalExpression:{operator:null,left:null,right:null},MemberExpression:{object:null,property:null,computed:!1},MethodDefinition:{key:null,value:null,computed:!1,"static":!1,kind:null},NewExpression:{callee:null,arguments:null},ObjectExpression:{properties:null},Program:{body:null},Property:{kind:null,key:null,value:null,computed:!1},ReturnStatement:{argument:null},SequenceExpression:{expressions:null},TemplateLiteral:{quasis:null,expressions:null},ThrowExpression:{argument:null},UnaryExpression:{operator:null,argument:null,prefix:null},VariableDeclaration:{kind:null,declarations:null},VariableDeclarator:{id:null,init:null},WithStatement:{object:null,body:null},YieldExpression:{argument:null,delegate:null}}},{}],122:[function(e,n){"use strict";function l(e,n){var l=h["is"+e]=function(l,t){return h.is(e,l,t,n)};h["assert"+e]=function(n,t){if(t||(t={}),!l(n,t))throw new Error("Expected type "+JSON.stringify(e)+" with option "+JSON.stringify(t))}}var t=function(e){return e&&e.__esModule?e["default"]:e},r=t(e("to-fast-properties")),a=t(e("lodash/lang/isPlainObject")),u=t(e("lodash/lang/isNumber")),o=t(e("lodash/lang/isRegExp")),s=t(e("lodash/lang/isString")),i=t(e("lodash/array/compact")),c=t(e("esutils")),p=t(e("../helpers/object")),d=(t(e("lodash/lang/clone")),t(e("lodash/collection/each"))),f=t(e("lodash/array/uniq")),h={};n.exports=h,h.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"],h.NATIVE_TYPE_NAMES=["Array","Object","Number","Boolean","Date","Array","String"],h.FOR_INIT_KEYS=["left","init"],h.VISITOR_KEYS=e("./visitor-keys"),h.ALIAS_KEYS=e("./alias-keys"),h.FLIPPED_ALIAS_KEYS={},d(h.VISITOR_KEYS,function(e,n){l(n,!0)}),d(h.ALIAS_KEYS,function(e,n){d(e,function(e){var l,t,r=(l=h.FLIPPED_ALIAS_KEYS,t=e,!l[t]&&(l[t]=[]),l[t]);r.push(n)})}),d(h.FLIPPED_ALIAS_KEYS,function(e,n){h[n.toUpperCase()+"_TYPES"]=e,l(n,!1)}),h.TYPES=Object.keys(h.VISITOR_KEYS).concat(Object.keys(h.FLIPPED_ALIAS_KEYS)),h.is=function(e,n,l,t){if(!n)return!1;var r=e===n.type;if(!r&&!t){var a=h.FLIPPED_ALIAS_KEYS[e];"undefined"!=typeof a&&(r=a.indexOf(n.type)>-1)}return r?"undefined"!=typeof l?h.shallowEqual(n,l):!0:!1},h.BUILDER_KEYS=e("./builder-keys"),d(h.VISITOR_KEYS,function(e,n){if(!h.BUILDER_KEYS[n]){var l={};d(e,function(e){l[e]=null}),h.BUILDER_KEYS[n]=l}}),d(h.BUILDER_KEYS,function(e,n){h[n[0].toLowerCase()+n.slice(1)]=function(){var l={};l.start=null,l.type=n;var t=0;for(var r in e){var a=arguments[t++];void 0===a&&(a=e[r]),l[r]=a}return l}}),h.toComputedKey=function(e,n){return e.computed||h.isIdentifier(n)&&(n=h.literal(n.name)),n},h.isFalsyExpression=function(e){return h.isLiteral(e)?!e.value:h.isIdentifier(e)?"undefined"===e.name:!1},h.toSequenceExpression=function(e,n){var l=[];return d(e,function(e){h.isExpression(e)&&l.push(e),h.isExpressionStatement(e)?l.push(e.expression):h.isVariableDeclaration(e)&&d(e.declarations,function(t){n.push({kind:e.kind,key:t.id.name,id:t.id}),l.push(h.assignmentExpression("=",t.id,t.init))})}),1===l.length?l[0]:h.sequenceExpression(l)},h.shallowEqual=function(e,n){for(var l=Object.keys(n),t=0;t<l.length;t++){var r=l[t];if(e[r]!==n[r])return!1}return!0},h.appendToMemberExpression=function(e,n,l){return e.object=h.memberExpression(e.object,e.property,e.computed),e.property=n,e.computed=!!l,e},h.prependToMemberExpression=function(e,n){return e.object=h.memberExpression(n,e.object),e},h.isReferenced=function(e,n){if(h.isMemberExpression(n))return n.property===e&&n.computed?!0:n.object===e?!0:!1;if(h.isProperty(n)&&n.key===e)return n.computed;if(h.isVariableDeclarator(n))return n.id!==e;if(h.isFunction(n)){for(var l=0;l<n.params.length;l++){var t=n.params[l];if(t===e)return!1}return n.id!==e}return h.isExportSpecifier(n,{name:e})?!1:h.isImportSpecifier(n,{id:e})?!1:h.isClass(n)?n.id!==e:h.isMethodDefinition(n)?n.key===e&&n.computed:h.isLabeledStatement(n)?!1:h.isCatchClause(n)?n.param!==e:h.isRestElement(n)?!1:h.isAssignmentPattern(n)?n.right===e:h.isPattern(n)?!1:h.isImportSpecifier(n)?!1:h.isImportBatchSpecifier(n)?!1:h.isPrivateDeclaration(n)?!1:!0},h.isReferencedIdentifier=function(e,n,l){return h.isIdentifier(e,l)&&h.isReferenced(e,n)},h.isValidIdentifier=function(e){return s(e)&&c.keyword.isIdentifierName(e)&&!c.keyword.isReservedWordES6(e,!0)},h.toIdentifier=function(e){return h.isIdentifier(e)?e.name:(e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""}),h.isValidIdentifier(e)||(e="_"+e),e||"_")},h.ensureBlock=function(e,n){return n||(n="body"),e[n]=h.toBlock(e[n],e)},h.clone=function(e){var n={};for(var l in e)"_"!==l[0]&&(n[l]=e[l]);return n},h.cloneDeep=function(e){var n={};for(var l in e){var t=e[l];t&&(t.type?t=h.cloneDeep(t):Array.isArray(t)&&(t=t.map(h.cloneDeep))),n[l]=t}return n},h.buildMatchMemberExpression=function(e,n){var l=e.split(".");return function(e){if(!h.isMemberExpression(e))return!1;for(var t=[e],r=0;t.length;){var a=t.shift();if(n&&r===l.length)return!0;if(h.isIdentifier(a)){if(l[r]!==a.name)return!1}else{if(!h.isLiteral(a)){if(h.isMemberExpression(a)){if(a.computed&&!h.isLiteral(a.property))return!1;t.push(a.object),t.push(a.property);continue}return!1}if(l[r]!==a.value)return!1}if(++r>l.length)return!1}return!0}},h.toStatement=function(e,n){if(h.isStatement(e))return e;var l,t=!1;if(h.isClass(e))t=!0,l="ClassDeclaration";else if(h.isFunction(e))t=!0,l="FunctionDeclaration";else if(h.isAssignmentExpression(e))return h.expressionStatement(e);if(t&&!e.id&&(l=!1),!l){if(n)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=l,e},h.toExpression=function(e){if(h.isExpressionStatement(e)&&(e=e.expression),h.isClass(e)?e.type="ClassExpression":h.isFunction(e)&&(e.type="FunctionExpression"),h.isExpression(e))return e;throw new Error("cannot turn "+e.type+" to an expression")},h.toBlock=function(e,n){return h.isBlockStatement(e)?e:(h.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(h.isStatement(e)||(e=h.isFunction(n)?h.returnStatement(e):h.expressionStatement(e)),e=[e]),h.blockStatement(e))},h.getBindingIdentifiers=function(e){for(var n=[].concat(e),l=p();n.length;){var t=n.shift();if(t){var r=h.getBindingIdentifiers.keys[t.type];if(h.isIdentifier(t))l[t.name]=t;else if(h.isImportSpecifier(t))n.push(t.name||t.id);else if(h.isExportDeclaration(t))h.isDeclaration(e.declaration)&&n.push(e.declaration);else if(r)for(var a=0;a<r.length;a++){var u=r[a];n=n.concat(t[u]||[])}}}return l},h.getBindingIdentifiers.keys={UnaryExpression:["argument"],AssignmentExpression:["left"],ImportBatchSpecifier:["name"],VariableDeclarator:["id"],FunctionDeclaration:["id"],ClassDeclaration:["id"],SpreadElement:["argument"],RestElement:["argument"],UpdateExpression:["argument"],SpreadProperty:["argument"],Property:["value"],ComprehensionBlock:["left"],AssignmentPattern:["left"],PrivateDeclaration:["declarations"],ComprehensionExpression:["blocks"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]},h.isLet=function(e){return h.isVariableDeclaration(e)&&("var"!==e.kind||e._let)},h.isBlockScoped=function(e){return h.isFunctionDeclaration(e)||h.isClassDeclaration(e)||h.isLet(e)},h.isVar=function(e){return h.isVariableDeclaration(e,{kind:"var"})&&!e._let},h.COMMENT_KEYS=["leadingComments","trailingComments"],h.removeComments=function(e){return d(h.COMMENT_KEYS,function(n){delete e[n]}),e},h.inheritsComments=function(e,n){return d(h.COMMENT_KEYS,function(l){e[l]=f(i([].concat(e[l],n[l])))}),e},h.inherits=function(e,n){return e._declarations=n._declarations,e._scopeInfo=n._scopeInfo,e.range=n.range,e.start=n.start,e.loc=n.loc,e.end=n.end,e.typeAnnotation=n.typeAnnotation,e.returnType=n.returnType,h.inheritsComments(e,n),e},h.getLastStatements=function(e){var n=[],l=function(e){n=n.concat(h.getLastStatements(e))};return h.isIfStatement(e)?(l(e.consequent),l(e.alternate)):h.isFor(e)||h.isWhile(e)?l(e.body):h.isProgram(e)||h.isBlockStatement(e)?l(e.body[e.body.length-1]):e&&n.push(e),n},h.getSpecifierName=function(e){return e.name||e.id},h.getSpecifierId=function(e){return e["default"]?h.identifier("default"):e.id},h.isSpecifierDefault=function(e){return e["default"]||h.isIdentifier(e.id)&&"default"===e.id.name},h.isScope=function(e,n){if(h.isBlockStatement(e)){if(h.isLoop(n.block,{body:e}))return!1;if(h.isFunction(n.block,{body:e}))return!1}return h.isScopable(e)},h.isImmutable=function(e){return h.isLiteral(e)?e.regex?!1:!0:h.isIdentifier(e)&&"undefined"===e.name?!0:!1},h.evaluateTruthy=function(e,n){var l=h.evaluate(e,n);return l.confident?!!l.value:void 0},h.evaluate=function(e,n){function l(e){if(t){if(h.isSequenceExpression(e))return l(e.expressions[e.expressions.length-1]);if(h.isLiteral(e)&&(!e.regex||null!==e.value))return e.value;if(h.isConditionalExpression(e))return l(l(e.test)?e.consequent:e.alternate);if(h.isIdentifier(e))return"undefined"===e.name?void 0:l(n.getImmutableBindingValue(e.name));if(h.isUnaryExpression(e,{prefix:!0})){var r=l(e.argument);switch(e.operator){case"void":return void 0;case"!":return!r;case"+":return+r;case"-":return-r}}if(h.isArrayExpression(e)||h.isObjectExpression(e),h.isLogicalExpression(e)){var a=l(e.left),u=l(e.right);switch(e.operator){case"||":return a||u;case"&&":return a&&u}}if(h.isBinaryExpression(e)){var a=l(e.left),u=l(e.right);switch(e.operator){case"-":return a-u;case"+":return a+u;case"/":return a/u;case"*":return a*u;case"%":return a%u;case"<":return u>a;case">":return a>u;case"<=":return u>=a;case">=":return a>=u;case"==":return a==u;case"!=":return a!=u;case"===":return a===u;case"!==":return a!==u}}t=!1}}var t=!0,r=l(e);return t||(r=void 0),{confident:t,value:r}},h.valueToNode=function(e){if(void 0===e)return h.identifier("undefined");if(e===!0||e===!1||null===e||s(e)||u(e)||o(e))return h.literal(e);if(Array.isArray(e))return h.arrayExpression(e.map(h.valueToNode));if(a(e)){var n=[];for(var l in e){var t;t=h.isValidIdentifier(l)?h.identifier(l):h.literal(l),n.push(h.property("init",t,h.valueToNode(e[l])))}return h.objectExpression(n)}throw new Error("don't know how to turn this value into a node")},r(h),r(h.VISITOR_KEYS)},{"../helpers/object":24,"./alias-keys":120,"./builder-keys":121,"./visitor-keys":123,esutils:186,"lodash/array/compact":196,"lodash/array/uniq":200,"lodash/collection/each":202,"lodash/lang/clone":287,"lodash/lang/isNumber":295,"lodash/lang/isPlainObject":297,"lodash/lang/isRegExp":298,"lodash/lang/isString":299,"to-fast-properties":344}],123:[function(e,n){n.exports={ArrayExpression:["elements"],ArrayPattern:["elements","typeAnnotation"],ArrowFunctionExpression:["params","defaults","rest","body","returnType"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindFunctionExpression:["callee","arguments"],BindMemberExpression:["object","property","arguments"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass","typeParameters","superTypeParameters","implements"],ClassExpression:["id","body","superClass","typeParameters","superTypeParameters","implements"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body","returnType","typeParameters"],FunctionExpression:["id","params","defaults","rest","body","returnType","typeParameters"],Identifier:["typeAnnotation"],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties","typeAnnotation"],PrivateDeclaration:["declarations"],Program:["body"],Property:["key","value"],RestElement:["argument","typeAnnotation"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],VirtualPropertyExpression:["object","property"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],ClassImplements:["id","typeParameters"],ClassProperty:["key","value","typeAnnotation"],DeclareClass:["id","typeParameters","extends","body"],DeclareFunction:["id"],DeclareModule:["id","body"],DeclareVariable:["id"],FunctionTypeAnnotation:["typeParameters","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],IntersectionTypeAnnotation:["types"],NullableTypeAnnotation:["typeAnnotation"],NumberTypeAnnotation:[],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],TupleTypeAnnotation:["types"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],ObjectTypeAnnotation:["key","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value"],ObjectTypeProperty:["key","value"],QualifiedTypeIdentifier:["id","qualification"],UnionTypeAnnotation:["types"],VoidTypeAnnotation:[],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","closingElement","children"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXSpreadAttribute:["argument"]}},{}],124:[function(e,n,l){(function(n){"use strict";function t(e,n){var l=n||t.EXTENSIONS,r=E.extname(e);return _(l,r)}function r(n){try{return e.resolve(n)}catch(l){return null}}function a(e){return e?e.split(","):[]}function u(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=e.join("|")),b(e))return new RegExp(e);if(v(e))return e;throw new TypeError("illegal type for regexify")}function o(e){if(!e)return[];if(m(e))return[e];if(b(e))return a(e);if(Array.isArray(e))return e;throw new TypeError("illegal type for arrayify")}function s(e){return"true"===e?!0:"false"===e?!1:e}function i(e,n,t){var r=l.templates[e];if(!r)throw new ReferenceError("unknown template "+e);if(n===!0&&(t=!0,n=null),r=g(r),I(n)||x(r,M,null,n),r.body.length>1)return r.body;var a=r.body[0];return!t&&C.isExpressionStatement(a)?a.expression:a}function c(e,n){var l=w({filename:e},n).program;return l=x.removeProperties(l)}function p(){var e={},l=E.join(n,"transformation/templates");if(!S.existsSync(l))throw new ReferenceError(y.get("missingTemplatesDirectory"));return k(S.readdirSync(l),function(n){if("."!==n[0]){var t=E.basename(n,E.extname(n)),r=E.join(l,n),a=S.readFileSync(r,"utf8");e[t]=c(r,a)}}),e}var d=function(e){return e&&e.__esModule?e:{"default":e}},f=function(e){return e&&e.__esModule?e["default"]:e};l.canCompile=t,l.resolve=r,l.list=a,l.regexify=u,l.arrayify=o,l.booleanify=s,l.template=i,l.parseTemplate=c,e("./patch");var h=f(e("debug/node")),g=f(e("lodash/lang/cloneDeep")),m=f(e("lodash/lang/isBoolean")),y=d(e("./messages")),_=f(e("lodash/collection/contains")),x=f(e("./traversal")),b=f(e("lodash/lang/isString")),v=f(e("lodash/lang/isRegExp")),I=f(e("lodash/lang/isEmpty")),w=f(e("./helpers/parse")),E=f(e("path")),k=f(e("lodash/collection/each")),R=f(e("lodash/object/has")),S=f(e("fs")),C=f(e("./types")),A=e("util");
l.inherits=A.inherits,l.inspect=A.inspect;l.debug=h("babel");t.EXTENSIONS=[".js",".jsx",".es6",".es"];var M={enter:function(e,n,l,t){return C.isExpressionStatement(e)&&(e=e.expression),C.isIdentifier(e)&&R(t,e.name)?(this.skip(),t[e.name]):void 0}};try{l.templates=e("../../templates.json")}catch(j){if("MODULE_NOT_FOUND"!==j.code)throw j;l.templates=p()}l.__esModule=!0}).call(this,"/lib/babel")},{"../../templates.json":347,"./helpers/parse":25,"./messages":26,"./patch":27,"./traversal":117,"./types":122,"debug/node":179,fs:140,"lodash/collection/contains":201,"lodash/collection/each":202,"lodash/lang/cloneDeep":288,"lodash/lang/isBoolean":291,"lodash/lang/isEmpty":292,"lodash/lang/isRegExp":298,"lodash/lang/isString":299,"lodash/object/has":304,path:150,util:167}],125:[function(n,l,t){!function(n,r){return"object"==typeof t&&"object"==typeof l?r(t):"function"==typeof e&&e.amd?e(["exports"],r):void r(n.acorn||(n.acorn={}))}(this,function(e){"use strict";function n(e){_t={};for(var n in It)_t[n]=e&&cn(e,n)?e[n]:It[n];if(vt=_t.sourceFile||null,wt(_t.onToken)){var l=_t.onToken;_t.onToken=function(e){l.push(e)}}if(wt(_t.onComment)){var t=_t.onComment;_t.onComment=function(e,n,l,r,a,u){var o={type:e?"Block":"Line",value:n,start:l,end:r};_t.locations&&(o.loc=new Y,o.loc.start=a,o.loc.end=u),_t.ranges&&(o.range=[l,r]),t.push(o)}}ka=_t.ecmaVersion>=6?Ea:wa}function l(){this.type=Mt,this.value=jt,this.start=Rt,this.end=St,_t.locations&&(this.loc=new Y,this.loc.end=At),_t.ranges&&(this.range=[Rt,St])}function t(){Dt=Ft=kt,_t.locations&&(Bt=o()),Nt=Vt=Ut=!1,qt=[],h(),k()}function r(e,n){var l=Et(xt,e);n+=" ("+l.line+":"+l.column+")";var t=new SyntaxError(n);throw t.pos=e,t.loc=l,t.raisedAt=kt,t}function a(e){return 10===e||13===e||8232===e||8233==e}function u(e,n){this.line=e,this.column=n}function o(){return new u(Lt,kt-Ot)}function s(e){e?(kt=e,Ot=Math.max(0,xt.lastIndexOf("\n",e)),Lt=xt.slice(0,Ot).split(Pa).length):(Lt=1,kt=Ot=0),Mt=$t,Tt=[Fa],Pt=!0,Wt=Gt=!1,0===kt&&_t.allowHashBang&&"#!"===xt.slice(0,2)&&f(2)}function i(){return Tt[Tt.length-1]}function c(e){var n;return e===qr&&"{"==(n=i()).token?!n.isExpr:e===fr?Pa.test(xt.slice(Ft,Rt)):e===sr||e===Ur||e===$t?!0:e==Dr?i()===Fa:!Pt}function p(e,n){St=kt,_t.locations&&(At=o());var l=Mt,t=!1;if(Mt=e,jt=n,e===Nr||e===Fr){var r=Tt.pop();r===Na?t=Pt=!0:r===Fa&&i()===Ga?(Tt.pop(),Pt=!1):Pt=!(r&&r.isExpr)}else if(e===Dr){switch(i()){case Ha:Tt.push(Ba);break;case Ja:Tt.push(Na);break;default:Tt.push(c(l)?Fa:Ba)}Pt=!0}else if(e===zr)Tt.push(Na),Pt=!0;else if(e==Br){var a=l===dr||l===cr||l===vr||l===br;Tt.push(a?Va:Ua),Pt=!0}else if(e==la);else if(e.keyword&&l==Gr)Pt=!1;else if(e==pr)i()!==Fa&&Tt.push(Ga),Pt=!1;else if(e===Xr)i()===qa?Tt.pop():(Tt.push(qa),t=!0),Pt=!1;else if(e===ma)Tt.push(Ja),Tt.push(Ha),Pt=!1;else if(e===ya){var r=Tt.pop();r===Ha&&l===Zr||r===Wa?(Tt.pop(),t=Pt=i()===Ja):t=Pt=!0}else e===Kr?t=Pt=!0:e===Zr&&l===ma?(Tt.length-=2,Tt.push(Wa),Pt=!1):Pt=e.beforeExpr;t||h()}function d(){var e=_t.onComment&&_t.locations&&o(),n=kt,l=xt.indexOf("*/",kt+=2);if(-1===l&&r(kt-2,"Unterminated comment"),kt=l+2,_t.locations){La.lastIndex=n;for(var t;(t=La.exec(xt))&&t.index<kt;)++Lt,Ot=t.index+t[0].length}_t.onComment&&_t.onComment(!0,xt.slice(n+2,l),n,kt,e,_t.locations&&o())}function f(e){for(var n=kt,l=_t.onComment&&_t.locations&&o(),t=xt.charCodeAt(kt+=e);bt>kt&&10!==t&&13!==t&&8232!==t&&8233!==t;)++kt,t=xt.charCodeAt(kt);_t.onComment&&_t.onComment(!1,xt.slice(n+e,kt),n,kt,l,_t.locations&&o())}function h(){for(;bt>kt;){var e=xt.charCodeAt(kt);if(32===e)++kt;else if(13===e){++kt;var n=xt.charCodeAt(kt);10===n&&++kt,_t.locations&&(++Lt,Ot=kt)}else if(10===e||8232===e||8233===e)++kt,_t.locations&&(++Lt,Ot=kt);else if(e>8&&14>e)++kt;else if(47===e){var n=xt.charCodeAt(kt+1);if(42===n)d();else{if(47!==n)break;f(2)}}else if(160===e)++kt;else{if(!(e>=5760&&Ra.test(String.fromCharCode(e))))break;++kt}}}function g(){var e=xt.charCodeAt(kt+1);if(e>=48&&57>=e)return M(!0);var n=xt.charCodeAt(kt+2);return _t.ecmaVersion>=6&&46===e&&46===n?(kt+=3,p(Yr)):(++kt,p(Gr))}function m(){var e=xt.charCodeAt(kt+1);return Pt?(++kt,S()):61===e?R(na,2):R(Zr,1)}function y(){var e=xt.charCodeAt(kt+1);return 61===e?R(na,2):R(fa,1)}function _(){var e=ha,n=1,l=xt.charCodeAt(kt+1);return _t.ecmaVersion>=7&&42===l&&(n++,l=xt.charCodeAt(kt+2),e=ga),61===l&&(n++,e=na),R(e,n)}function x(e){var n=xt.charCodeAt(kt+1);return n===e?_t.playground&&61===xt.charCodeAt(kt+2)?R(na,3):R(124===e?ra:aa,2):61===n?R(na,2):R(124===e?ua:sa,1)}function b(){var e=xt.charCodeAt(kt+1);return 61===e?R(na,2):R(oa,1)}function v(e){var n=xt.charCodeAt(kt+1);return n===e?45==n&&62==xt.charCodeAt(kt+2)&&Pa.test(xt.slice(Ft,kt))?(f(3),h(),k()):R(la,2):61===n?R(na,2):R(da,1)}function I(e){var n=xt.charCodeAt(kt+1),l=1;if(!Wt&&n===e)return l=62===e&&62===xt.charCodeAt(kt+2)?3:2,61===xt.charCodeAt(kt+l)?R(na,l+1):R(pa,l);if(33==n&&60==e&&45==xt.charCodeAt(kt+2)&&45==xt.charCodeAt(kt+3))return f(4),h(),k();if(!Wt){if(Pt&&60===e)return++kt,p(ma);if(62===e){var t=i();if(t===Ha||t===Wa)return++kt,p(ya)}}return 61===n&&(l=61===xt.charCodeAt(kt+2)?3:2),R(ca,l)}function w(e){var n=xt.charCodeAt(kt+1);return 61===n?R(ia,61===xt.charCodeAt(kt+2)?3:2):61===e&&62===n&&_t.ecmaVersion>=6?(kt+=2,p(Wr)):R(61===e?ea:ta,1)}function E(e){switch(e){case 46:return g();case 40:return++kt,p(Br);case 41:return++kt,p(Nr);case 59:return++kt,p(Ur);case 44:return++kt,p(Vr);case 91:return++kt,p(Lr);case 93:return++kt,p(Or);case 123:return++kt,p(Dr);case 125:return++kt,p(Fr);case 63:return++kt,p(Hr);case 35:if(_t.playground)return++kt,p(Qr);case 58:if(++kt,_t.ecmaVersion>=7){var n=xt.charCodeAt(kt);if(58===n)return++kt,p($r)}return p(qr);case 96:return _t.ecmaVersion>=6?(++kt,p(Xr)):!1;case 48:var n=xt.charCodeAt(kt+1);if(120===n||88===n)return A(16);if(_t.ecmaVersion>=6){if(111===n||79===n)return A(8);if(98===n||66===n)return A(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return M(!1);case 34:case 39:return Ht?N():T(e);case 47:return m();case 37:return y();case 42:return _();case 124:case 38:return x(e);case 94:return b();case 43:case 45:return v(e);case 60:case 62:return I(e);case 61:case 33:return w(e);case 126:return R(ta,1)}return!1}function k(){if(Rt=kt,_t.locations&&(Ct=o()),kt>=bt)return p($t);var e=i();if(e===qa)return P();if(e===Ja)return O();var n=xt.charCodeAt(kt);if(e===Ha||e===Wa){if(Oa(n))return G()}else{if(e===Ja)return O();if(Oa(n)||92===n)return q()}var l=E(n);if(l===!1){var t=String.fromCharCode(n);if("\\"===t||Aa.test(t))return q();r(kt,"Unexpected character '"+t+"'")}return l}function R(e,n,l){var t=xt.slice(kt,kt+n);kt+=n,p(e,t,l)}function S(){for(var e,n,l="",t=kt;;){kt>=bt&&r(t,"Unterminated regular expression");var a=on();if(Pa.test(a)&&r(t,"Unterminated regular expression"),e)e=!1;else{if("["===a)n=!0;else if("]"===a&&n)n=!1;else if("/"===a&&!n)break;e="\\"===a}++kt}var l=xt.slice(t,kt);++kt;var u=U(),o=l;if(u){var s=/^[gmsiy]*$/;_t.ecmaVersion>=6&&(s=/^[gmsiyu]*$/),s.test(u)||r(t,"Invalid regular expression flag"),u.indexOf("u")>=0&&!Ya&&(o=o.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"))}try{new RegExp(o)}catch(i){i instanceof SyntaxError&&r(t,"Error parsing regular expression: "+i.message),r(i)}try{var c=new RegExp(l,u)}catch(d){c=null}return p(Xt,{pattern:l,flags:u,value:c})}function C(e,n){for(var l=kt,t=0,r=0,a=null==n?1/0:n;a>r;++r){var u,o=xt.charCodeAt(kt);if(u=o>=97?o-97+10:o>=65?o-65+10:o>=48&&57>=o?o-48:1/0,u>=e)break;++kt,t=t*e+u}return kt===l||null!=n&&kt-l!==n?null:t}function A(e){kt+=2;var n=C(e);return null==n&&r(Rt+2,"Expected number in radix "+e),Oa(xt.charCodeAt(kt))&&r(kt,"Identifier directly after number"),p(Yt,n)}function M(e){var n=kt,l=!1,t=48===xt.charCodeAt(kt);e||null!==C(10)||r(n,"Invalid number"),46===xt.charCodeAt(kt)&&(++kt,C(10),l=!0);var a=xt.charCodeAt(kt);(69===a||101===a)&&(a=xt.charCodeAt(++kt),(43===a||45===a)&&++kt,null===C(10)&&r(n,"Invalid number"),l=!0),Oa(xt.charCodeAt(kt))&&r(kt,"Identifier directly after number");var u,o=xt.slice(n,kt);return l?u=parseFloat(o):t&&1!==o.length?/[89]/.test(o)||Gt?r(n,"Invalid number"):u=parseInt(o,8):u=parseInt(o,10),p(Yt,u)}function j(){var e,n=xt.charCodeAt(kt);if(123===n?(_t.ecmaVersion<6&&sn(),++kt,e=V(xt.indexOf("}",kt)-kt),++kt,e>1114111&&sn()):e=V(4),65535>=e)return String.fromCharCode(e);var l=(e-65536>>10)+55296,t=(e-65536&1023)+56320;return String.fromCharCode(l,t)}function T(e){for(var n=i()===Ha,l="",t=++kt;;){kt>=bt&&r(Rt,"Unterminated string constant");var u=xt.charCodeAt(kt);if(u===e)break;92!==u||n?38===u&&n?(l+=xt.slice(t,kt),l+=L(),t=kt):(a(u)&&!n&&r(Rt,"Unterminated string constant"),++kt):(l+=xt.slice(t,kt),l+=D(),t=kt)}return l+=xt.slice(t,kt++),p(zt,l)}function P(){for(var e="",n=kt;;){kt>=bt&&r(Rt,"Unterminated template");var l=xt.charCodeAt(kt);if(96===l||36===l&&123===xt.charCodeAt(kt+1))return kt===Rt&&Mt===Jr?36===l?(kt+=2,p(zr)):(++kt,p(Xr)):(e+=xt.slice(n,kt),p(Jr,e));92===l?(e+=xt.slice(n,kt),e+=D(),n=kt):a(l)?(e+=xt.slice(n,kt),++kt,13===l&&10===xt.charCodeAt(kt)?(++kt,e+="\n"):e+=String.fromCharCode(l),_t.locations&&(++Lt,Ot=kt),n=kt):++kt}}function L(){var e,n="",l=0,t=xt[kt];"&"!==t&&r(kt,"Entity must start with an ampersand");for(var a=++kt;bt>kt&&l++<10;){if(t=xt[kt++],";"===t){"#"===n[0]?"x"===n[1]?(n=n.substr(2),Ta.test(n)&&(e=String.fromCharCode(parseInt(n,16)))):(n=n.substr(1),ja.test(n)&&(e=String.fromCharCode(parseInt(n,10)))):e=Ka[n];break}n+=t}return e?e:(kt=a,"&")}function O(){for(var e="",n=kt;;){kt>=bt&&r(Rt,"Unterminated JSX contents");var l=xt.charCodeAt(kt);switch(l){case 123:case 60:return kt===Rt?E(l):(e+=xt.slice(n,kt),p(Kr,e));case 38:e+=xt.slice(n,kt),e+=L(),n=kt;break;default:a(l)?(e+=xt.slice(n,kt),++kt,13===l&&10===xt.charCodeAt(kt)?(++kt,e+="\n"):e+=String.fromCharCode(l),_t.locations&&(++Lt,Ot=kt),n=kt):++kt}}}function D(){var e=xt.charCodeAt(++kt),n=/^[0-7]+/.exec(xt.slice(kt,kt+3));for(n&&(n=n[0]);n&&parseInt(n,8)>255;)n=n.slice(0,-1);if("0"===n&&(n=null),++kt,n)return Gt&&r(kt-2,"Octal literal in strict mode"),kt+=n.length-1,String.fromCharCode(parseInt(n,8));switch(e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(V(2));case 117:return j();case 116:return" ";case 98:return"\b";case 118:return"";case 102:return"\f";case 48:return"\x00";case 13:10===xt.charCodeAt(kt)&&++kt;case 10:return _t.locations&&(Ot=kt,++Lt),"";default:return String.fromCharCode(e)}}function F(){var e,n="",l=0,t=on();"&"!==t&&r(kt,"Entity must start with an ampersand");for(var a=++kt;bt>kt&&l++<10;){if(t=on(),kt++,";"===t){"#"===n[0]?"x"===n[1]?(n=n.substr(2),Ta.test(n)&&(e=String.fromCharCode(parseInt(n,16)))):(n=n.substr(1),ja.test(n)&&(e=String.fromCharCode(parseInt(n,10)))):e=Ka[n];break}n+=t}return e?e:(kt=a,"&")}function B(e){for(var n="";bt>kt;){var l=on();if(-1!==e.indexOf(l))break;"&"===l?n+=F():(++kt,"\r"===l&&"\n"===on()&&(n+=l,++kt,l="\n"),"\n"===l&&_t.locations&&(Ot=kt,++Lt),n+=l)}return p(er,n)}function N(){var e=xt.charCodeAt(kt);return 34!==e&&39!==e&&r("String literal must starts with a quote"),++kt,B([String.fromCharCode(e)]),e!==xt.charCodeAt(kt)&&sn(),++kt,p(Mt,jt)}function V(e){var n=C(16,e);return null===n&&r(Rt,"Bad character escape sequence"),n}function U(){za=!1;for(var e="",n=!0,l=kt;bt>kt;){var t=xt.charCodeAt(kt);if(Da(t))++kt;else{if(92!==t)break;za=!0,e+=xt.slice(l,kt),117!=xt.charCodeAt(++kt)&&r(kt,"Expecting Unicode escape sequence \\uXXXX"),++kt;var a=V(4),u=String.fromCharCode(a);u||r(kt-1,"Invalid Unicode escape"),(n?Oa(a):Da(a))||r(kt-4,"Invalid Unicode escape"),e+=u,l=kt}n=!1}return e+xt.slice(l,kt)}function q(){var e=U(),n=Ht?Zt:Kt;return!za&&ka(e)&&(n=Pr[e]),p(n,e)}function G(){var e,n=kt;do e=xt.charCodeAt(++kt);while(Da(e)||45===e);return p(Qt,xt.slice(n,kt))}function H(){_t.onToken&&_t.onToken(new l),Dt=Rt,Ft=St,Bt=At,k()}function W(e){if(Gt=e,Mt===Yt||Mt===zt){if(kt=Rt,_t.locations)for(;Ot>kt;)Ot=xt.lastIndexOf("\n",Ot-2)+1,--Lt;h(),k()}}function J(){this.type=null,this.start=Rt,this.end=null}function Y(){this.start=Ct,this.end=null,null!==vt&&(this.source=vt)}function X(){var n=new e.Node;return _t.locations&&(n.loc=new Y),_t.directSourceFile&&(n.sourceFile=_t.directSourceFile),_t.ranges&&(n.range=[Rt,0]),n}function z(){return _t.locations?[Rt,Ct]:Rt}function K(n){var l=new e.Node,t=n;return _t.locations&&(l.loc=new Y,l.loc.start=t[1],t=n[0]),l.start=t,_t.directSourceFile&&(l.sourceFile=_t.directSourceFile),_t.ranges&&(l.range=[t,0]),l}function $(e,n){return e.type=n,e.end=Ft,_t.locations&&(e.loc.end=Bt),_t.ranges&&(e.range[1]=Ft),e}function Q(e,n,l){return _t.locations&&(e.loc.end=l[1],l=l[0]),e.type=n,e.end=l,_t.ranges&&(e.range[1]=l),e}function Z(e){return _t.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.value}function en(e){return Mt===e?(H(),!0):!1}function nn(e){return Mt===Kt&&jt===e}function ln(e){return jt===e&&en(Kt)}function tn(e){ln(e)||sn()}function rn(){return!_t.strictSemicolons&&(Mt===$t||Mt===Fr||Pa.test(xt.slice(Ft,Rt)))}function an(){en(Ur)||rn()||sn()}function un(e){en(e)||sn()}function on(){return xt.charAt(kt)}function sn(e){r(null!=e?e:Rt,"Unexpected token")}function cn(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function pn(e,n){if(_t.ecmaVersion>=6&&e)switch(e.type){case"Identifier":case"VirtualPropertyExpression":case"MemberExpression":case"SpreadProperty":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var l=0;l<e.properties.length;l++){var t=e.properties[l];"SpreadProperty"!==t.type&&("init"!==t.kind&&r(t.key.start,"Object pattern can't contain getter or setter"),pn(t.value,n))}break;case"ArrayExpression":e.type="ArrayPattern",dn(e.elements,n);break;case"AssignmentExpression":"="===e.operator?e.type="AssignmentPattern":r(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!n)break;default:r(e.start,"Assigning to rvalue")}return e}function dn(e,n){if(e.length){for(var l=0;l<e.length-1;l++)pn(e[l],n);var t=e[e.length-1];switch(t.type){case"RestElement":break;case"SpreadElement":t.type="RestElement";var r=t.argument;pn(r,n),"Identifier"!==r.type&&"MemberExpression"!==r.type&&"ArrayPattern"!==r.type&&sn(r.start);break;default:pn(t,n)}}return e}function fn(e){var n=X();return H(),n.argument=Jn(e),$(n,"SpreadElement")}function hn(){var e=X();return H(),e.argument=Mt===Kt||Mt===Lr?gn():sn(),$(e,"RestElement")}function gn(){if(_t.ecmaVersion<6)return yl();switch(Mt){case Kt:return yl();case Lr:var e=X();return H(),e.elements=mn(Or,!0),$(e,"ArrayPattern");case Dr:return al(!0);default:sn()}}function mn(e,n){for(var l=[],t=!0;!en(e);){if(t?t=!1:un(Vr),Mt===Yr){l.push(yn(hn())),un(e);break}var r;if(n&&Mt===Vr)r=null;else{var a=_n();yn(a),r=_n(null,a)}l.push(r)}return l}function yn(e){return en(Hr)&&(e.optional=!0),Mt===qr&&(e.typeAnnotation=mt()),$(e,e.type),e}function _n(e,n){if(e=e||z(),n=n||gn(),!en(ea))return n;var l=K(e);return l.operator="=",l.left=n,l.right=Jn(),$(l,"AssignmentPattern")}function xn(e,n){switch(e.type){case"Identifier":(va(e.name)||Ia(e.name))&&r(e.start,"Defining '"+e.name+"' in strict mode"),cn(n,e.name)&&r(e.start,"Argument name clash in strict mode"),n[e.name]=!0;break;case"ObjectPattern":for(var l=0;l<e.properties.length;l++){var t=e.properties[l];"SpreadProperty"===t.type?xn(t.argument,n):xn(t.value,n)}break;case"ArrayPattern":for(var l=0;l<e.elements.length;l++){var a=e.elements[l];a&&xn(a,n)}break;case"RestElement":return xn(e.argument,n)}}function bn(e,n){if(!(_t.ecmaVersion>=6)){var l,t=e.key;switch(t.type){case"Identifier":l=t.name;break;case"Literal":l=String(t.value);break;default:return}var a,u=e.kind||"init";if(cn(n,l)){a=n[l];var o="init"!==u;((Gt||o)&&a[u]||!(o^a.init))&&r(t.start,"Redefinition of property")}else a=n[l]={init:!1,get:!1,set:!1};a[u]=!0}}function vn(e,n){switch(e.type){case"Identifier":Gt&&(Ia(e.name)||va(e.name))&&r(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode");break;case"MemberExpression":n&&r(e.start,"Binding to member expression");break;case"ObjectPattern":for(var l=0;l<e.properties.length;l++){var t=e.properties[l];"Property"===t.type&&(t=t.value),vn(t,n)}break;case"ArrayPattern":for(var l=0;l<e.elements.length;l++){var a=e.elements[l];a&&vn(a,n)}break;case"AssignmentPattern":vn(e.left);break;case"SpreadProperty":case"VirtualPropertyExpression":break;case"RestElement":vn(e.argument);break;default:r(e.start,"Assigning to rvalue")}}function In(e){var n=!0;for(e.body||(e.body=[]);Mt!==$t;){var l=wn(!0,!0);e.body.push(l),n&&Z(l)&&W(!0),n=!1}return H(),$(e,"Program")}function wn(e,n){var l=Mt,t=X();switch(l){case nr:case rr:return En(t,l.keyword);case ar:return kn(t);case or:return Rn(t);case cr:return Sn(t);case pr:return!e&&_t.ecmaVersion>=6&&sn(),Cn(t);case Er:return e||sn(),hl(t,!0);case dr:return An(t);case fr:return Mn(t);case hr:return jn(t);case gr:return Tn(t);case mr:return Pn(t);case _r:case xr:e||sn();case yr:return Ln(t,l.keyword);case br:return On(t);case vr:return Dn(t);case Dr:return Un();case Ur:return Fn(t);case Rr:case Sr:return n||_t.allowImportExportEverywhere||r(Rt,"'import' and 'export' may only appear at the top level"),l===Sr?bl(t):_l(t);case Kt:if(_t.ecmaVersion>=7&&Mt===Kt){if("private"===jt)return H(),fl(t);if("async"===jt&&"function "===xt.slice(St+1,St+10))return H(),un(pr),sl(t,!0,!0)}default:var a=jt,u=Wn();if(l===Kt&&"Identifier"===u.type){if(en(qr))return Bn(t,a,u);if("declare"===u.name){if(Mt===Er||Mt===Kt||Mt===pr||Mt===yr)return ql(t)}else if(Mt===Kt){if("interface"===u.name)return Yl(t);if("type"===u.name)return Xl(t)}}return Nn(t,u)}}function En(e,n){var l="break"==n;H(),en(Ur)||rn()?e.label=null:Mt!==Kt?sn():(e.label=yl(),an());for(var t=0;t<qt.length;++t){var a=qt[t];if(null==e.label||a.name===e.label.name){if(null!=a.kind&&(l||"loop"===a.kind))break;if(e.label&&l)break}}return t===qt.length&&r(e.start,"Unsyntactic "+n),$(e,l?"BreakStatement":"ContinueStatement")}function kn(e){return H(),an(),$(e,"DebuggerStatement")}function Rn(e){return H(),qt.push($a),e.body=wn(!1),qt.pop(),un(br),e.test=Vn(),_t.ecmaVersion>=6?en(Ur):an(),$(e,"DoWhileStatement")}function Sn(e){if(H(),qt.push($a),un(Br),Mt===Ur)return qn(e,null);if(Mt===yr||Mt===_r){var n=X(),l=Mt.keyword,t=Mt===_r;return H(),Hn(n,!0,l),$(n,"VariableDeclaration"),!(Mt===Tr||_t.ecmaVersion>=6&&nn("of"))||1!==n.declarations.length||t&&n.declarations[0].init?qn(e,n):Gn(e,n)}var r={start:0},n=Wn(!0,r);return Mt===Tr||_t.ecmaVersion>=6&&nn("of")?(pn(n),vn(n),Gn(e,n)):(r.start&&sn(r.start),qn(e,n))}function Cn(e){return H(),sl(e,!0,!1)}function An(e){return H(),e.test=Vn(),e.consequent=wn(!1),e.alternate=en(sr)?wn(!1):null,$(e,"IfStatement")}function Mn(e){return Nt||_t.allowReturnOutsideFunction||r(Rt,"'return' outside of function"),H(),en(Ur)||rn()?e.argument=null:(e.argument=Wn(),an()),$(e,"ReturnStatement")}function jn(e){H(),e.discriminant=Vn(),e.cases=[],un(Dr),qt.push(Qa);for(var n,l;Mt!=Fr;)if(Mt===lr||Mt===ur){var t=Mt===lr;n&&$(n,"SwitchCase"),e.cases.push(n=X()),n.consequent=[],H(),t?n.test=Wn():(l&&r(Dt,"Multiple default clauses"),l=!0,n.test=null),un(qr)}else n||sn(),n.consequent.push(wn(!0));return n&&$(n,"SwitchCase"),H(),qt.pop(),$(e,"SwitchStatement")}function Tn(e){return H(),Pa.test(xt.slice(Ft,Rt))&&r(Ft,"Illegal newline after throw"),e.argument=Wn(),an(),$(e,"ThrowStatement")}function Pn(e){if(H(),e.block=Un(),e.handler=null,Mt===tr){var n=X();H(),un(Br),n.param=gn(),vn(n.param,!0),un(Nr),n.guard=null,n.body=Un(),e.handler=$(n,"CatchClause")}return e.guardedHandlers=Jt,e.finalizer=en(ir)?Un():null,e.handler||e.finalizer||r(e.start,"Missing catch or finally clause"),$(e,"TryStatement")}function Ln(e,n){return H(),Hn(e,!1,n),an(),$(e,"VariableDeclaration")}function On(e){return H(),e.test=Vn(),qt.push($a),e.body=wn(!1),qt.pop(),$(e,"WhileStatement")}function Dn(e){return Gt&&r(Rt,"'with' in strict mode"),H(),e.object=Vn(),e.body=wn(!1),$(e,"WithStatement")}function Fn(e){return H(),$(e,"EmptyStatement")}function Bn(e,n,l){for(var t=0;t<qt.length;++t)qt[t].name===n&&r(l.start,"Label '"+n+"' is already declared");var a=Mt.isLoop?"loop":Mt===hr?"switch":null;return qt.push({name:n,kind:a}),e.body=wn(!0),qt.pop(),e.label=l,$(e,"LabeledStatement")}function Nn(e,n){return e.expression=n,an(),$(e,"ExpressionStatement")}function Vn(){un(Br);var e=Wn();return un(Nr),e}function Un(e){var n,l=X(),t=!0;for(l.body=[],un(Dr);!en(Fr);){var r=wn(!0);l.body.push(r),t&&e&&Z(r)&&(n=Gt,W(Gt=!0)),t=!1}return n===!1&&W(!1),$(l,"BlockStatement")}function qn(e,n){return e.init=n,un(Ur),e.test=Mt===Ur?null:Wn(),un(Ur),e.update=Mt===Nr?null:Wn(),un(Nr),e.body=wn(!1),qt.pop(),$(e,"ForStatement")}function Gn(e,n){var l=Mt===Tr?"ForInStatement":"ForOfStatement";return H(),e.left=n,e.right=Wn(),un(Nr),e.body=wn(!1),qt.pop(),$(e,l)}function Hn(e,n,l){for(e.declarations=[],e.kind=l;;){var t=X();if(t.id=gn(),vn(t.id,!0),Mt===qr&&(t.id.typeAnnotation=mt(),$(t.id,t.id.type)),t.init=en(ea)?Jn(n):l===xr.keyword?sn():null,e.declarations.push($(t,"VariableDeclarator")),!en(Vr))break}return e}function Wn(e,n){var l=z(),t=Jn(e,n);if(Mt===Vr){var r=K(l);for(r.expressions=[t];en(Vr);)r.expressions.push(Jn(e,n));return $(r,"SequenceExpression")}return t}function Jn(e,n,l){var t;n?t=!1:(n={start:0},t=!0);var r=z(),a=Yn(e,n);if(l&&(a=l(a,r)),Mt.isAssign){var u=K(r);return u.operator=jt,u.left=Mt===ea?pn(a):a,n.start=0,vn(a),H(),u.right=Jn(e),$(u,"AssignmentExpression")}return t&&n.start&&sn(n.start),a}function Yn(e,n){var l=z(),t=Xn(e,n);if(n&&n.start)return t;if(en(Hr)){var a=K(l);if(_t.playground&&en(ea)){var u=a.left=pn(t);return"MemberExpression"!==u.type&&r(u.start,"You can only use member expressions in memoization assignment"),a.right=Jn(e),a.operator="?=",$(a,"AssignmentExpression")}return a.test=t,a.consequent=Jn(),un(qr),a.alternate=Jn(e),$(a,"ConditionalExpression")}return t}function Xn(e,n){var l=z(),t=Kn(n);return n&&n.start?t:zn(t,l,-1,e)}function zn(e,n,l,t){var r=Mt.binop;if(null!=r&&(!t||Mt!==Tr)&&r>l){var a=K(n);a.left=e,a.operator=jt;var u=Mt;H();var o=z();return a.right=zn(Kn(),o,u.rightAssociative?r-1:r,t),$(a,u===ra||u===aa?"LogicalExpression":"BinaryExpression"),zn(a,n,l,t)}return e}function Kn(e){if(Mt.prefix){var n=X(),l=Mt.isUpdate;return n.operator=jt,n.prefix=!0,H(),n.argument=Kn(),e&&e.start&&sn(e.start),l?vn(n.argument):Gt&&"delete"===n.operator&&"Identifier"===n.argument.type&&r(n.start,"Deleting local variable in strict mode"),$(n,l?"UpdateExpression":"UnaryExpression")}var t=z(),a=$n(e);if(e&&e.start)return a;for(;Mt.postfix&&!rn();){var n=K(t);n.operator=jt,n.prefix=!1,n.argument=a,vn(a),H(),a=$(n,"UpdateExpression")}return a}function $n(e){var n=z(),l=Zn(e);return e&&e.start?l:Qn(l,n)}function Qn(e,n,l){if(_t.playground&&en(Qr)){var t=K(n);return t.object=e,t.property=yl(!0),t.arguments=en(Br)?ml(Nr,!1):[],Qn($(t,"BindMemberExpression"),n,l)}if(en($r)){var t=K(n);return t.object=e,t.property=yl(!0),Qn($(t,"VirtualPropertyExpression"),n,l)}if(en(Gr)){var t=K(n);return t.object=e,t.property=yl(!0),t.computed=!1,Qn($(t,"MemberExpression"),n,l)}if(en(Lr)){var t=K(n);return t.object=e,t.property=Wn(),t.computed=!0,un(Or),Qn($(t,"MemberExpression"),n,l)}if(!l&&en(Br)){var t=K(n);return t.callee=e,t.arguments=ml(Nr,!1),Qn($(t,"CallExpression"),n,l)}if(Mt===Xr){var t=K(n);return t.tag=e,t.quasi=rl(),Qn($(t,"TaggedTemplateExpression"),n,l)}return e}function Zn(e){switch(Mt){case wr:var n=X();return H(),$(n,"ThisExpression");case Cr:if(Vt)return wl();case Kt:var l=z(),n=X(),t=yl(Mt!==Kt);if(_t.ecmaVersion>=7)if("async"===t.name){if(Mt===Br){var r=nl(l,!0);return"ArrowFunctionExpression"===r.type?r:(n.callee=t,n.arguments="SequenceExpression"===r.type?r.expressions:[r],Qn($(n,"CallExpression"),l))}if(Mt===Kt)return t=yl(),un(Wr),pl(n,[t],!0);if(Mt===pr&&!rn())return H(),sl(n,!1,!0)}else if("await"===t.name&&Ut)return El(n);return!rn()&&en(Wr)?pl(K(l),[t]):t;case Xt:var n=X();return n.regex={pattern:jt.pattern,flags:jt.flags},n.value=jt.value,n.raw=xt.slice(Rt,St),H(),$(n,"Literal");case Yt:case zt:case Kr:var n=X();return n.value=jt,n.raw=xt.slice(Rt,St),H(),$(n,"Literal");case Ar:case Mr:case jr:var n=X();return n.value=Mt.atomValue,n.raw=Mt.keyword,H(),$(n,"Literal");case Br:return nl();case Lr:var n=X();return H(),_t.ecmaVersion>=7&&Mt===cr?kl(n,!1):(n.elements=ml(Or,!0,!0,e),$(n,"ArrayExpression"));case Dr:return al(!1,e);case pr:var n=X();return H(),sl(n,!1,!1);case Er:return hl(X(),!1);case Ir:return ll();case Xr:return rl();case Qr:return el();case ma:return Nl();default:sn()}}function el(){var e=X();H();var n=z();return e.callee=Qn(Zn(),n,!0),e.arguments=en(Br)?ml(Nr,!1):[],$(e,"BindFunctionExpression")}function nl(e,n){e=e||z();var l;if(_t.ecmaVersion>=6){if(H(),_t.ecmaVersion>=7&&Mt===cr)return kl(K(e),!0);for(var t,r,a=z(),u=[],o=!0,s={start:0},i=function(e,n){if(Mt===qr){var l=K(n);return l.expression=e,l.typeAnnotation=mt(),$(l,"TypeCastExpression")}return e};Mt!==Nr;){if(o?o=!1:un(Vr),Mt===Yr){var c=z();t=Rt,u.push(i(hn(),c));break}Mt!==Br||r||(r=Rt),u.push(Jn(!1,s,i))}var p=z();if(un(Nr),!rn()&&en(Wr)){r&&sn(r);for(var d=0;d<u.length;d++){var f=u[d];if("TypeCastExpression"===f.type){var h=f.expression;h.typeAnnotation=f.typeAnnotation,u[d]=h}}return pl(K(e),u,n)}u.length||sn(Dt),t&&sn(t),s.start&&sn(s.start),u.length>1?(l=K(a),l.expressions=u,Q(l,"SequenceExpression",p)):l=u[0]}else l=Vn();if(_t.preserveParens){var g=K(e);return g.expression=l,$(g,"ParenthesizedExpression")}return l}function ll(){var e=X();H();var n=z();return e.callee=Qn(Zn(),n,!0),e.arguments=en(Br)?ml(Nr,!1):Jt,$(e,"NewExpression")}function tl(){var e=X();return e.value={raw:xt.slice(Rt,St),cooked:jt},H(),e.tail=Mt===Xr,$(e,"TemplateElement")}function rl(){var e=X();H(),e.expressions=[];var n=tl();for(e.quasis=[n];!n.tail;)un(zr),e.expressions.push(Wn()),un(Fr),e.quasis.push(n=tl());return H(),$(e,"TemplateLiteral")}function al(e,n){var l=X(),t=!0,r={};for(l.properties=[],H();!en(Fr);){if(t)t=!1;else if(un(Vr),_t.allowTrailingCommas&&en(Fr))break;var a,u=X(),o=!1,s=!1;if(_t.ecmaVersion>=7&&Mt===Yr)u=fn(),u.type="SpreadProperty",l.properties.push(u);else{if(_t.ecmaVersion>=6&&(u.method=!1,u.shorthand=!1,(e||n)&&(a=z()),e||(o=en(ha))),_t.ecmaVersion>=7&&nn("async")){var i=yl();Mt===qr||Mt===Br?u.key=i:(s=!0,ul(u))}else ul(u);var c;Fl("<")&&(c=zl(),Mt!==Br&&sn()),en(qr)?(u.value=e?_n():Jn(!1,n),u.kind="init"):_t.ecmaVersion>=6&&Mt===Br?(e&&sn(),u.kind="init",u.method=!0,u.value=il(o,s)):_t.ecmaVersion>=5&&!u.computed&&"Identifier"===u.key.type&&("get"===u.key.name||"set"===u.key.name||_t.playground&&"memo"===u.key.name)&&Mt!=Vr&&Mt!=Fr?((o||s||e)&&sn(),u.kind=u.key.name,ul(u),u.value=il(!1,!1)):_t.ecmaVersion>=6&&!u.computed&&"Identifier"===u.key.type?(u.kind="init",e?u.value=_n(a,u.key):Mt===ea&&n?(n.start||(n.start=Rt),u.value=_n(a,u.key)):u.value=u.key,u.shorthand=!0):sn(),u.value.typeParameters=c,bn(u,r),l.properties.push($(u,"Property"))}}return $(l,e?"ObjectPattern":"ObjectExpression")}function ul(e){if(_t.ecmaVersion>=6){if(en(Lr))return e.computed=!0,e.key=Wn(),void un(Or);e.computed=!1}e.key=Mt===Yt||Mt===zt?Zn():yl(!0)}function ol(e,n){e.id=null,_t.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),_t.ecmaVersion>=7&&(e.async=n)}function sl(e,n,l,t){return ol(e,l),_t.ecmaVersion>=6&&(e.generator=en(ha)),(n||Mt===Kt)&&(e.id=yl()),Fl("<")&&(e.typeParameters=zl()),cl(e),dl(e,t),$(e,n?"FunctionDeclaration":"FunctionExpression")}function il(e,n){var l=X();ol(l,n),cl(l);var t;return _t.ecmaVersion>=6?(l.generator=e,t=!0):t=!1,dl(l,t),$(l,"FunctionExpression")}function cl(e){un(Br),e.params=mn(Nr,!1),Mt===qr&&(e.returnType=mt())}function pl(e,n,l){return ol(e,l),e.params=dn(n,!0),dl(e,!0),$(e,"ArrowFunctionExpression")}function dl(e,n){var l=n&&Mt!==Dr,t=Ut;if(Ut=e.async,l)e.body=Jn(),e.expression=!0;else{var r=Nt,a=Vt,u=qt;Nt=!0,Vt=e.generator,qt=[],e.body=Un(!0),e.expression=!1,Nt=r,Vt=a,qt=u}if(Ut=t,Gt||!l&&e.body.body.length&&Z(e.body.body[0])){var o={};e.id&&xn(e.id,{});for(var s=0;s<e.params.length;s++)xn(e.params[s],o)}}function fl(e){e.declarations=[];do e.declarations.push(yl());while(en(Vr));return an(),$(e,"PrivateDeclaration")}function hl(e,n){H(),e.id=Mt===Kt?yl():n?sn():null,Fl("<")&&(e.typeParameters=zl()),e.superClass=en(kr)?$n():null,e.superClass&&Fl("<")&&(e.superTypeParameters=Kl()),nn("implements")&&(H(),e.implements=gl());var l=X();for(l.body=[],un(Dr);!en(Fr);)if(!en(Ur)){var t=X();if(_t.ecmaVersion>=7&&nn("private"))H(),l.body.push(fl(t));else{var r=en(ha),a=!1;ul(t),Mt===Br||t.computed||"Identifier"!==t.key.type||"static"!==t.key.name?t["static"]=!1:((r||a)&&sn(),t["static"]=!0,r=en(ha),ul(t)),Mt===Br||t.computed||"Identifier"!==t.key.type||"async"!==t.key.name||(a=!0,ul(t)),Mt!==Br&&!t.computed&&"Identifier"===t.key.type&&("get"===t.key.name||"set"===t.key.name)||_t.playground&&"memo"===t.key.name?((r||a)&&sn(),t.kind=t.key.name,ul(t)):t.kind="";var u=!1;if(Mt===qr&&(t.typeAnnotation=mt(),u=!0),_t.playground&&en(ea)&&(t.value=Jn(),u=!0),u)an(),l.body.push($(t,"ClassProperty"));else{var o;Fl("<")&&(o=zl()),t.value=il(r,a),t.value.typeParameters=o,l.body.push($(t,"MethodDefinition")),en(Ur)}}}return e.body=$(l,"ClassBody"),$(e,n?"ClassDeclaration":"ClassExpression")}function gl(){var e=[];do{var n=X();n.id=yl(),n.typeParameters=Fl("<")?Kl():null,e.push($(n,"ClassImplements"))}while(en(Vr));return e}function ml(e,n,l,t){for(var r=[],a=!0;!en(e);){if(a)a=!1;else if(un(Vr),n&&_t.allowTrailingCommas&&en(e))break;r.push(l&&Mt===Vr?null:Mt===Yr?fn(t):Jn(!1,t))}return r}function yl(e){var n=X();return e&&"everywhere"==_t.forbidReserved&&(e=!1),Mt===Kt?(!e&&(_t.forbidReserved&&(3===_t.ecmaVersion?xa:ba)(jt)||Gt&&va(jt))&&-1==xt.slice(Rt,St).indexOf("\\")&&r(Rt,"The keyword '"+jt+"' is reserved"),n.name=jt):e&&Mt.keyword?n.name=Mt.keyword:sn(),H(),$(n,"Identifier")}function _l(e){if(H(),Mt===yr||Mt===xr||Mt===_r||Mt===pr||Mt===Er||nn("async")||nn("type"))e.declaration=wn(!0),e["default"]=!1,e.specifiers=null,e.source=null;else if(en(ur)){var n=Jn();if(n.id)switch(n.type){case"FunctionExpression":n.type="FunctionDeclaration";break;case"ClassExpression":n.type="ClassDeclaration"}e.declaration=n,e["default"]=!0,e.specifiers=null,e.source=null,an()}else{var l=Mt===ha;e.declaration=null,e["default"]=!1,e.specifiers=xl(),ln("from")?e.source=Mt===zt?Zn():sn():(l&&sn(),e.source=null),an()}return $(e,"ExportDeclaration")}function xl(){var e=[],n=!0;if(Mt===ha){var l=X();H(),e.push($(l,"ExportBatchSpecifier"))}else for(un(Dr);!en(Fr);){if(n)n=!1;else if(un(Vr),_t.allowTrailingCommas&&en(Fr))break;var l=X();l.id=yl(Mt===ur),l.name=ln("as")?yl(!0):null,e.push($(l,"ExportSpecifier"))}return e}function bl(e){H(),e.isType=!1,e.specifiers=[];var n;if(nn("type")){var l=z();n=yl(),Mt===Kt&&"from"!==jt||Mt===Dr||Mt===ha?e.isType=!0:(e.specifiers.push(Il(n,l)),en(Vr))}return Mt===zt?(n&&sn(n.start),e.source=Zn()):(nn("from")||vl(e.specifiers),tn("from"),e.source=Mt===zt?Zn():sn()),an(),$(e,"ImportDeclaration")}function vl(e){var n=!0;if(Mt===Kt){var l=z(),t=yl();if(e.push(Il(t,l)),!en(Vr))return e}if(Mt===ha){var r=X();return H(),tn("as"),r.name=yl(),vn(r.name,!0),e.push($(r,"ImportBatchSpecifier")),e}for(un(Dr);!en(Fr);){if(n)n=!1;else if(un(Vr),_t.allowTrailingCommas&&en(Fr))break;var r=X();r.id=yl(!0),r.name=ln("as")?yl():null,vn(r.name||r.id,!0),r["default"]=!1,e.push($(r,"ImportSpecifier"))}return e}function Il(e,n){var l=K(n);return l.id=e,vn(l.id,!0),l.name=null,l["default"]=!0,$(l,"ImportSpecifier")}function wl(){var e=X();return H(),en(Ur)||rn()?(e.delegate=!1,e.argument=null):(e.delegate=en(ha),e.argument=Jn()),$(e,"YieldExpression")}function El(e){return(en(Ur)||rn())&&sn(),e.all=en(ha),e.argument=Jn(!0),$(e,"AwaitExpression")}function kl(e,n){for(e.blocks=[];Mt===cr;){var l=X();H(),un(Br),l.left=gn(),vn(l.left,!0),tn("of"),l.right=Wn(),un(Nr),e.blocks.push($(l,"ComprehensionBlock"))}return e.filter=en(dr)?Vn():null,e.body=Wn(),un(n?Nr:Or),e.generator=n,$(e,"ComprehensionExpression")
}function Rl(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?Rl(e.object)+"."+Rl(e.property):void 0}function Sl(){var e=X();return Mt===Qt?e.name=jt:Mt.keyword?e.name=Mt.keyword:sn(),H(),$(e,"JSXIdentifier")}function Cl(){var e=z(),n=Sl();if(!en(qr))return n;var l=K(e);return l.namespace=n,l.name=Sl(),$(l,"JSXNamespacedName")}function Al(){for(var e=z(),n=Cl();en(Gr);){var l=K(e);l.object=n,l.property=Sl(),n=$(l,"JSXMemberExpression")}return n}function Ml(){switch(Mt){case Dr:var e=Tl();return"JSXEmptyExpression"===e.expression.type&&r(e.start,"JSX attributes must only be assigned a non-empty expression"),e;case ma:return Nl();case Kr:case zt:return Zn();default:r(Rt,"JSX value should be either an expression or a quoted JSX text")}}function jl(){Mt!==Fr&&sn();var e;return e=Rt,Rt=Ft,Ft=e,e=Ct,Ct=Bt,Bt=e,$(X(),"JSXEmptyExpression")}function Tl(){var e=X();return H(),e.expression=Mt===Fr?jl():Wn(),un(Fr),$(e,"JSXExpressionContainer")}function Pl(){var e=X();return en(Dr)?(un(Yr),e.argument=Jn(),un(Fr),$(e,"JSXSpreadAttribute")):(e.name=Cl(),e.value=en(ea)?Ml():null,$(e,"JSXAttribute"))}function Ll(e){var n=K(e);for(n.attributes=[],n.name=Al();Mt!==Zr&&Mt!==ya;)n.attributes.push(Pl());return n.selfClosing=en(Zr),un(ya),$(n,"JSXOpeningElement")}function Ol(e){var n=K(e);return n.name=Al(),un(ya),$(n,"JSXClosingElement")}function Dl(e){var n=K(e),l=[],t=Ll(e),a=null;if(!t.selfClosing){e:for(;;)switch(Mt){case ma:if(e=z(),H(),en(Zr)){a=Ol(e);break e}l.push(Dl(e));break;case Kr:l.push(Zn());break;case Dr:l.push(Tl());break;default:sn()}Rl(a.name)!==Rl(t.name)&&r(a.start,"Expected corresponding JSX closing tag for <"+Rl(t.name)+">")}return n.openingElement=t,n.closingElement=a,n.children=l,$(n,"JSXElement")}function Fl(e){return Mt===ca&&jt===e}function Bl(e){Fl(e)?H():sn()}function Nl(){var e=z();return H(),Dl(e)}function Vl(e){return H(),Wl(e,!0),$(e,"DeclareClass")}function Ul(e){H();var n=e.id=yl(),l=X(),t=X();l.typeParameters=Fl("<")?zl():null,un(Br);var r=st();return l.params=r.params,l.rest=r.rest,un(Nr),un(qr),l.returnType=gt(),t.typeAnnotation=$(l,"FunctionTypeAnnotation"),n.typeAnnotation=$(t,"TypeAnnotation"),$(n,n.type),an(),$(e,"DeclareFunction")}function ql(e){return Mt===Er?Vl(e):Mt===pr?Ul(e):Mt===yr?Gl(e):nn("module")?Hl(e):void sn()}function Gl(e){return H(),e.id=yt(),an(),$(e,"DeclareVariable")}function Hl(e){H(),e.id=Mt===zt?Zn():yl();var n=e.body=X(),l=n.body=[];for(un(Dr);Mt!==Fr;){var t=X();H(),l.push(ql(t))}return un(Fr),$(n,"BlockStatement"),$(e,"DeclareModule")}function Wl(e,n){if(e.id=yl(),e.typeParameters=Fl("<")?zl():null,e.extends=[],en(kr))do e.extends.push(Jl());while(en(Vr));e.body=lt(n)}function Jl(){var e=X();return e.id=yl(),e.typeParameters=Fl("<")?Kl():null,$(e,"InterfaceExtends")}function Yl(e){return Wl(e,!1),$(e,"InterfaceDeclaration")}function Xl(e){return e.id=yl(),e.typeParameters=Fl("<")?zl():null,un(ea),e.right=gt(),an(),$(e,"TypeAlias")}function zl(){var e=X();for(e.params=[],Bl("<");!Fl(">");)e.params.push(yl()),Fl(">")||un(Vr);return Bl(">"),$(e,"TypeParameterDeclaration")}function Kl(){var e=X(),n=Wt;for(e.params=[],Wt=!0,Bl("<");!Fl(">");)e.params.push(gt()),Fl(">")||un(Vr);return Bl(">"),Wt=n,$(e,"TypeParameterInstantiation")}function $l(){return Mt===Yt||Mt===zt?Zn():yl(!0)}function Ql(e,n){return e.static=n,un(Lr),e.id=$l(),un(qr),e.key=gt(),un(Or),un(qr),e.value=gt(),$(e,"ObjectTypeIndexer")}function Zl(e){for(e.params=[],e.rest=null,e.typeParameters=null,Fl("<")&&(e.typeParameters=zl()),un(Br);Mt===Kt;)e.params.push(ot()),Mt!==Nr&&un(Vr);return en(Yr)&&(e.rest=ot()),un(Nr),un(qr),e.returnType=gt(),$(e,"FunctionTypeAnnotation")}function et(e,n,l){var t=K(e);return t.value=Zl(K(e)),t.static=n,t.key=l,t.optional=!1,$(t,"ObjectTypeProperty")}function nt(e,n){var l=X();return e.static=n,e.value=Zl(l),$(e,"ObjectTypeCallProperty")}function lt(e){var n,l,t,r=X(),a=!1;for(r.callProperties=[],r.properties=[],r.indexers=[],un(Dr);Mt!==Fr;){var u=z();n=X(),e&&nn("static")&&(H(),t=!0),Mt===Lr?r.indexers.push(Ql(n,t)):Mt===Br||Fl("<")?r.callProperties.push(nt(n,e)):(l=t&&Mt===qr?yl():$l(),Fl("<")||Mt===Br?r.properties.push(et(u,t,l)):(en(Hr)&&(a=!0),un(qr),n.key=l,n.value=gt(),n.optional=a,n.static=t,r.properties.push($(n,"ObjectTypeProperty")))),en(Ur)||Mt===Fr||sn()}return un(Fr),$(r,"ObjectTypeAnnotation")}function tt(e,n){var l=K(e);for(l.typeParameters=null,l.id=n;en(Gr);){var t=K(e);t.qualification=l.id,t.id=yl(),l.id=$(t,"QualifiedTypeIdentifier")}return Fl("<")&&(l.typeParameters=Kl()),$(l,"GenericTypeAnnotation")}function rt(){var e=X();return un(Pr["void"]),$(e,"VoidTypeAnnotation")}function at(){var e=X();return un(Pr["typeof"]),e.argument=ct(),$(e,"TypeofTypeAnnotation")}function ut(){var e=X();for(e.types=[],un(Lr);bt>kt&&Mt!==Or&&(e.types.push(gt()),Mt!==Or);)un(Vr);return un(Or),$(e,"TupleTypeAnnotation")}function ot(){var e=!1,n=X();return n.name=yl(),en(Hr)&&(e=!0),un(qr),n.optional=e,n.typeAnnotation=gt(),$(n,"FunctionTypeParam")}function st(){for(var e={params:[],rest:null};Mt===Kt;)e.params.push(ot()),Mt!==Nr&&un(Vr);return en(Yr)&&(e.rest=ot()),e}function it(e,n,l){switch(l.name){case"any":return $(n,"AnyTypeAnnotation");case"bool":case"boolean":return $(n,"BooleanTypeAnnotation");case"number":return $(n,"NumberTypeAnnotation");case"string":return $(n,"StringTypeAnnotation");default:return tt(e,l)}}function ct(){var e,n,l=z(),t=X(),a=!1;switch(Mt){case Kt:return it(l,t,yl());case Dr:return lt();case Lr:return ut();case ca:if("<"===jt)return t.typeParameters=zl(),un(Br),e=st(),t.params=e.params,t.rest=e.rest,un(Nr),un(Wr),t.returnType=gt(),$(t,"FunctionTypeAnnotation");case Br:H();var u;return Mt!==Nr&&Mt!==Yr&&(Mt===Kt||(a=!0)),a?(u&&Nr?n=u:(n=gt(),un(Nr)),en(Wr)&&r(t,"Unexpected token =>. It looks like you are trying to write a function type, but you ended up writing a grouped type followed by an =>, which is a syntax error. Remember, function type parameters are named so function types look like (name1: type1, name2: type2) => returnType. You probably wrote (type1) => returnType"),n):(e=st(),t.params=e.params,t.rest=e.rest,un(Nr),un(Wr),t.returnType=gt(),t.typeParameters=null,$(t,"FunctionTypeAnnotation"));case zt:return t.value=jt,t.raw=xt.slice(Rt,St),H(),$(t,"StringLiteralTypeAnnotation");default:if(Mt.keyword)switch(Mt.keyword){case"void":return rt();case"typeof":return at()}}sn()}function pt(){var e=X(),n=e.elementType=ct();return Mt===Lr?(un(Lr),un(Or),$(e,"ArrayTypeAnnotation")):n}function dt(){var e=X();return en(Hr)?(e.typeAnnotation=dt(),$(e,"NullableTypeAnnotation")):pt()}function ft(){var e=X(),n=dt();for(e.types=[n];en(sa);)e.types.push(dt());return 1===e.types.length?n:$(e,"IntersectionTypeAnnotation")}function ht(){var e=X(),n=ft();for(e.types=[n];en(ua);)e.types.push(ft());return 1===e.types.length?n:$(e,"UnionTypeAnnotation")}function gt(){var e=Wt;Wt=!0;var n=ht();return Wt=e,n}function mt(){var e=X(),n=Wt;return Wt=!0,un(qr),e.typeAnnotation=gt(),Wt=n,$(e,"TypeAnnotation")}function yt(e,n){var l=(X(),yl()),t=!1;return n&&en(Hr)&&(un(Hr),t=!0),(e||Mt===qr)&&(l.typeAnnotation=mt(),$(l,l.type)),t&&(l.optional=!0,$(l,l.type)),l}e.version="0.11.1";var _t,xt,bt,vt;e.parse=function(e,l){xt=String(e),bt=xt.length,n(l),s();var r=_t.locations?[kt,o()]:kt;return t(),_t.strictMode&&(Gt=!0),In(_t.program||K(r))};var It=e.defaultOptions={strictMode:!1,playground:!1,ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};e.parseExpressionAt=function(e,l,r){return xt=String(e),bt=xt.length,n(r),s(l),t(),Wn()};var wt=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Et=e.getLineInfo=function(e,n){for(var l=1,t=0;;){La.lastIndex=t;var r=La.exec(e);if(!(r&&r.index<n))break;++l,t=r.index+r[0].length}return{line:l,column:n-t}};e.Token=l,e.tokenize=function(e,t){function r(){return Ft=St,k(),new l}return xt=String(e),bt=xt.length,n(t),s(),h(),r.jumpTo=function(e,n){if(kt=e,_t.locations){Lt=1,Ot=La.lastIndex=0;for(var l;(l=La.exec(xt))&&l.index<e;)++Lt,Ot=l.index+l[0].length}Pt=!!n,h()},r.current=function(){return new l},"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return{next:function(){var e=r();return{done:e.type===$t,value:e}}}}),r.options=_t,r};var kt,Rt,St,Ct,At,Mt,jt,Tt,Pt,Lt,Ot,Dt,Ft,Bt,Nt,Vt,Ut,qt,Gt,Ht,Wt,Jt=[],Yt={type:"num"},Xt={type:"regexp"},zt={type:"string"},Kt={type:"name"},$t={type:"eof"},Qt={type:"jsxName"},Zt={type:"xjsName"},er={type:"xjsText"},nr={keyword:"break"},lr={keyword:"case",beforeExpr:!0},tr={keyword:"catch"},rr={keyword:"continue"},ar={keyword:"debugger"},ur={keyword:"default"},or={keyword:"do",isLoop:!0},sr={keyword:"else",beforeExpr:!0},ir={keyword:"finally"},cr={keyword:"for",isLoop:!0},pr={keyword:"function"},dr={keyword:"if"},fr={keyword:"return",beforeExpr:!0},hr={keyword:"switch"},gr={keyword:"throw",beforeExpr:!0},mr={keyword:"try"},yr={keyword:"var"},_r={keyword:"let"},xr={keyword:"const"},br={keyword:"while",isLoop:!0},vr={keyword:"with"},Ir={keyword:"new",beforeExpr:!0},wr={keyword:"this"},Er={keyword:"class"},kr={keyword:"extends",beforeExpr:!0},Rr={keyword:"export"},Sr={keyword:"import"},Cr={keyword:"yield",beforeExpr:!0},Ar={keyword:"null",atomValue:null},Mr={keyword:"true",atomValue:!0},jr={keyword:"false",atomValue:!1},Tr={keyword:"in",binop:7,beforeExpr:!0},Pr={"break":nr,"case":lr,"catch":tr,"continue":rr,"debugger":ar,"default":ur,"do":or,"else":sr,"finally":ir,"for":cr,"function":pr,"if":dr,"return":fr,"switch":hr,"throw":gr,"try":mr,"var":yr,let:_r,"const":xr,"while":br,"with":vr,"null":Ar,"true":Mr,"false":jr,"new":Ir,"in":Tr,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:!0},"this":wr,"typeof":{keyword:"typeof",prefix:!0,beforeExpr:!0},"void":{keyword:"void",prefix:!0,beforeExpr:!0},"delete":{keyword:"delete",prefix:!0,beforeExpr:!0},"class":Er,"extends":kr,"export":Rr,"import":Sr,"yield":Cr},Lr={type:"[",beforeExpr:!0},Or={type:"]"},Dr={type:"{",beforeExpr:!0},Fr={type:"}"},Br={type:"(",beforeExpr:!0},Nr={type:")"},Vr={type:",",beforeExpr:!0},Ur={type:";",beforeExpr:!0},qr={type:":",beforeExpr:!0},Gr={type:"."},Hr={type:"?",beforeExpr:!0},Wr={type:"=>",beforeExpr:!0},Jr={type:"template"},Yr={type:"...",beforeExpr:!0},Xr={type:"`"},zr={type:"${",beforeExpr:!0},Kr={type:"jsxText"},$r={type:"::",beforeExpr:!0},Qr={type:"#"},Zr={binop:10,beforeExpr:!0},ea={isAssign:!0,beforeExpr:!0},na={isAssign:!0,beforeExpr:!0},la={postfix:!0,prefix:!0,isUpdate:!0},ta={prefix:!0,beforeExpr:!0},ra={binop:1,beforeExpr:!0},aa={binop:2,beforeExpr:!0},ua={binop:3,beforeExpr:!0},oa={binop:4,beforeExpr:!0},sa={binop:5,beforeExpr:!0},ia={binop:6,beforeExpr:!0},ca={binop:7,beforeExpr:!0},pa={binop:8,beforeExpr:!0},da={binop:9,prefix:!0,beforeExpr:!0},fa={binop:10,beforeExpr:!0},ha={binop:10,beforeExpr:!0},ga={binop:11,beforeExpr:!0,rightAssociative:!0},ma={type:"jsxTagStart"},ya={type:"jsxTagEnd"};e.tokTypes={bracketL:Lr,bracketR:Or,braceL:Dr,braceR:Fr,parenL:Br,parenR:Nr,comma:Vr,semi:Ur,colon:qr,dot:Gr,ellipsis:Yr,question:Hr,slash:Zr,eq:ea,name:Kt,eof:$t,num:Yt,regexp:Xt,string:zt,paamayimNekudotayim:$r,exponent:ga,hash:Qr,arrow:Wr,template:Jr,star:ha,assign:na,backQuote:Xr,dollarBraceL:zr,jsxName:Qt,jsxText:Kr,jsxTagStart:ma,jsxTagEnd:ya};for(var _a in Pr)e.tokTypes["_"+_a]=Pr[_a];var xa=function(e){switch(e.length){case 6:switch(e){case"double":case"export":case"import":case"native":case"public":case"static":case"throws":return!0}return!1;case 4:switch(e){case"byte":case"char":case"enum":case"goto":case"long":return!0}return!1;case 5:switch(e){case"class":case"final":case"float":case"short":case"super":return!0}return!1;case 7:switch(e){case"boolean":case"extends":case"package":case"private":return!0}return!1;case 9:switch(e){case"interface":case"protected":case"transient":return!0}return!1;case 8:switch(e){case"abstract":case"volatile":return!0}return!1;case 10:return"implements"===e;case 3:return"int"===e;case 12:return"synchronized"===e}},ba=function(e){switch(e.length){case 5:switch(e){case"class":case"super":case"const":return!0}return!1;case 6:switch(e){case"export":case"import":return!0}return!1;case 4:return"enum"===e;case 7:return"extends"===e}},va=function(e){switch(e.length){case 9:switch(e){case"interface":case"protected":return!0}return!1;case 7:switch(e){case"package":case"private":return!0}return!1;case 6:switch(e){case"public":case"static":return!0}return!1;case 10:return"implements"===e;case 3:return"let"===e;case 5:return"yield"===e}},Ia=function(e){switch(e){case"eval":case"arguments":return!0}return!1},wa=function(e){switch(e.length){case 4:switch(e){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return!0}return!1;case 5:switch(e){case"break":case"catch":case"throw":case"while":case"false":return!0}return!1;case 3:switch(e){case"for":case"try":case"var":case"new":return!0}return!1;case 6:switch(e){case"return":case"switch":case"typeof":case"delete":return!0}return!1;case 8:switch(e){case"continue":case"debugger":case"function":return!0}return!1;case 2:switch(e){case"do":case"if":case"in":return!0}return!1;case 7:switch(e){case"default":case"finally":return!0}return!1;case 10:return"instanceof"===e}},Ea=function(e){switch(e.length){case 5:switch(e){case"break":case"catch":case"throw":case"while":case"false":case"const":case"class":case"yield":return!0}return!1;case 4:switch(e){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return!0}return!1;case 6:switch(e){case"return":case"switch":case"typeof":case"delete":case"export":case"import":return!0}return!1;case 3:switch(e){case"for":case"try":case"var":case"new":case"let":return!0}return!1;case 8:switch(e){case"continue":case"debugger":case"function":return!0}return!1;case 7:switch(e){case"default":case"finally":case"extends":return!0}return!1;case 2:switch(e){case"do":case"if":case"in":return!0}return!1;case 10:return"instanceof"===e}},ka=wa,Ra=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Sa="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ca="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_",Aa=new RegExp("["+Sa+"]"),Ma=new RegExp("["+Sa+Ca+"]"),ja=/^\d+$/,Ta=/^[\da-fA-F]+$/,Pa=/[\n\r\u2028\u2029]/,La=/\r\n|[\n\r\u2028\u2029]/g,Oa=e.isIdentifierStart=function(e){return 65>e?36===e:91>e?!0:97>e?95===e:123>e?!0:e>=170&&Aa.test(String.fromCharCode(e))},Da=e.isIdentifierChar=function(e){return 48>e?36===e:58>e?!0:65>e?!1:91>e?!0:97>e?95===e:123>e?!0:e>=170&&Ma.test(String.fromCharCode(e))};u.prototype.offset=function(e){return new u(this.line,this.column+e)};var Fa={token:"{",isExpr:!1},Ba={token:"{",isExpr:!0},Na={token:"${",isExpr:!0},Va={token:"(",isExpr:!1},Ua={token:"(",isExpr:!0},qa={token:"`",isExpr:!0},Ga={token:"function",isExpr:!0},Ha={token:"<tag",isExpr:!1},Wa={token:"</tag",isExpr:!1},Ja={token:"<tag>...</tag>",isExpr:!0},Ya=!1;try{new RegExp("","u"),Ya=!0}catch(Xa){}var za,Ka={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},Ka={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};e.Node=J;var $a={kind:"loop"},Qa={kind:"switch"}})},{}],126:[function(e){var n=e("../lib/types"),l=n.Type,t=l.def,r=l.or,a=n.builtInTypes,u=a.string,o=a.number,s=a.boolean,i=a.RegExp,c=e("../lib/shared"),p=c.defaults,d=c.geq;t("Printable").field("loc",r(t("SourceLocation"),null),p["null"],!0),t("Node").bases("Printable").field("type",u).field("comments",r([t("Comment")],null),p["null"],!0),t("SourceLocation").build("start","end","source").field("start",t("Position")).field("end",t("Position")).field("source",r(u,null),p["null"]),t("Position").build("line","column").field("line",d(1)).field("column",d(0)),t("Program").bases("Node").build("body").field("body",[t("Statement")]),t("Function").bases("Node").field("id",r(t("Identifier"),null),p["null"]).field("params",[t("Pattern")]).field("body",r(t("BlockStatement"),t("Expression"))),t("Statement").bases("Node"),t("EmptyStatement").bases("Statement").build(),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]),t("ExpressionStatement").bases("Statement").build("expression").field("expression",t("Expression")),t("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Statement")).field("alternate",r(t("Statement"),null),p["null"]),t("LabeledStatement").bases("Statement").build("label","body").field("label",t("Identifier")).field("body",t("Statement")),t("BreakStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),p["null"]),t("ContinueStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),p["null"]),t("WithStatement").bases("Statement").build("object","body").field("object",t("Expression")).field("body",t("Statement")),t("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",t("Expression")).field("cases",[t("SwitchCase")]).field("lexical",s,p["false"]),t("ReturnStatement").bases("Statement").build("argument").field("argument",r(t("Expression"),null)),t("ThrowStatement").bases("Statement").build("argument").field("argument",t("Expression")),t("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",t("BlockStatement")).field("handler",r(t("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[t("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[t("CatchClause")],p.emptyArray).field("finalizer",r(t("BlockStatement"),null),p["null"]),t("CatchClause").bases("Node").build("param","guard","body").field("param",t("Pattern")).field("guard",r(t("Expression"),null),p["null"]).field("body",t("BlockStatement")),t("WhileStatement").bases("Statement").build("test","body").field("test",t("Expression")).field("body",t("Statement")),t("DoWhileStatement").bases("Statement").build("body","test").field("body",t("Statement")).field("test",t("Expression")),t("ForStatement").bases("Statement").build("init","test","update","body").field("init",r(t("VariableDeclaration"),t("Expression"),null)).field("test",r(t("Expression"),null)).field("update",r(t("Expression"),null)).field("body",t("Statement")),t("ForInStatement").bases("Statement").build("left","right","body","each").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")).field("each",s),t("DebuggerStatement").bases("Statement").build(),t("Declaration").bases("Statement"),t("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",t("Identifier")),t("FunctionExpression").bases("Function","Expression").build("id","params","body"),t("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",r("var","let","const")).field("declarations",[r(t("VariableDeclarator"),t("Identifier"))]),t("VariableDeclarator").bases("Node").build("id","init").field("id",t("Pattern")).field("init",r(t("Expression"),null)),t("Expression").bases("Node","Pattern"),t("ThisExpression").bases("Expression").build(),t("ArrayExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),null)]),t("ObjectExpression").bases("Expression").build("properties").field("properties",[t("Property")]),t("Property").bases("Node").build("kind","key","value").field("kind",r("init","get","set")).field("key",r(t("Literal"),t("Identifier"))).field("value",r(t("Expression"),t("Pattern"))),t("SequenceExpression").bases("Expression").build("expressions").field("expressions",[t("Expression")]);var f=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",t("Expression")).field("prefix",s,p["true"]);var h=r("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",t("Expression")).field("right",t("Expression"));var g=r("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",t("Pattern")).field("right",t("Expression"));var m=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",m).field("argument",t("Expression")).field("prefix",s);var y=r("||","&&");t("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",t("Expression")).field("right",t("Expression")),t("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Expression")).field("alternate",t("Expression")),t("NewExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("CallExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("MemberExpression").bases("Expression").build("object","property","computed").field("object",t("Expression")).field("property",r(t("Identifier"),t("Expression"))).field("computed",s),t("Pattern").bases("Node"),t("ObjectPattern").bases("Pattern").build("properties").field("properties",[r(t("PropertyPattern"),t("Property"))]),t("PropertyPattern").bases("Pattern").build("key","pattern").field("key",r(t("Literal"),t("Identifier"))).field("pattern",t("Pattern")),t("ArrayPattern").bases("Pattern").build("elements").field("elements",[r(t("Pattern"),null)]),t("SwitchCase").bases("Node").build("test","consequent").field("test",r(t("Expression"),null)).field("consequent",[t("Statement")]),t("Identifier").bases("Node","Expression","Pattern").build("name").field("name",u),t("Literal").bases("Node","Expression").build("value").field("value",r(u,s,null,o,i)),t("Comment").bases("Printable").field("value",u).field("leading",s,p["true"]).field("trailing",s,p["false"]),t("Block").bases("Comment").build("value","leading","trailing"),t("Line").bases("Comment").build("value","leading","trailing")},{"../lib/shared":137,"../lib/types":138}],127:[function(e){e("./core");var n=e("../lib/types"),l=n.Type.def,t=n.Type.or,r=n.builtInTypes,a=r.string,u=r.boolean;l("XMLDefaultDeclaration").bases("Declaration").field("namespace",l("Expression")),l("XMLAnyName").bases("Expression"),l("XMLQualifiedIdentifier").bases("Expression").field("left",t(l("Identifier"),l("XMLAnyName"))).field("right",t(l("Identifier"),l("Expression"))).field("computed",u),l("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",t(l("Identifier"),l("Expression"))).field("computed",u),l("XMLAttributeSelector").bases("Expression").field("attribute",l("Expression")),l("XMLFilterExpression").bases("Expression").field("left",l("Expression")).field("right",l("Expression")),l("XMLElement").bases("XML","Expression").field("contents",[l("XML")]),l("XMLList").bases("XML","Expression").field("contents",[l("XML")]),l("XML").bases("Node"),l("XMLEscape").bases("XML").field("expression",l("Expression")),l("XMLText").bases("XML").field("text",a),l("XMLStartTag").bases("XML").field("contents",[l("XML")]),l("XMLEndTag").bases("XML").field("contents",[l("XML")]),l("XMLPointTag").bases("XML").field("contents",[l("XML")]),l("XMLName").bases("XML").field("contents",t(a,[l("XML")])),l("XMLAttribute").bases("XML").field("value",a),l("XMLCdata").bases("XML").field("contents",a),l("XMLComment").bases("XML").field("contents",a),l("XMLProcessingInstruction").bases("XML").field("target",a).field("contents",t(a,null))},{"../lib/types":138,"./core":126}],128:[function(e){e("./core");var n=e("../lib/types"),l=n.Type.def,t=n.Type.or,r=n.builtInTypes,a=r.boolean,u=(r.object,r.string),o=e("../lib/shared").defaults;l("Function").field("generator",a,o["false"]).field("expression",a,o["false"]).field("defaults",[t(l("Expression"),null)],o.emptyArray).field("rest",t(l("Identifier"),null),o["null"]),l("FunctionDeclaration").build("id","params","body","generator","expression"),l("FunctionExpression").build("id","params","body","generator","expression"),l("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,o["null"]).field("generator",!1),l("YieldExpression").bases("Expression").build("argument","delegate").field("argument",t(l("Expression"),null)).field("delegate",a,o["false"]),l("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",l("Expression")).field("blocks",[l("ComprehensionBlock")]).field("filter",t(l("Expression"),null)),l("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",l("Expression")).field("blocks",[l("ComprehensionBlock")]).field("filter",t(l("Expression"),null)),l("ComprehensionBlock").bases("Node").build("left","right","each").field("left",l("Pattern")).field("right",l("Expression")).field("each",a),l("ModuleSpecifier").bases("Literal").build("value").field("value",u),l("Property").field("key",t(l("Literal"),l("Identifier"),l("Expression"))).field("method",a,o["false"]).field("shorthand",a,o["false"]).field("computed",a,o["false"]),l("PropertyPattern").field("key",t(l("Literal"),l("Identifier"),l("Expression"))).field("computed",a,o["false"]),l("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",t("init","get","set","")).field("key",t(l("Literal"),l("Identifier"),l("Expression"))).field("value",l("Function")).field("computed",a,o["false"]),l("SpreadElement").bases("Node").build("argument").field("argument",l("Expression")),l("ArrayExpression").field("elements",[t(l("Expression"),l("SpreadElement"),null)]),l("NewExpression").field("arguments",[t(l("Expression"),l("SpreadElement"))]),l("CallExpression").field("arguments",[t(l("Expression"),l("SpreadElement"))]),l("SpreadElementPattern").bases("Pattern").build("argument").field("argument",l("Pattern")),l("ArrayPattern").field("elements",[t(l("Pattern"),null,l("SpreadElement"))]);
var s=t(l("MethodDefinition"),l("VariableDeclarator"),l("ClassPropertyDefinition"),l("ClassProperty"));l("ClassProperty").bases("Declaration").build("key").field("key",t(l("Literal"),l("Identifier"),l("Expression"))).field("computed",a,o["false"]),l("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),l("ClassBody").bases("Declaration").build("body").field("body",[s]),l("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",l("Identifier")).field("body",l("ClassBody")).field("superClass",t(l("Expression"),null),o["null"]),l("ClassExpression").bases("Expression").build("id","body","superClass").field("id",t(l("Identifier"),null),o["null"]).field("body",l("ClassBody")).field("superClass",t(l("Expression"),null),o["null"]).field("implements",[l("ClassImplements")],o.emptyArray),l("ClassImplements").bases("Node").build("id").field("id",l("Identifier")).field("superClass",t(l("Expression"),null),o["null"]),l("Specifier").bases("Node"),l("NamedSpecifier").bases("Specifier").field("id",l("Identifier")).field("name",t(l("Identifier"),null),o["null"]),l("ExportSpecifier").bases("NamedSpecifier").build("id","name"),l("ExportBatchSpecifier").bases("Specifier").build(),l("ImportSpecifier").bases("NamedSpecifier").build("id","name"),l("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",l("Identifier")),l("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",l("Identifier")),l("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",a).field("declaration",t(l("Declaration"),l("Expression"),null)).field("specifiers",[t(l("ExportSpecifier"),l("ExportBatchSpecifier"))],o.emptyArray).field("source",t(l("ModuleSpecifier"),null),o["null"]),l("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[t(l("ImportSpecifier"),l("ImportNamespaceSpecifier"),l("ImportDefaultSpecifier"))],o.emptyArray).field("source",l("ModuleSpecifier")),l("TaggedTemplateExpression").bases("Expression").field("tag",l("Expression")).field("quasi",l("TemplateLiteral")),l("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[l("TemplateElement")]).field("expressions",[l("Expression")]),l("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:u,raw:u}).field("tail",a)},{"../lib/shared":137,"../lib/types":138,"./core":126}],129:[function(e){e("./core");var n=e("../lib/types"),l=n.Type.def,t=n.Type.or,r=n.builtInTypes,a=r.boolean,u=e("../lib/shared").defaults;l("Function").field("async",a,u["false"]),l("SpreadProperty").bases("Node").build("argument").field("argument",l("Expression")),l("ObjectExpression").field("properties",[t(l("Property"),l("SpreadProperty"))]),l("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",l("Pattern")),l("ObjectPattern").field("properties",[t(l("PropertyPattern"),l("SpreadPropertyPattern"),l("Property"),l("SpreadProperty"))]),l("AwaitExpression").bases("Expression").build("argument","all").field("argument",t(l("Expression"),null)).field("all",a,u["false"])},{"../lib/shared":137,"../lib/types":138,"./core":126}],130:[function(e){e("./core");var n=e("../lib/types"),l=n.Type.def,t=n.Type.or,r=n.builtInTypes,a=r.string,u=r.boolean,o=e("../lib/shared").defaults;l("XJSAttribute").bases("Node").build("name","value").field("name",t(l("XJSIdentifier"),l("XJSNamespacedName"))).field("value",t(l("Literal"),l("XJSExpressionContainer"),null),o["null"]),l("XJSIdentifier").bases("Node").build("name").field("name",a),l("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",l("XJSIdentifier")).field("name",l("XJSIdentifier")),l("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",t(l("XJSIdentifier"),l("XJSMemberExpression"))).field("property",l("XJSIdentifier")).field("computed",u,o.false);var s=t(l("XJSIdentifier"),l("XJSNamespacedName"),l("XJSMemberExpression"));l("XJSSpreadAttribute").bases("Node").build("argument").field("argument",l("Expression"));var i=[t(l("XJSAttribute"),l("XJSSpreadAttribute"))];l("XJSExpressionContainer").bases("Expression").build("expression").field("expression",l("Expression")),l("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",l("XJSOpeningElement")).field("closingElement",t(l("XJSClosingElement"),null),o["null"]).field("children",[t(l("XJSElement"),l("XJSExpressionContainer"),l("XJSText"),l("Literal"))],o.emptyArray).field("name",s,function(){return this.openingElement.name}).field("selfClosing",u,function(){return this.openingElement.selfClosing}).field("attributes",i,function(){return this.openingElement.attributes}),l("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",i,o.emptyArray).field("selfClosing",u,o["false"]),l("XJSClosingElement").bases("Node").build("name").field("name",s),l("XJSText").bases("Literal").build("value").field("value",a),l("XJSEmptyExpression").bases("Expression").build(),l("Type").bases("Node"),l("AnyTypeAnnotation").bases("Type"),l("VoidTypeAnnotation").bases("Type"),l("NumberTypeAnnotation").bases("Type"),l("StringTypeAnnotation").bases("Type"),l("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",a).field("raw",a),l("BooleanTypeAnnotation").bases("Type"),l("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",l("Type")),l("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",l("Type")),l("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[l("FunctionTypeParam")]).field("returnType",l("Type")).field("rest",t(l("FunctionTypeParam"),null)).field("typeParameters",t(l("TypeParameterDeclaration"),null)),l("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",l("Identifier")).field("typeAnnotation",l("Type")).field("optional",u),l("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",l("Type")),l("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[l("ObjectTypeProperty")]).field("indexers",[l("ObjectTypeIndexer")],o.emptyArray).field("callProperties",[l("ObjectTypeCallProperty")],o.emptyArray),l("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",t(l("Literal"),l("Identifier"))).field("value",l("Type")).field("optional",u),l("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",l("Identifier")).field("key",l("Type")).field("value",l("Type")),l("ObjectTypeCallProperty").bases("Node").build("value").field("value",l("FunctionTypeAnnotation")).field("static",u,!1),l("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",t(l("Identifier"),l("QualifiedTypeIdentifier"))).field("id",l("Identifier")),l("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",t(l("Identifier"),l("QualifiedTypeIdentifier"))).field("typeParameters",t(l("TypeParameterInstantiation"),null)),l("MemberTypeAnnotation").bases("Type").build("object","property").field("object",l("Identifier")).field("property",t(l("MemberTypeAnnotation"),l("GenericTypeAnnotation"))),l("UnionTypeAnnotation").bases("Type").build("types").field("types",[l("Type")]),l("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[l("Type")]),l("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",l("Type")),l("Identifier").field("typeAnnotation",t(l("TypeAnnotation"),null),o["null"]),l("TypeParameterDeclaration").bases("Node").build("params").field("params",[l("Identifier")]),l("TypeParameterInstantiation").bases("Node").build("params").field("params",[l("Type")]),l("Function").field("returnType",t(l("TypeAnnotation"),null),o["null"]).field("typeParameters",t(l("TypeParameterDeclaration"),null),o["null"]),l("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",l("TypeAnnotation")).field("static",u,!1),l("ClassImplements").field("typeParameters",t(l("TypeParameterInstantiation"),null),o["null"]),l("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",l("Identifier")).field("typeParameters",t(l("TypeParameterDeclaration"),null),o["null"]).field("body",l("ObjectTypeAnnotation")).field("extends",[l("InterfaceExtends")]),l("InterfaceExtends").bases("Node").build("id").field("id",l("Identifier")).field("typeParameters",t(l("TypeParameterInstantiation"),null)),l("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",l("Identifier")).field("typeParameters",t(l("TypeParameterDeclaration"),null)).field("right",l("Type")),l("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",l("Expression")).field("typeAnnotation",l("TypeAnnotation")),l("TupleTypeAnnotation").bases("Type").build("types").field("types",[l("Type")]),l("DeclareVariable").bases("Statement").build("id").field("id",l("Identifier")),l("DeclareFunction").bases("Statement").build("id").field("id",l("Identifier")),l("DeclareClass").bases("InterfaceDeclaration").build("id"),l("DeclareModule").bases("Statement").build("id","body").field("id",t(l("Identifier"),l("Literal"))).field("body",l("BlockStatement"))},{"../lib/shared":137,"../lib/types":138,"./core":126}],131:[function(e){e("./core");var n=e("../lib/types"),l=n.Type.def,t=n.Type.or,r=e("../lib/shared").geq;l("ForOfStatement").bases("Statement").build("left","right","body").field("left",t(l("VariableDeclaration"),l("Expression"))).field("right",l("Expression")).field("body",l("Statement")),l("LetStatement").bases("Statement").build("head","body").field("head",[l("VariableDeclarator")]).field("body",l("Statement")),l("LetExpression").bases("Expression").build("head","body").field("head",[l("VariableDeclarator")]).field("body",l("Expression")),l("GraphExpression").bases("Expression").build("index","expression").field("index",r(0)).field("expression",l("Literal")),l("GraphIndexExpression").bases("Expression").build("index").field("index",r(0))},{"../lib/shared":137,"../lib/types":138,"./core":126}],132:[function(e,n){function l(e,n,l){return p.check(l)?l.length=0:l=null,r(e,n,l)}function t(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function r(e,n,l){return e===n?!0:p.check(e)?a(e,n,l):d.check(e)?u(e,n,l):f.check(e)?f.check(n)&&+e===+n:h.check(e)?h.check(n)&&e.source===n.source&&e.global===n.global&&e.multiline===n.multiline&&e.ignoreCase===n.ignoreCase:e==n}function a(e,n,l){p.assert(e);var t=e.length;if(!p.check(n)||n.length!==t)return l&&l.push("length"),!1;for(var a=0;t>a;++a){if(l&&l.push(a),a in e!=a in n)return!1;if(!r(e[a],n[a],l))return!1;l&&o.strictEqual(l.pop(),a)}return!0}function u(e,n,l){if(d.assert(e),!d.check(n))return!1;if(e.type!==n.type)return l&&l.push("type"),!1;var t=i(e),a=t.length,u=i(n),s=u.length;if(a===s){for(var p=0;a>p;++p){var f=t[p],h=c(e,f),m=c(n,f);if(l&&l.push(f),!r(h,m,l))return!1;l&&o.strictEqual(l.pop(),f)}return!0}if(!l)return!1;var y=Object.create(null);for(p=0;a>p;++p)y[t[p]]=!0;for(p=0;s>p;++p){if(f=u[p],!g.call(y,f))return l.push(f),!1;delete y[f]}for(f in y){l.push(f);break}return!1}var o=e("assert"),s=e("../main"),i=s.getFieldNames,c=s.getFieldValue,p=s.builtInTypes.array,d=s.builtInTypes.object,f=s.builtInTypes.Date,h=s.builtInTypes.RegExp,g=Object.prototype.hasOwnProperty;l.assert=function(e,n){var r=[];l(e,n,r)||(0===r.length?o.strictEqual(e,n):o.ok(!1,"Nodes differ in the following path: "+r.map(t).join("")))},n.exports=l},{"../main":139,assert:141}],133:[function(e,n){function l(e,n,t){s.ok(this instanceof l),h.call(this,e,n,t)}function t(e){return c.BinaryExpression.check(e)||c.LogicalExpression.check(e)}function r(e){return c.CallExpression.check(e)?!0:f.check(e)?e.some(r):c.Node.check(e)?i.someField(e,function(e,n){return r(n)}):!1}function a(e){for(var n,l;e.parent;e=e.parent){if(n=e.node,l=e.parent.node,c.BlockStatement.check(l)&&"body"===e.parent.name&&0===e.name)return s.strictEqual(l.body[0],n),!0;if(c.ExpressionStatement.check(l)&&"expression"===e.name)return s.strictEqual(l.expression,n),!0;if(c.SequenceExpression.check(l)&&"expressions"===e.parent.name&&0===e.name)s.strictEqual(l.expressions[0],n);else if(c.CallExpression.check(l)&&"callee"===e.name)s.strictEqual(l.callee,n);else if(c.MemberExpression.check(l)&&"object"===e.name)s.strictEqual(l.object,n);else if(c.ConditionalExpression.check(l)&&"test"===e.name)s.strictEqual(l.test,n);else if(t(l)&&"left"===e.name)s.strictEqual(l.left,n);else{if(!c.UnaryExpression.check(l)||l.prefix||"argument"!==e.name)return!1;s.strictEqual(l.argument,n)}}return!0}function u(e){if(c.VariableDeclaration.check(e.node)){var n=e.get("declarations").value;if(!n||0===n.length)return e.prune()}else if(c.ExpressionStatement.check(e.node)){if(!e.get("expression").value)return e.prune()}else c.IfStatement.check(e.node)&&o(e);return e}function o(e){var n=e.get("test").value,l=e.get("alternate").value,t=e.get("consequent").value;if(t||l){if(!t&&l){var r=p.unaryExpression("!",n,!0);c.UnaryExpression.check(n)&&"!"===n.operator&&(r=n.argument),e.get("test").replace(r),e.get("consequent").replace(l),e.get("alternate").replace()}}else{var a=p.expressionStatement(n);e.replace(a)}}var s=e("assert"),i=e("./types"),c=i.namedTypes,p=i.builders,d=i.builtInTypes.number,f=i.builtInTypes.array,h=e("./path"),g=e("./scope");e("util").inherits(l,h);var m=l.prototype;Object.defineProperties(m,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),m.replace=function(){return delete this.node,delete this.parent,delete this.scope,h.prototype.replace.apply(this,arguments)},m.prune=function(){var e=this.parent;return this.replace(),u(e)},m._computeNode=function(){var e=this.value;if(c.Node.check(e))return e;var n=this.parentPath;return n&&n.node||null},m._computeParent=function(){var e=this.value,n=this.parentPath;if(!c.Node.check(e)){for(;n&&!c.Node.check(n.value);)n=n.parentPath;n&&(n=n.parentPath)}for(;n&&!c.Node.check(n.value);)n=n.parentPath;return n||null},m._computeScope=function(){var e=this.value,n=this.parentPath,l=n&&n.scope;return c.Node.check(e)&&g.isEstablishedBy(e)&&(l=new g(this,l)),l||null},m.getValueProperty=function(e){return i.getFieldValue(this.value,e)},m.needsParens=function(e){var n=this.parentPath;if(!n)return!1;var l=this.value;if(!c.Expression.check(l))return!1;if("Identifier"===l.type)return!1;for(;!c.Node.check(n.value);)if(n=n.parentPath,!n)return!1;var t=n.value;switch(l.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return"MemberExpression"===t.type&&"object"===this.name&&t.object===l;case"BinaryExpression":case"LogicalExpression":switch(t.type){case"CallExpression":return"callee"===this.name&&t.callee===l;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return"object"===this.name&&t.object===l;case"BinaryExpression":case"LogicalExpression":var a=t.operator,n=y[a],u=l.operator,o=y[u];if(n>o)return!0;if(n===o&&"right"===this.name)return s.strictEqual(t.right,l),!0;default:return!1}case"SequenceExpression":switch(t.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(t.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===t.type&&d.check(l.value)&&"object"===this.name&&t.object===l;case"AssignmentExpression":case"ConditionalExpression":switch(t.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&t.callee===l;case"ConditionalExpression":return"test"===this.name&&t.test===l;case"MemberExpression":return"object"===this.name&&t.object===l;default:return!1}default:if("NewExpression"===t.type&&"callee"===this.name&&t.callee===l)return r(l)}return e!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement()?!0:!1};var y={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,n){e.forEach(function(e){y[e]=n})}),m.canBeFirstInStatement=function(){var e=this.node;return!c.FunctionExpression.check(e)&&!c.ObjectExpression.check(e)},m.firstInStatement=function(){return a(this)},n.exports=l},{"./path":135,"./scope":136,"./types":138,assert:141,util:167}],134:[function(e,n){function l(){s.ok(this instanceof l),this._reusableContextStack=[],this._methodNameTable=t(this),this._shouldVisitComments=g.call(this._methodNameTable,"Block")||g.call(this._methodNameTable,"Line"),this.Context=u(this),this._visiting=!1,this._changeReported=!1}function t(e){var n=Object.create(null);for(var l in e)/^visit[A-Z]/.test(l)&&(n[l.slice("visit".length)]=!0);for(var t=i.computeSupertypeLookupTable(n),r=Object.create(null),n=Object.keys(t),a=n.length,u=0;a>u;++u){var o=n[u];l="visit"+t[o],h.check(e[l])&&(r[o]=l)}return r}function r(e,n){for(var l in n)g.call(n,l)&&(e[l]=n[l]);return e}function a(e,n){s.ok(e instanceof c),s.ok(n instanceof l);var t=e.value;if(d.check(t))e.each(n.visitWithoutReset,n);else if(f.check(t)){var r=i.getFieldNames(t);n._shouldVisitComments&&t.comments&&r.indexOf("comments")<0&&r.push("comments");for(var a=r.length,u=[],o=0;a>o;++o){var p=r[o];g.call(t,p)||(t[p]=i.getFieldValue(t,p)),u.push(e.get(p))}for(var o=0;a>o;++o)n.visitWithoutReset(u[o])}else;return e.value}function u(e){function n(t){s.ok(this instanceof n),s.ok(this instanceof l),s.ok(t instanceof c),Object.defineProperty(this,"visitor",{value:e,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=t,this.needToCallTraverse=!0,Object.seal(this)}s.ok(e instanceof l);var t=n.prototype=Object.create(e);return t.constructor=n,r(t,_),n}var o,s=e("assert"),i=e("./types"),c=e("./node-path"),p=i.namedTypes.Printable,d=i.builtInTypes.array,f=i.builtInTypes.object,h=i.builtInTypes.function,g=Object.prototype.hasOwnProperty;l.fromMethodsObject=function(e){function n(){s.ok(this instanceof n),l.call(this)}if(e instanceof l)return e;if(!f.check(e))return new l;var t=n.prototype=Object.create(m);return t.constructor=n,r(t,e),r(n,l),h.assert(n.fromMethodsObject),h.assert(n.visit),new n},l.visit=function(e,n){return l.fromMethodsObject(n).visit(e)};var m=l.prototype,y=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");m.visit=function(){s.ok(!this._visiting,y),this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var e=arguments.length,n=new Array(e),l=0;e>l;++l)n[l]=arguments[l];n[0]instanceof c||(n[0]=new c({root:n[0]}).get("root")),this.reset.apply(this,n);try{var t=this.visitWithoutReset(n[0]),r=!0}finally{if(this._visiting=!1,!r&&this._abortRequested)return n[0].value}return t},m.AbortRequest=function(){},m.abort=function(){var e=this;e._abortRequested=!0;var n=new e.AbortRequest;throw n.cancel=function(){e._abortRequested=!1},n},m.reset=function(){},m.visitWithoutReset=function(e){if(this instanceof this.Context)return this.visitor.visitWithoutReset(e);s.ok(e instanceof c);var n=e.value,l=p.check(n)&&this._methodNameTable[n.type];if(!l)return a(e,this);var t=this.acquireContext(e);try{return t.invokeVisitorMethod(l)}finally{this.releaseContext(t)}},m.acquireContext=function(e){return 0===this._reusableContextStack.length?new this.Context(e):this._reusableContextStack.pop().reset(e)},m.releaseContext=function(e){s.ok(e instanceof this.Context),this._reusableContextStack.push(e),e.currentPath=null},m.reportChanged=function(){this._changeReported=!0},m.wasChangeReported=function(){return this._changeReported};var _=Object.create(null);_.reset=function(e){return s.ok(this instanceof this.Context),s.ok(e instanceof c),this.currentPath=e,this.needToCallTraverse=!0,this},_.invokeVisitorMethod=function(e){s.ok(this instanceof this.Context),s.ok(this.currentPath instanceof c);var n=this.visitor[e].call(this,this.currentPath);n===!1?this.needToCallTraverse=!1:n!==o&&(this.currentPath=this.currentPath.replace(n)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),s.strictEqual(this.needToCallTraverse,!1,"Must either call this.traverse or return false in "+e);var l=this.currentPath;return l&&l.value},_.traverse=function(e,n){return s.ok(this instanceof this.Context),s.ok(e instanceof c),s.ok(this.currentPath instanceof c),this.needToCallTraverse=!1,a(e,l.fromMethodsObject(n||this.visitor))},_.visit=function(e,n){return s.ok(this instanceof this.Context),s.ok(e instanceof c),s.ok(this.currentPath instanceof c),this.needToCallTraverse=!1,l.fromMethodsObject(n||this.visitor).visitWithoutReset(e)},_.reportChanged=function(){this.visitor.reportChanged()},_.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},n.exports=l},{"./node-path":133,"./types":138,assert:141}],135:[function(e,n){function l(e,n,t){s.ok(this instanceof l),n?s.ok(n instanceof l):(n=null,t=null),this.value=e,this.parentPath=n,this.name=t,this.__childCache=null}function t(e){return e.__childCache||(e.__childCache=Object.create(null))}function r(e,n){var l=t(e),r=e.getValueProperty(n),a=l[n];return c.call(l,n)&&a.value===r||(a=l[n]=new e.constructor(r,e,n)),a}function a(){}function u(e,n,l,r){if(d.assert(e.value),0===n)return a;var u=e.value.length;if(1>u)return a;var o=arguments.length;2===o?(l=0,r=u):3===o?(l=Math.max(l,0),r=u):(l=Math.max(l,0),r=Math.min(r,u)),f.assert(l),f.assert(r);for(var i=Object.create(null),p=t(e),h=l;r>h;++h)if(c.call(e.value,h)){var g=e.get(h);s.strictEqual(g.name,h);var m=h+n;g.name=m,i[m]=g,delete p[h]}return delete p.length,function(){for(var n in i){var l=i[n];s.strictEqual(l.name,+n),p[n]=l,e.value[n]=l.value}}}function o(e){s.ok(e instanceof l);var n=e.parentPath;if(!n)return e;var r=n.value,a=t(n);if(r[e.name]===e.value)a[e.name]=e;else if(d.check(r)){var u=r.indexOf(e.value);u>=0&&(a[e.name=u]=e)}else r[e.name]=e.value,a[e.name]=e;return s.strictEqual(r[e.name],e.value),s.strictEqual(e.parentPath.get(e.name),e),e}var s=e("assert"),i=Object.prototype,c=i.hasOwnProperty,p=e("./types"),d=p.builtInTypes.array,f=p.builtInTypes.number,h=Array.prototype,g=(h.slice,h.map,l.prototype);g.getValueProperty=function(e){return this.value[e]},g.get=function(){for(var e=this,n=arguments,l=n.length,t=0;l>t;++t)e=r(e,n[t]);return e},g.each=function(e,n){for(var l=[],t=this.value.length,r=0,r=0;t>r;++r)c.call(this.value,r)&&(l[r]=this.get(r));for(n=n||this,r=0;t>r;++r)c.call(l,r)&&e.call(n,l[r])},g.map=function(e,n){var l=[];return this.each(function(n){l.push(e.call(this,n))},n),l},g.filter=function(e,n){var l=[];return this.each(function(n){e.call(this,n)&&l.push(n)},n),l},g.shift=function(){var e=u(this,-1),n=this.value.shift();return e(),n},g.unshift=function(){var e=u(this,arguments.length),n=this.value.unshift.apply(this.value,arguments);return e(),n},g.push=function(){return d.assert(this.value),delete t(this).length,this.value.push.apply(this.value,arguments)},g.pop=function(){d.assert(this.value);var e=t(this);return delete e[this.value.length-1],delete e.length,this.value.pop()},g.insertAt=function(e){var n=arguments.length,l=u(this,n-1,e);if(l===a)return this;e=Math.max(e,0);for(var t=1;n>t;++t)this.value[e+t-1]=arguments[t];return l(),this},g.insertBefore=function(){for(var e=this.parentPath,n=arguments.length,l=[this.name],t=0;n>t;++t)l.push(arguments[t]);return e.insertAt.apply(e,l)},g.insertAfter=function(){for(var e=this.parentPath,n=arguments.length,l=[this.name+1],t=0;n>t;++t)l.push(arguments[t]);return e.insertAt.apply(e,l)},g.replace=function(e){var n=[],l=this.parentPath.value,r=t(this.parentPath),a=arguments.length;if(o(this),d.check(l)){for(var i=l.length,c=u(this.parentPath,a-1,this.name+1),p=[this.name,1],f=0;a>f;++f)p.push(arguments[f]);var h=l.splice.apply(l,p);if(s.strictEqual(h[0],this.value),s.strictEqual(l.length,i-1+a),c(),0===a)delete this.value,delete r[this.name],this.__childCache=null;else{for(s.strictEqual(l[this.name],e),this.value!==e&&(this.value=e,this.__childCache=null),f=0;a>f;++f)n.push(this.parentPath.get(this.name+f));s.strictEqual(n[0],this)}}else 1===a?(this.value!==e&&(this.__childCache=null),this.value=l[this.name]=e,n.push(this)):0===a?(delete l[this.name],delete this.value,this.__childCache=null):s.ok(!1,"Could not replace path");return n},n.exports=l},{"./types":138,assert:141}],136:[function(e,n){function l(n,t){o.ok(this instanceof l),o.ok(n instanceof e("./node-path")),y.assert(n.value);var r;t?(o.ok(t instanceof l),r=t.depth+1):(t=null,r=0),Object.defineProperties(this,{path:{value:n},node:{value:n.value},isGlobal:{value:!t,enumerable:!0},depth:{value:r},parent:{value:t},bindings:{value:{}}})}function t(e,n){var l=e.value;y.assert(l),c.CatchClause.check(l)?u(e.get("param"),n):r(e,n)}function r(e,n){var l=e.value;e.parent&&c.FunctionExpression.check(e.parent.node)&&e.parent.node.id&&u(e.parent.get("id"),n),l&&(f.check(l)?e.each(function(e){a(e,n)}):c.Function.check(l)?(e.get("params").each(function(e){u(e,n)}),a(e.get("body"),n)):c.VariableDeclarator.check(l)?(u(e.get("id"),n),a(e.get("init"),n)):"ImportSpecifier"===l.type||"ImportNamespaceSpecifier"===l.type||"ImportDefaultSpecifier"===l.type?u(e.get(l.name?"name":"id"),n):p.check(l)&&!d.check(l)&&s.eachField(l,function(l,t){var r=e.get(l);o.strictEqual(r.value,t),a(r,n)}))}function a(e,n){var l=e.value;if(!l||d.check(l));else if(c.FunctionDeclaration.check(l))u(e.get("id"),n);else if(c.ClassDeclaration&&c.ClassDeclaration.check(l))u(e.get("id"),n);else if(y.check(l)){if(c.CatchClause.check(l)){var t=l.param.name,a=h.call(n,t);r(e.get("body"),n),a||delete n[t]}}else r(e,n)}function u(e,n){var l=e.value;c.Pattern.assert(l),c.Identifier.check(l)?h.call(n,l.name)?n[l.name].push(e):n[l.name]=[e]:c.ObjectPattern&&c.ObjectPattern.check(l)?e.get("properties").each(function(e){var l=e.value;c.Pattern.check(l)?u(e,n):c.Property.check(l)?u(e.get("value"),n):c.SpreadProperty&&c.SpreadProperty.check(l)&&u(e.get("argument"),n)}):c.ArrayPattern&&c.ArrayPattern.check(l)?e.get("elements").each(function(e){var l=e.value;c.Pattern.check(l)?u(e,n):c.SpreadElement&&c.SpreadElement.check(l)&&u(e.get("argument"),n)}):c.PropertyPattern&&c.PropertyPattern.check(l)?u(e.get("pattern"),n):(c.SpreadElementPattern&&c.SpreadElementPattern.check(l)||c.SpreadPropertyPattern&&c.SpreadPropertyPattern.check(l))&&u(e.get("argument"),n)}var o=e("assert"),s=e("./types"),i=s.Type,c=s.namedTypes,p=c.Node,d=c.Expression,f=s.builtInTypes.array,h=Object.prototype.hasOwnProperty,g=s.builders,m=[c.Program,c.Function,c.CatchClause],y=i.or.apply(i,m);l.isEstablishedBy=function(e){return y.check(e)};var _=l.prototype;_.didScan=!1,_.declares=function(e){return this.scan(),h.call(this.bindings,e)},_.declareTemporary=function(e){e?o.ok(/^[a-z$_]/i.test(e),e):e="t$",e+=this.depth.toString(36)+"$",this.scan();for(var n=0;this.declares(e+n);)++n;var l=e+n;return this.bindings[l]=s.builders.identifier(l)},_.injectTemporary=function(e,n){e||(e=this.declareTemporary());var l=this.path.get("body");return c.BlockStatement.check(l.value)&&(l=l.get("body")),l.unshift(g.variableDeclaration("var",[g.variableDeclarator(e,n||null)])),e},_.scan=function(e){if(e||!this.didScan){for(var n in this.bindings)delete this.bindings[n];t(this.path,this.bindings),this.didScan=!0}},_.getBindings=function(){return this.scan(),this.bindings},_.lookup=function(e){for(var n=this;n&&!n.declares(e);n=n.parent);return n},_.getGlobalScope=function(){for(var e=this;!e.isGlobal;)e=e.parent;return e},n.exports=l},{"./node-path":133,"./types":138,assert:141}],137:[function(e,n,l){var t=e("../lib/types"),r=t.Type,a=t.builtInTypes,u=a.number;l.geq=function(e){return new r(function(n){return u.check(n)&&n>=e},u+" >= "+e)},l.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return!1},"true":function(){return!0},undefined:function(){}};var o=r.or(a.string,a.number,a.boolean,a.null,a.undefined);l.isPrimitive=new r(function(e){if(null===e)return!0;var n=typeof e;return!("object"===n||"function"===n)},o.toString())},{"../lib/types":138}],138:[function(e,n,l){function t(e,n){var l=this;h.ok(l instanceof t,l),h.strictEqual(x.call(e),b,e+" is not a function");var r=x.call(n);h.ok(r===b||r===v,n+" is neither a function nor a string"),Object.defineProperties(l,{name:{value:n},check:{value:function(n,t){var r=e.call(l,n,t);return!r&&t&&x.call(t)===b&&t(l,n),r}}})}function r(e){return C.check(e)?"{"+Object.keys(e).map(function(n){return n+": "+e[n]}).join(", ")+"}":S.check(e)?"["+e.map(r).join(", ")+"]":JSON.stringify(e)}function a(e,n){var l=x.call(e);return Object.defineProperty(E,n,{enumerable:!0,value:new t(function(e){return x.call(e)===l},n)}),E[n]}function u(e,n){return e instanceof t?e:e instanceof s?e.type:S.check(e)?t.fromArray(e):C.check(e)?t.fromObject(e):R.check(e)?new t(e,n):new t(function(n){return n===e},M.check(n)?function(){return e+""}:n)}function o(e,n,l,t){var r=this;h.ok(r instanceof o),k.assert(e),n=u(n);var a={name:{value:e},type:{value:n},hidden:{value:!!t}};R.check(l)&&(a.defaultFn={value:l}),Object.defineProperties(r,a)}function s(e){var n=this;h.ok(n instanceof s),Object.defineProperties(n,{typeName:{value:e},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new t(function(e,l){return n.check(e,l)},e)}})}function i(e){return e.replace(/^[A-Z]+/,function(e){var n=e.length;switch(n){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,n-1).toLowerCase()+e.charAt(n-1)}})}function c(e){var n=s.fromValue(e);return n?n.fieldNames.slice(0):("type"in e&&h.ok(!1,"did not recognize object of type "+JSON.stringify(e.type)),Object.keys(e))}function p(e,n){var l=s.fromValue(e);if(l){var t=l.allFields[n];if(t)return t.getValue(e)}return e[n]}function d(e,n){n.length=0,n.push(e);for(var l=Object.create(null),t=0;t<n.length;++t){e=n[t];var r=T[e];h.strictEqual(r.finalized,!0),I.call(l,e)&&delete n[l[e]],l[e]=t,n.push.apply(n,r.baseNames)}for(var a=0,u=a,o=n.length;o>u;++u)I.call(n,u)&&(n[a++]=n[u]);n.length=a}function f(e,n){return Object.keys(n).forEach(function(l){e[l]=n[l]}),e}var h=e("assert"),g=Array.prototype,m=g.slice,y=(g.map,g.forEach),_=Object.prototype,x=_.toString,b=x.call(function(){}),v=x.call(""),I=_.hasOwnProperty,w=t.prototype;l.Type=t,w.assert=function(e,n){if(!this.check(e,n)){var l=r(e);return h.ok(!1,l+" does not match type "+this),!1}return!0},w.toString=function(){var e=this.name;return k.check(e)?e:R.check(e)?e.call(this)+"":e+" type"};var E={};l.builtInTypes=E;var k=a("","string"),R=a(function(){},"function"),S=a([],"array"),C=a({},"object"),A=(a(/./,"RegExp"),a(new Date,"Date"),a(3,"number")),M=(a(!0,"boolean"),a(null,"null"),a(void 0,"undefined"));t.or=function(){for(var e=[],n=arguments.length,l=0;n>l;++l)e.push(u(arguments[l]));return new t(function(l,t){for(var r=0;n>r;++r)if(e[r].check(l,t))return!0;return!1},function(){return e.join(" | ")})},t.fromArray=function(e){return h.ok(S.check(e)),h.strictEqual(e.length,1,"only one element type is permitted for typed arrays"),u(e[0]).arrayOf()},w.arrayOf=function(){var e=this;return new t(function(n,l){return S.check(n)&&n.every(function(n){return e.check(n,l)
})},function(){return"["+e+"]"})},t.fromObject=function(e){var n=Object.keys(e).map(function(n){return new o(n,e[n])});return new t(function(e,l){return C.check(e)&&n.every(function(n){return n.type.check(e[n.name],l)})},function(){return"{ "+n.join(", ")+" }"})};var j=o.prototype;j.toString=function(){return JSON.stringify(this.name)+": "+this.type},j.getValue=function(e){var n=e[this.name];return M.check(n)?(this.defaultFn&&(n=this.defaultFn.call(e)),n):n},t.def=function(e){return k.assert(e),I.call(T,e)?T[e]:T[e]=new s(e)};var T=Object.create(null);s.fromValue=function(e){if(e&&"object"==typeof e){var n=e.type;if("string"==typeof n&&I.call(T,n)){var l=T[n];if(l.finalized)return l}}return null};var P=s.prototype;P.isSupertypeOf=function(e){return e instanceof s?(h.strictEqual(this.finalized,!0),h.strictEqual(e.finalized,!0),I.call(e.allSupertypes,this.typeName)):void h.ok(!1,e+" is not a Def")},l.getSupertypeNames=function(e){h.ok(I.call(T,e));var n=T[e];return h.strictEqual(n.finalized,!0),n.supertypeList.slice(1)},l.computeSupertypeLookupTable=function(e){for(var n={},l=Object.keys(T),t=l.length,r=0;t>r;++r){var a=l[r],u=T[a];h.strictEqual(u.finalized,!0);for(var o=0;o<u.supertypeList.length;++o){var s=u.supertypeList[o];if(I.call(e,s)){n[a]=s;break}}}return n},P.checkAllFields=function(e,n){function l(l){var r=t[l],a=r.type,u=r.getValue(e);return a.check(u,n)}var t=this.allFields;return h.strictEqual(this.finalized,!0),C.check(e)&&Object.keys(t).every(l)},P.check=function(e,n){if(h.strictEqual(this.finalized,!0,"prematurely checking unfinalized type "+this.typeName),!C.check(e))return!1;var l=s.fromValue(e);return l?n&&l===this?this.checkAllFields(e,n):this.isSupertypeOf(l)?n?l.checkAllFields(e,n)&&this.checkAllFields(e,!1):!0:!1:"SourceLocation"===this.typeName||"Position"===this.typeName?this.checkAllFields(e,n):!1},P.bases=function(){var e=this.baseNames;return h.strictEqual(this.finalized,!1),y.call(arguments,function(n){k.assert(n),e.indexOf(n)<0&&e.push(n)}),this},Object.defineProperty(P,"buildable",{value:!1});var L={};l.builders=L;var O={};l.defineMethod=function(e,n){var l=O[e];return M.check(n)?delete O[e]:(R.assert(n),Object.defineProperty(O,e,{enumerable:!0,configurable:!0,value:n})),l},P.build=function(){var e=this;return Object.defineProperty(e,"buildParams",{value:m.call(arguments),writable:!1,enumerable:!1,configurable:!0}),h.strictEqual(e.finalized,!1),k.arrayOf().assert(e.buildParams),e.buildable?e:(e.field("type",e.typeName,function(){return e.typeName}),Object.defineProperty(e,"buildable",{value:!0}),Object.defineProperty(L,i(e.typeName),{enumerable:!0,value:function(){function n(n,u){if(!I.call(a,n)){var o=e.allFields;h.ok(I.call(o,n),n);var s,i=o[n],c=i.type;if(A.check(u)&&t>u)s=l[u];else if(i.defaultFn)s=i.defaultFn.call(a);else{var p="no value or default function given for field "+JSON.stringify(n)+" of "+e.typeName+"("+e.buildParams.map(function(e){return o[e]}).join(", ")+")";h.ok(!1,p)}c.check(s)||h.ok(!1,r(s)+" does not match field "+i+" of type "+e.typeName),a[n]=s}}var l=arguments,t=l.length,a=Object.create(O);return h.ok(e.finalized,"attempting to instantiate unfinalized type "+e.typeName),e.buildParams.forEach(function(e,l){n(e,l)}),Object.keys(e.allFields).forEach(function(e){n(e)}),h.strictEqual(a.type,e.typeName),a}}),e)},P.field=function(e,n,l,t){return h.strictEqual(this.finalized,!1),this.ownFields[e]=new o(e,n,l,t),this};var D={};l.namedTypes=D,l.getFieldNames=c,l.getFieldValue=p,l.eachField=function(e,n,l){c(e).forEach(function(l){n.call(this,l,p(e,l))},l)},l.someField=function(e,n,l){return c(e).some(function(l){return n.call(this,l,p(e,l))},l)},Object.defineProperty(P,"finalized",{value:!1}),P.finalize=function(){if(!this.finalized){var e=this.allFields,n=this.allSupertypes;this.baseNames.forEach(function(l){var t=T[l];t.finalize(),f(e,t.allFields),f(n,t.allSupertypes)}),f(e,this.ownFields),n[this.typeName]=this,this.fieldNames.length=0;for(var l in e)I.call(e,l)&&!e[l].hidden&&this.fieldNames.push(l);Object.defineProperty(D,this.typeName,{enumerable:!0,value:this.type}),Object.defineProperty(this,"finalized",{value:!0}),d(this.typeName,this.supertypeList)}},l.finalize=function(){Object.keys(T).forEach(function(e){T[e].finalize()})}},{assert:141}],139:[function(e,n,l){var t=e("./lib/types");e("./def/core"),e("./def/es6"),e("./def/es7"),e("./def/mozilla"),e("./def/e4x"),e("./def/fb-harmony"),t.finalize(),l.Type=t.Type,l.builtInTypes=t.builtInTypes,l.namedTypes=t.namedTypes,l.builders=t.builders,l.defineMethod=t.defineMethod,l.getFieldNames=t.getFieldNames,l.getFieldValue=t.getFieldValue,l.eachField=t.eachField,l.someField=t.someField,l.getSupertypeNames=t.getSupertypeNames,l.astNodesAreEquivalent=e("./lib/equiv"),l.finalize=t.finalize,l.NodePath=e("./lib/node-path"),l.PathVisitor=e("./lib/path-visitor"),l.visit=l.PathVisitor.visit},{"./def/core":126,"./def/e4x":127,"./def/es6":128,"./def/es7":129,"./def/fb-harmony":130,"./def/mozilla":131,"./lib/equiv":132,"./lib/node-path":133,"./lib/path-visitor":134,"./lib/types":138}],140:[function(){},{}],141:[function(e,n){function l(e,n){return d.isUndefined(n)?""+n:d.isNumber(n)&&!isFinite(n)?n.toString():d.isFunction(n)||d.isRegExp(n)?n.toString():n}function t(e,n){return d.isString(e)?e.length<n?e:e.slice(0,n):e}function r(e){return t(JSON.stringify(e.actual,l),128)+" "+e.operator+" "+t(JSON.stringify(e.expected,l),128)}function a(e,n,l,t,r){throw new g.AssertionError({message:l,actual:e,expected:n,operator:t,stackStartFunction:r})}function u(e,n){e||a(e,!0,n,"==",g.ok)}function o(e,n){if(e===n)return!0;if(d.isBuffer(e)&&d.isBuffer(n)){if(e.length!=n.length)return!1;for(var l=0;l<e.length;l++)if(e[l]!==n[l])return!1;return!0}return d.isDate(e)&&d.isDate(n)?e.getTime()===n.getTime():d.isRegExp(e)&&d.isRegExp(n)?e.source===n.source&&e.global===n.global&&e.multiline===n.multiline&&e.lastIndex===n.lastIndex&&e.ignoreCase===n.ignoreCase:d.isObject(e)||d.isObject(n)?i(e,n):e==n}function s(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function i(e,n){if(d.isNullOrUndefined(e)||d.isNullOrUndefined(n))return!1;if(e.prototype!==n.prototype)return!1;if(d.isPrimitive(e)||d.isPrimitive(n))return e===n;var l=s(e),t=s(n);if(l&&!t||!l&&t)return!1;if(l)return e=f.call(e),n=f.call(n),o(e,n);var r,a,u=m(e),i=m(n);if(u.length!=i.length)return!1;for(u.sort(),i.sort(),a=u.length-1;a>=0;a--)if(u[a]!=i[a])return!1;for(a=u.length-1;a>=0;a--)if(r=u[a],!o(e[r],n[r]))return!1;return!0}function c(e,n){return e&&n?"[object RegExp]"==Object.prototype.toString.call(n)?n.test(e):e instanceof n?!0:n.call({},e)===!0?!0:!1:!1}function p(e,n,l,t){var r;d.isString(l)&&(t=l,l=null);try{n()}catch(u){r=u}if(t=(l&&l.name?" ("+l.name+").":".")+(t?" "+t:"."),e&&!r&&a(r,l,"Missing expected exception"+t),!e&&c(r,l)&&a(r,l,"Got unwanted exception"+t),e&&r&&l&&!c(r,l)||!e&&r)throw r}var d=e("util/"),f=Array.prototype.slice,h=Object.prototype.hasOwnProperty,g=n.exports=u;g.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=r(this),this.generatedMessage=!0);var n=e.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var l=new Error;if(l.stack){var t=l.stack,u=n.name,o=t.indexOf("\n"+u);if(o>=0){var s=t.indexOf("\n",o+1);t=t.substring(s+1)}this.stack=t}}},d.inherits(g.AssertionError,Error),g.fail=a,g.ok=u,g.equal=function(e,n,l){e!=n&&a(e,n,l,"==",g.equal)},g.notEqual=function(e,n,l){e==n&&a(e,n,l,"!=",g.notEqual)},g.deepEqual=function(e,n,l){o(e,n)||a(e,n,l,"deepEqual",g.deepEqual)},g.notDeepEqual=function(e,n,l){o(e,n)&&a(e,n,l,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(e,n,l){e!==n&&a(e,n,l,"===",g.strictEqual)},g.notStrictEqual=function(e,n,l){e===n&&a(e,n,l,"!==",g.notStrictEqual)},g.throws=function(){p.apply(this,[!0].concat(f.call(arguments)))},g.doesNotThrow=function(){p.apply(this,[!1].concat(f.call(arguments)))},g.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var n=[];for(var l in e)h.call(e,l)&&n.push(l);return n}},{"util/":167}],142:[function(e,n,l){arguments[4][140][0].apply(l,arguments)},{dup:140}],143:[function(e,n,l){function t(e,n,l){if(!(this instanceof t))return new t(e,n,l);var r,a=typeof e;if("number"===a)r=+e;else if("string"===a)r=t.byteLength(e,n);else{if("object"!==a||null===e)throw new TypeError("must start with number, buffer, array or string");"Buffer"===e.type&&D(e.data)&&(e=e.data),r=+e.length}if(r>F)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F.toString(16)+" bytes");0>r?r=0:r>>>=0;var u=this;t.TYPED_ARRAY_SUPPORT?u=t._augment(new Uint8Array(r)):(u.length=r,u._isBuffer=!0);var o;if(t.TYPED_ARRAY_SUPPORT&&"number"==typeof e.byteLength)u._set(e);else if(R(e))if(t.isBuffer(e))for(o=0;r>o;o++)u[o]=e.readUInt8(o);else for(o=0;r>o;o++)u[o]=(e[o]%256+256)%256;else if("string"===a)u.write(e,0,n);else if("number"===a&&!t.TYPED_ARRAY_SUPPORT&&!l)for(o=0;r>o;o++)u[o]=0;return r>0&&r<=t.poolSize&&(u.parent=B),u}function r(e,n,l){if(!(this instanceof r))return new r(e,n,l);var a=new t(e,n,l);return delete a.parent,a}function a(e,n,l,t){l=Number(l)||0;var r=e.length-l;t?(t=Number(t),t>r&&(t=r)):t=r;var a=n.length;if(a%2!==0)throw new Error("Invalid hex string");t>a/2&&(t=a/2);for(var u=0;t>u;u++){var o=parseInt(n.substr(2*u,2),16);if(isNaN(o))throw new Error("Invalid hex string");e[l+u]=o}return u}function u(e,n,l,t){var r=T(C(n,e.length-l),e,l,t);return r}function o(e,n,l,t){var r=T(A(n),e,l,t);return r}function s(e,n,l,t){return o(e,n,l,t)}function i(e,n,l,t){var r=T(j(n),e,l,t);return r}function c(e,n,l,t){var r=T(M(n,e.length-l),e,l,t);return r}function p(e,n,l){return L.fromByteArray(0===n&&l===e.length?e:e.slice(n,l))}function d(e,n,l){var t="",r="";l=Math.min(e.length,l);for(var a=n;l>a;a++)e[a]<=127?(t+=P(r)+String.fromCharCode(e[a]),r=""):r+="%"+e[a].toString(16);return t+P(r)}function f(e,n,l){var t="";l=Math.min(e.length,l);for(var r=n;l>r;r++)t+=String.fromCharCode(127&e[r]);return t}function h(e,n,l){var t="";l=Math.min(e.length,l);for(var r=n;l>r;r++)t+=String.fromCharCode(e[r]);return t}function g(e,n,l){var t=e.length;(!n||0>n)&&(n=0),(!l||0>l||l>t)&&(l=t);for(var r="",a=n;l>a;a++)r+=S(e[a]);return r}function m(e,n,l){for(var t=e.slice(n,l),r="",a=0;a<t.length;a+=2)r+=String.fromCharCode(t[a]+256*t[a+1]);return r}function y(e,n,l){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+n>l)throw new RangeError("Trying to access beyond buffer length")}function _(e,n,l,r,a,u){if(!t.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(n>a||u>n)throw new RangeError("value is out of bounds");if(l+r>e.length)throw new RangeError("index out of range")}function x(e,n,l,t){0>n&&(n=65535+n+1);for(var r=0,a=Math.min(e.length-l,2);a>r;r++)e[l+r]=(n&255<<8*(t?r:1-r))>>>8*(t?r:1-r)}function b(e,n,l,t){0>n&&(n=4294967295+n+1);for(var r=0,a=Math.min(e.length-l,4);a>r;r++)e[l+r]=n>>>8*(t?r:3-r)&255}function v(e,n,l,t,r,a){if(n>r||a>n)throw new RangeError("value is out of bounds");if(l+t>e.length)throw new RangeError("index out of range");if(0>l)throw new RangeError("index out of range")}function I(e,n,l,t,r){return r||v(e,n,l,4,3.4028234663852886e38,-3.4028234663852886e38),O.write(e,n,l,t,23,4),l+4}function w(e,n,l,t,r){return r||v(e,n,l,8,1.7976931348623157e308,-1.7976931348623157e308),O.write(e,n,l,t,52,8),l+8}function E(e){if(e=k(e).replace(V,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function k(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function R(e){return D(e)||t.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function S(e){return 16>e?"0"+e.toString(16):e.toString(16)}function C(e,n){n=n||1/0;for(var l,t=e.length,r=null,a=[],u=0;t>u;u++){if(l=e.charCodeAt(u),l>55295&&57344>l){if(!r){if(l>56319){(n-=3)>-1&&a.push(239,191,189);continue}if(u+1===t){(n-=3)>-1&&a.push(239,191,189);continue}r=l;continue}if(56320>l){(n-=3)>-1&&a.push(239,191,189),r=l;continue}l=r-55296<<10|l-56320|65536,r=null}else r&&((n-=3)>-1&&a.push(239,191,189),r=null);if(128>l){if((n-=1)<0)break;a.push(l)}else if(2048>l){if((n-=2)<0)break;a.push(l>>6|192,63&l|128)}else if(65536>l){if((n-=3)<0)break;a.push(l>>12|224,l>>6&63|128,63&l|128)}else{if(!(2097152>l))throw new Error("Invalid code point");if((n-=4)<0)break;a.push(l>>18|240,l>>12&63|128,l>>6&63|128,63&l|128)}}return a}function A(e){for(var n=[],l=0;l<e.length;l++)n.push(255&e.charCodeAt(l));return n}function M(e,n){for(var l,t,r,a=[],u=0;u<e.length&&!((n-=2)<0);u++)l=e.charCodeAt(u),t=l>>8,r=l%256,a.push(r),a.push(t);return a}function j(e){return L.toByteArray(E(e))}function T(e,n,l,t){for(var r=0;t>r&&!(r+l>=n.length||r>=e.length);r++)n[r+l]=e[r];return r}function P(e){try{return decodeURIComponent(e)}catch(n){return String.fromCharCode(65533)}}var L=e("base64-js"),O=e("ieee754"),D=e("is-array");l.Buffer=t,l.SlowBuffer=r,l.INSPECT_MAX_BYTES=50,t.poolSize=8192;var F=1073741823,B={};t.TYPED_ARRAY_SUPPORT=function(){try{var e=new ArrayBuffer(0),n=new Uint8Array(e);return n.foo=function(){return 42},42===n.foo()&&"function"==typeof n.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(l){return!1}}(),t.isBuffer=function(e){return!(null==e||!e._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var l=e.length,r=n.length,a=0,u=Math.min(l,r);u>a&&e[a]===n[a];a++);return a!==u&&(l=e[a],r=n[a]),r>l?-1:l>r?1:0},t.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(e,n){if(!D(e))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===e.length)return new t(0);if(1===e.length)return e[0];var l;if(void 0===n)for(n=0,l=0;l<e.length;l++)n+=e[l].length;var r=new t(n),a=0;for(l=0;l<e.length;l++){var u=e[l];u.copy(r,a),a+=u.length}return r},t.byteLength=function(e,n){var l;switch(e+="",n||"utf8"){case"ascii":case"binary":case"raw":l=e.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":l=2*e.length;break;case"hex":l=e.length>>>1;break;case"utf8":case"utf-8":l=C(e).length;break;case"base64":l=j(e).length;break;default:l=e.length}return l},t.prototype.length=void 0,t.prototype.parent=void 0,t.prototype.toString=function(e,n,l){var t=!1;if(n>>>=0,l=void 0===l||1/0===l?this.length:l>>>0,e||(e="utf8"),0>n&&(n=0),l>this.length&&(l=this.length),n>=l)return"";for(;;)switch(e){case"hex":return g(this,n,l);case"utf8":case"utf-8":return d(this,n,l);case"ascii":return f(this,n,l);case"binary":return h(this,n,l);case"base64":return p(this,n,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,n,l);default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===t.compare(this,e)},t.prototype.inspect=function(){var e="",n=l.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},t.prototype.compare=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:t.compare(this,e)},t.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},t.prototype.set=function(e,n){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,n)},t.prototype.write=function(e,n,l,t){if(isFinite(n))isFinite(l)||(t=l,l=void 0);else{var r=t;t=n,n=l,l=r}if(n=Number(n)||0,0>l||0>n||n>this.length)throw new RangeError("attempt to write outside buffer bounds");var p=this.length-n;l?(l=Number(l),l>p&&(l=p)):l=p,t=String(t||"utf8").toLowerCase();var d;switch(t){case"hex":d=a(this,e,n,l);break;case"utf8":case"utf-8":d=u(this,e,n,l);break;case"ascii":d=o(this,e,n,l);break;case"binary":d=s(this,e,n,l);break;case"base64":d=i(this,e,n,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=c(this,e,n,l);break;default:throw new TypeError("Unknown encoding: "+t)}return d},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},t.prototype.slice=function(e,n){var l=this.length;e=~~e,n=void 0===n?l:~~n,0>e?(e+=l,0>e&&(e=0)):e>l&&(e=l),0>n?(n+=l,0>n&&(n=0)):n>l&&(n=l),e>n&&(n=e);var r;if(t.TYPED_ARRAY_SUPPORT)r=t._augment(this.subarray(e,n));else{var a=n-e;r=new t(a,void 0,!0);for(var u=0;a>u;u++)r[u]=this[u+e]}return r.length&&(r.parent=this.parent||this),r},t.prototype.readUIntLE=function(e,n,l){e>>>=0,n>>>=0,l||y(e,n,this.length);for(var t=this[e],r=1,a=0;++a<n&&(r*=256);)t+=this[e+a]*r;return t},t.prototype.readUIntBE=function(e,n,l){e>>>=0,n>>>=0,l||y(e,n,this.length);for(var t=this[e+--n],r=1;n>0&&(r*=256);)t+=this[e+--n]*r;return t},t.prototype.readUInt8=function(e,n){return n||y(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,n){return n||y(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,n){return n||y(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,n){return n||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,n){return n||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,n,l){e>>>=0,n>>>=0,l||y(e,n,this.length);for(var t=this[e],r=1,a=0;++a<n&&(r*=256);)t+=this[e+a]*r;return r*=128,t>=r&&(t-=Math.pow(2,8*n)),t},t.prototype.readIntBE=function(e,n,l){e>>>=0,n>>>=0,l||y(e,n,this.length);for(var t=n,r=1,a=this[e+--t];t>0&&(r*=256);)a+=this[e+--t]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*n)),a},t.prototype.readInt8=function(e,n){return n||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,n){n||y(e,2,this.length);var l=this[e]|this[e+1]<<8;return 32768&l?4294901760|l:l},t.prototype.readInt16BE=function(e,n){n||y(e,2,this.length);var l=this[e+1]|this[e]<<8;return 32768&l?4294901760|l:l},t.prototype.readInt32LE=function(e,n){return n||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,n){return n||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,n){return n||y(e,4,this.length),O.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,n){return n||y(e,4,this.length),O.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,n){return n||y(e,8,this.length),O.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,n){return n||y(e,8,this.length),O.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,n,l,t){e=+e,n>>>=0,l>>>=0,t||_(this,e,n,l,Math.pow(2,8*l),0);var r=1,a=0;for(this[n]=255&e;++a<l&&(r*=256);)this[n+a]=e/r>>>0&255;return n+l},t.prototype.writeUIntBE=function(e,n,l,t){e=+e,n>>>=0,l>>>=0,t||_(this,e,n,l,Math.pow(2,8*l),0);var r=l-1,a=1;for(this[n+r]=255&e;--r>=0&&(a*=256);)this[n+r]=e/a>>>0&255;return n+l},t.prototype.writeUInt8=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=e,n+1},t.prototype.writeUInt16LE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e,this[n+1]=e>>>8):x(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=e):x(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e):b(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e):b(this,e,n,!1),n+4},t.prototype.writeIntLE=function(e,n,l,t){e=+e,n>>>=0,t||_(this,e,n,l,Math.pow(2,8*l-1)-1,-Math.pow(2,8*l-1));var r=0,a=1,u=0>e?1:0;for(this[n]=255&e;++r<l&&(a*=256);)this[n+r]=(e/a>>0)-u&255;return n+l},t.prototype.writeIntBE=function(e,n,l,t){e=+e,n>>>=0,t||_(this,e,n,l,Math.pow(2,8*l-1)-1,-Math.pow(2,8*l-1));var r=l-1,a=1,u=0>e?1:0;for(this[n+r]=255&e;--r>=0&&(a*=256);)this[n+r]=(e/a>>0)-u&255;return n+l},t.prototype.writeInt8=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[n]=e,n+1},t.prototype.writeInt16LE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e,this[n+1]=e>>>8):x(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=e):x(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):b(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,l){return e=+e,n>>>=0,l||_(this,e,n,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e):b(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(e,n,l){return I(this,e,n,!0,l)},t.prototype.writeFloatBE=function(e,n,l){return I(this,e,n,!1,l)},t.prototype.writeDoubleLE=function(e,n,l){return w(this,e,n,!0,l)},t.prototype.writeDoubleBE=function(e,n,l){return w(this,e,n,!1,l)},t.prototype.copy=function(e,n,l,r){var a=this;if(l||(l=0),r||0===r||(r=this.length),n>=e.length&&(n=e.length),n||(n=0),r>0&&l>r&&(r=l),r===l)return 0;if(0===e.length||0===a.length)return 0;if(0>n)throw new RangeError("targetStart out of bounds");if(0>l||l>=a.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-n<r-l&&(r=e.length-n+l);var u=r-l;if(1e3>u||!t.TYPED_ARRAY_SUPPORT)for(var o=0;u>o;o++)e[o+n]=this[o+l];else e._set(this.subarray(l,l+u),n);return u},t.prototype.fill=function(e,n,l){if(e||(e=0),n||(n=0),l||(l=this.length),n>l)throw new RangeError("end < start");if(l!==n&&0!==this.length){if(0>n||n>=this.length)throw new RangeError("start out of bounds");if(0>l||l>this.length)throw new RangeError("end out of bounds");var t;if("number"==typeof e)for(t=n;l>t;t++)this[t]=e;else{var r=C(e.toString()),a=r.length;for(t=n;l>t;t++)this[t]=r[t%a]}return this}},t.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(t.TYPED_ARRAY_SUPPORT)return new t(this).buffer;for(var e=new Uint8Array(this.length),n=0,l=e.length;l>n;n+=1)e[n]=this[n];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var N=t.prototype;t._augment=function(e){return e.constructor=t,e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=N.get,e.set=N.set,e.write=N.write,e.toString=N.toString,e.toLocaleString=N.toString,e.toJSON=N.toJSON,e.equals=N.equals,e.compare=N.compare,e.copy=N.copy,e.slice=N.slice,e.readUIntLE=N.readUIntLE,e.readUIntBE=N.readUIntBE,e.readUInt8=N.readUInt8,e.readUInt16LE=N.readUInt16LE,e.readUInt16BE=N.readUInt16BE,e.readUInt32LE=N.readUInt32LE,e.readUInt32BE=N.readUInt32BE,e.readIntLE=N.readIntLE,e.readIntBE=N.readIntBE,e.readInt8=N.readInt8,e.readInt16LE=N.readInt16LE,e.readInt16BE=N.readInt16BE,e.readInt32LE=N.readInt32LE,e.readInt32BE=N.readInt32BE,e.readFloatLE=N.readFloatLE,e.readFloatBE=N.readFloatBE,e.readDoubleLE=N.readDoubleLE,e.readDoubleBE=N.readDoubleBE,e.writeUInt8=N.writeUInt8,e.writeUIntLE=N.writeUIntLE,e.writeUIntBE=N.writeUIntBE,e.writeUInt16LE=N.writeUInt16LE,e.writeUInt16BE=N.writeUInt16BE,e.writeUInt32LE=N.writeUInt32LE,e.writeUInt32BE=N.writeUInt32BE,e.writeIntLE=N.writeIntLE,e.writeIntBE=N.writeIntBE,e.writeInt8=N.writeInt8,e.writeInt16LE=N.writeInt16LE,e.writeInt16BE=N.writeInt16BE,e.writeInt32LE=N.writeInt32LE,e.writeInt32BE=N.writeInt32BE,e.writeFloatLE=N.writeFloatLE,e.writeFloatBE=N.writeFloatBE,e.writeDoubleLE=N.writeDoubleLE,e.writeDoubleBE=N.writeDoubleBE,e.fill=N.fill,e.inspect=N.inspect,e.toArrayBuffer=N.toArrayBuffer,e};var V=/[^+\/0-9A-z\-]/g},{"base64-js":144,ieee754:145,"is-array":146}],144:[function(e,n,l){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function n(e){var n=e.charCodeAt(0);return n===u||n===p?62:n===o||n===d?63:s>n?-1:s+10>n?n-s+26+26:c+26>n?n-c:i+26>n?n-i+26:void 0}function l(e){function l(e){i[p++]=e}var t,r,u,o,s,i;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;s="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,i=new a(3*e.length/4-s),u=s>0?e.length-4:e.length;var p=0;for(t=0,r=0;u>t;t+=4,r+=3)o=n(e.charAt(t))<<18|n(e.charAt(t+1))<<12|n(e.charAt(t+2))<<6|n(e.charAt(t+3)),l((16711680&o)>>16),l((65280&o)>>8),l(255&o);return 2===s?(o=n(e.charAt(t))<<2|n(e.charAt(t+1))>>4,l(255&o)):1===s&&(o=n(e.charAt(t))<<10|n(e.charAt(t+1))<<4|n(e.charAt(t+2))>>2,l(o>>8&255),l(255&o)),i}function r(e){function n(e){return t.charAt(e)}function l(e){return n(e>>18&63)+n(e>>12&63)+n(e>>6&63)+n(63&e)}var r,a,u,o=e.length%3,s="";for(r=0,u=e.length-o;u>r;r+=3)a=(e[r]<<16)+(e[r+1]<<8)+e[r+2],s+=l(a);switch(o){case 1:a=e[e.length-1],s+=n(a>>2),s+=n(a<<4&63),s+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1],s+=n(a>>10),s+=n(a>>4&63),s+=n(a<<2&63),s+="="}return s}var a="undefined"!=typeof Uint8Array?Uint8Array:Array,u="+".charCodeAt(0),o="/".charCodeAt(0),s="0".charCodeAt(0),i="a".charCodeAt(0),c="A".charCodeAt(0),p="-".charCodeAt(0),d="_".charCodeAt(0);e.toByteArray=l,e.fromByteArray=r}("undefined"==typeof l?this.base64js={}:l)},{}],145:[function(e,n,l){l.read=function(e,n,l,t,r){var a,u,o=8*r-t-1,s=(1<<o)-1,i=s>>1,c=-7,p=l?r-1:0,d=l?-1:1,f=e[n+p];for(p+=d,a=f&(1<<-c)-1,f>>=-c,c+=o;c>0;a=256*a+e[n+p],p+=d,c-=8);for(u=a&(1<<-c)-1,a>>=-c,c+=t;c>0;u=256*u+e[n+p],p+=d,c-=8);if(0===a)a=1-i;else{if(a===s)return u?0/0:1/0*(f?-1:1);u+=Math.pow(2,t),a-=i}return(f?-1:1)*u*Math.pow(2,a-t)},l.write=function(e,n,l,t,r,a){var u,o,s,i=8*a-r-1,c=(1<<i)-1,p=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=t?0:a-1,h=t?1:-1,g=0>n||0===n&&0>1/n?1:0;for(n=Math.abs(n),isNaN(n)||1/0===n?(o=isNaN(n)?1:0,u=c):(u=Math.floor(Math.log(n)/Math.LN2),n*(s=Math.pow(2,-u))<1&&(u--,s*=2),n+=u+p>=1?d/s:d*Math.pow(2,1-p),n*s>=2&&(u++,s/=2),u+p>=c?(o=0,u=c):u+p>=1?(o=(n*s-1)*Math.pow(2,r),u+=p):(o=n*Math.pow(2,p-1)*Math.pow(2,r),u=0));r>=8;e[l+f]=255&o,f+=h,o/=256,r-=8);for(u=u<<r|o,i+=r;i>0;e[l+f]=255&u,f+=h,u/=256,i-=8);e[l+f-h]|=128*g}},{}],146:[function(e,n){var l=Array.isArray,t=Object.prototype.toString;n.exports=l||function(e){return!!e&&"[object Array]"==t.call(e)}},{}],147:[function(e,n){function l(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function t(e){return"function"==typeof e}function r(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function u(e){return void 0===e}n.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._maxListeners=void 0,l.defaultMaxListeners=10,l.prototype.setMaxListeners=function(e){if(!r(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},l.prototype.emit=function(e){var n,l,r,o,s,i;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(n=arguments[1],n instanceof Error)throw n;throw TypeError('Uncaught, unspecified "error" event.')}if(l=this._events[e],u(l))return!1;if(t(l))switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];l.apply(this,o)}else if(a(l)){for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];for(i=l.slice(),r=i.length,s=0;r>s;s++)i[s].apply(this,o)}return!0},l.prototype.addListener=function(e,n){var r;if(!t(n))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,t(n.listener)?n.listener:n),this._events[e]?a(this._events[e])?this._events[e].push(n):this._events[e]=[this._events[e],n]:this._events[e]=n,a(this._events[e])&&!this._events[e].warned){var r;r=u(this._maxListeners)?l.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},l.prototype.on=l.prototype.addListener,l.prototype.once=function(e,n){function l(){this.removeListener(e,l),r||(r=!0,n.apply(this,arguments))}if(!t(n))throw TypeError("listener must be a function");var r=!1;return l.listener=n,this.on(e,l),this},l.prototype.removeListener=function(e,n){var l,r,u,o;if(!t(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(l=this._events[e],u=l.length,r=-1,l===n||t(l.listener)&&l.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(a(l)){for(o=u;o-->0;)if(l[o]===n||l[o].listener&&l[o].listener===n){r=o;break}if(0>r)return this;1===l.length?(l.length=0,delete this._events[e]):l.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},l.prototype.removeAllListeners=function(e){var n,l;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(l=this._events[e],t(l))this.removeListener(e,l);else for(;l.length;)this.removeListener(e,l[l.length-1]);return delete this._events[e],this},l.prototype.listeners=function(e){var n;return n=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},l.listenerCount=function(e,n){var l;return l=e._events&&e._events[n]?t(e._events[n])?1:e._events[n].length:0}},{}],148:[function(e,n){n.exports="function"==typeof Object.create?function(e,n){e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,n){e.super_=n;var l=function(){};l.prototype=n.prototype,e.prototype=new l,e.prototype.constructor=e}},{}],149:[function(e,n){n.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],150:[function(e,n,l){(function(e){function n(e,n){for(var l=0,t=e.length-1;t>=0;t--){var r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),l++):l&&(e.splice(t,1),l--)}if(n)for(;l--;l)e.unshift("..");return e}function t(e,n){if(e.filter)return e.filter(n);for(var l=[],t=0;t<e.length;t++)n(e[t],t,e)&&l.push(e[t]);return l}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return r.exec(e).slice(1)};l.resolve=function(){for(var l="",r=!1,a=arguments.length-1;a>=-1&&!r;a--){var u=a>=0?arguments[a]:e.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(l=u+"/"+l,r="/"===u.charAt(0))}return l=n(t(l.split("/"),function(e){return!!e}),!r).join("/"),(r?"/":"")+l||"."},l.normalize=function(e){var r=l.isAbsolute(e),a="/"===u(e,-1);return e=n(t(e.split("/"),function(e){return!!e}),!r).join("/"),e||r||(e="."),e&&a&&(e+="/"),(r?"/":"")+e},l.isAbsolute=function(e){return"/"===e.charAt(0)},l.join=function(){var e=Array.prototype.slice.call(arguments,0);return l.normalize(t(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},l.relative=function(e,n){function t(e){for(var n=0;n<e.length&&""===e[n];n++);for(var l=e.length-1;l>=0&&""===e[l];l--);return n>l?[]:e.slice(n,l-n+1)
}e=l.resolve(e).substr(1),n=l.resolve(n).substr(1);for(var r=t(e.split("/")),a=t(n.split("/")),u=Math.min(r.length,a.length),o=u,s=0;u>s;s++)if(r[s]!==a[s]){o=s;break}for(var i=[],s=o;s<r.length;s++)i.push("..");return i=i.concat(a.slice(o)),i.join("/")},l.sep="/",l.delimiter=":",l.dirname=function(e){var n=a(e),l=n[0],t=n[1];return l||t?(t&&(t=t.substr(0,t.length-1)),l+t):"."},l.basename=function(e,n){var l=a(e)[2];return n&&l.substr(-1*n.length)===n&&(l=l.substr(0,l.length-n.length)),l},l.extname=function(e){return a(e)[3]};var u="b"==="ab".substr(-1)?function(e,n,l){return e.substr(n,l)}:function(e,n,l){return 0>n&&(n=e.length+n),e.substr(n,l)}}).call(this,e("_process"))},{_process:151}],151:[function(e,n){function l(){if(!u){u=!0;for(var e,n=a.length;n;){e=a,a=[];for(var l=-1;++l<n;)e[l]();n=a.length}u=!1}}function t(){}var r=n.exports={},a=[],u=!1;r.nextTick=function(e){a.push(e),u||setTimeout(l,0)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.on=t,r.addListener=t,r.once=t,r.off=t,r.removeListener=t,r.removeAllListeners=t,r.emit=t,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],152:[function(e,n){n.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":153}],153:[function(e,n){(function(l){function t(e){return this instanceof t?(s.call(this,e),i.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",r)):new t(e)}function r(){this.allowHalfOpen||this._writableState.ended||l.nextTick(this.end.bind(this))}function a(e,n){for(var l=0,t=e.length;t>l;l++)n(e[l],l)}n.exports=t;var u=Object.keys||function(e){var n=[];for(var l in e)n.push(l);return n},o=e("core-util-is");o.inherits=e("inherits");var s=e("./_stream_readable"),i=e("./_stream_writable");o.inherits(t,s),a(u(i.prototype),function(e){t.prototype[e]||(t.prototype[e]=i.prototype[e])})}).call(this,e("_process"))},{"./_stream_readable":155,"./_stream_writable":157,_process:151,"core-util-is":158,inherits:148}],154:[function(e,n){function l(e){return this instanceof l?void t.call(this,e):new l(e)}n.exports=l;var t=e("./_stream_transform"),r=e("core-util-is");r.inherits=e("inherits"),r.inherits(l,t),l.prototype._transform=function(e,n,l){l(null,e)}},{"./_stream_transform":156,"core-util-is":158,inherits:148}],155:[function(e,n){(function(l){function t(n,l){var t=e("./_stream_duplex");n=n||{};var r=n.highWaterMark,a=n.objectMode?16:16384;this.highWaterMark=r||0===r?r:a,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!n.objectMode,l instanceof t&&(this.objectMode=this.objectMode||!!n.readableObjectMode),this.defaultEncoding=n.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(C||(C=e("string_decoder/").StringDecoder),this.decoder=new C(n.encoding),this.encoding=n.encoding)}function r(n){e("./_stream_duplex");return this instanceof r?(this._readableState=new t(n,this),this.readable=!0,void R.call(this)):new r(n)}function a(e,n,l,t,r){var a=i(n,l);if(a)e.emit("error",a);else if(S.isNullOrUndefined(l))n.reading=!1,n.ended||c(e,n);else if(n.objectMode||l&&l.length>0)if(n.ended&&!r){var o=new Error("stream.push() after EOF");e.emit("error",o)}else if(n.endEmitted&&r){var o=new Error("stream.unshift() after end event");e.emit("error",o)}else!n.decoder||r||t||(l=n.decoder.write(l)),r||(n.reading=!1),n.flowing&&0===n.length&&!n.sync?(e.emit("data",l),e.read(0)):(n.length+=n.objectMode?1:l.length,r?n.buffer.unshift(l):n.buffer.push(l),n.needReadable&&p(e)),f(e,n);else r||(n.reading=!1);return u(n)}function u(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function o(e){if(e>=M)e=M;else{e--;for(var n=1;32>n;n<<=1)e|=e>>n;e++}return e}function s(e,n){return 0===n.length&&n.ended?0:n.objectMode?0===e?0:1:isNaN(e)||S.isNull(e)?n.flowing&&n.buffer.length?n.buffer[0].length:n.length:0>=e?0:(e>n.highWaterMark&&(n.highWaterMark=o(e)),e>n.length?n.ended?n.length:(n.needReadable=!0,0):e)}function i(e,n){var l=null;return S.isBuffer(n)||S.isString(n)||S.isNullOrUndefined(n)||e.objectMode||(l=new TypeError("Invalid non-string/buffer chunk")),l}function c(e,n){if(n.decoder&&!n.ended){var l=n.decoder.end();l&&l.length&&(n.buffer.push(l),n.length+=n.objectMode?1:l.length)}n.ended=!0,p(e)}function p(e){var n=e._readableState;n.needReadable=!1,n.emittedReadable||(A("emitReadable",n.flowing),n.emittedReadable=!0,n.sync?l.nextTick(function(){d(e)}):d(e))}function d(e){A("emit readable"),e.emit("readable"),_(e)}function f(e,n){n.readingMore||(n.readingMore=!0,l.nextTick(function(){h(e,n)}))}function h(e,n){for(var l=n.length;!n.reading&&!n.flowing&&!n.ended&&n.length<n.highWaterMark&&(A("maybeReadMore read 0"),e.read(0),l!==n.length);)l=n.length;n.readingMore=!1}function g(e){return function(){var n=e._readableState;A("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,0===n.awaitDrain&&k.listenerCount(e,"data")&&(n.flowing=!0,_(e))}}function m(e,n){n.resumeScheduled||(n.resumeScheduled=!0,l.nextTick(function(){y(e,n)}))}function y(e,n){n.resumeScheduled=!1,e.emit("resume"),_(e),n.flowing&&!n.reading&&e.read(0)}function _(e){var n=e._readableState;if(A("flow",n.flowing),n.flowing)do var l=e.read();while(null!==l&&n.flowing)}function x(e,n){var l,t=n.buffer,r=n.length,a=!!n.decoder,u=!!n.objectMode;if(0===t.length)return null;if(0===r)l=null;else if(u)l=t.shift();else if(!e||e>=r)l=a?t.join(""):E.concat(t,r),t.length=0;else if(e<t[0].length){var o=t[0];l=o.slice(0,e),t[0]=o.slice(e)}else if(e===t[0].length)l=t.shift();else{l=a?"":new E(e);for(var s=0,i=0,c=t.length;c>i&&e>s;i++){var o=t[0],p=Math.min(e-s,o.length);a?l+=o.slice(0,p):o.copy(l,s,0,p),p<o.length?t[0]=o.slice(p):t.shift(),s+=p}}return l}function b(e){var n=e._readableState;if(n.length>0)throw new Error("endReadable called on non-empty stream");n.endEmitted||(n.ended=!0,l.nextTick(function(){n.endEmitted||0!==n.length||(n.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function v(e,n){for(var l=0,t=e.length;t>l;l++)n(e[l],l)}function I(e,n){for(var l=0,t=e.length;t>l;l++)if(e[l]===n)return l;return-1}n.exports=r;var w=e("isarray"),E=e("buffer").Buffer;r.ReadableState=t;var k=e("events").EventEmitter;k.listenerCount||(k.listenerCount=function(e,n){return e.listeners(n).length});var R=e("stream"),S=e("core-util-is");S.inherits=e("inherits");var C,A=e("util");A=A&&A.debuglog?A.debuglog("stream"):function(){},S.inherits(r,R),r.prototype.push=function(e,n){var l=this._readableState;return S.isString(e)&&!l.objectMode&&(n=n||l.defaultEncoding,n!==l.encoding&&(e=new E(e,n),n="")),a(this,l,e,n,!1)},r.prototype.unshift=function(e){var n=this._readableState;return a(this,n,e,"",!0)},r.prototype.setEncoding=function(n){return C||(C=e("string_decoder/").StringDecoder),this._readableState.decoder=new C(n),this._readableState.encoding=n,this};var M=8388608;r.prototype.read=function(e){A("read",e);var n=this._readableState,l=e;if((!S.isNumber(e)||e>0)&&(n.emittedReadable=!1),0===e&&n.needReadable&&(n.length>=n.highWaterMark||n.ended))return A("read: emitReadable",n.length,n.ended),0===n.length&&n.ended?b(this):p(this),null;if(e=s(e,n),0===e&&n.ended)return 0===n.length&&b(this),null;var t=n.needReadable;A("need readable",t),(0===n.length||n.length-e<n.highWaterMark)&&(t=!0,A("length less than watermark",t)),(n.ended||n.reading)&&(t=!1,A("reading or ended",t)),t&&(A("do read"),n.reading=!0,n.sync=!0,0===n.length&&(n.needReadable=!0),this._read(n.highWaterMark),n.sync=!1),t&&!n.reading&&(e=s(l,n));var r;return r=e>0?x(e,n):null,S.isNull(r)&&(n.needReadable=!0,e=0),n.length-=e,0!==n.length||n.ended||(n.needReadable=!0),l!==e&&n.ended&&0===n.length&&b(this),S.isNull(r)||this.emit("data",r),r},r.prototype._read=function(){this.emit("error",new Error("not implemented"))},r.prototype.pipe=function(e,n){function t(e){A("onunpipe"),e===p&&a()}function r(){A("onend"),e.end()}function a(){A("cleanup"),e.removeListener("close",s),e.removeListener("finish",i),e.removeListener("drain",m),e.removeListener("error",o),e.removeListener("unpipe",t),p.removeListener("end",r),p.removeListener("end",a),p.removeListener("data",u),!d.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function u(n){A("ondata");var l=e.write(n);!1===l&&(A("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,p.pause())}function o(n){A("onerror",n),c(),e.removeListener("error",o),0===k.listenerCount(e,"error")&&e.emit("error",n)}function s(){e.removeListener("finish",i),c()}function i(){A("onfinish"),e.removeListener("close",s),c()}function c(){A("unpipe"),p.unpipe(e)}var p=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,A("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||n.end!==!1)&&e!==l.stdout&&e!==l.stderr,h=f?r:a;d.endEmitted?l.nextTick(h):p.once("end",h),e.on("unpipe",t);var m=g(p);return e.on("drain",m),p.on("data",u),e._events&&e._events.error?w(e._events.error)?e._events.error.unshift(o):e._events.error=[o,e._events.error]:e.on("error",o),e.once("close",s),e.once("finish",i),e.emit("pipe",p),d.flowing||(A("pipe resume"),p.resume()),e},r.prototype.unpipe=function(e){var n=this._readableState;if(0===n.pipesCount)return this;if(1===n.pipesCount)return e&&e!==n.pipes?this:(e||(e=n.pipes),n.pipes=null,n.pipesCount=0,n.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var l=n.pipes,t=n.pipesCount;n.pipes=null,n.pipesCount=0,n.flowing=!1;for(var r=0;t>r;r++)l[r].emit("unpipe",this);return this}var r=I(n.pipes,e);return-1===r?this:(n.pipes.splice(r,1),n.pipesCount-=1,1===n.pipesCount&&(n.pipes=n.pipes[0]),e.emit("unpipe",this),this)},r.prototype.on=function(e,n){var t=R.prototype.on.call(this,e,n);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var r=this._readableState;if(!r.readableListening)if(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading)r.length&&p(this,r);else{var a=this;l.nextTick(function(){A("readable nexttick read 0"),a.read(0)})}}return t},r.prototype.addListener=r.prototype.on,r.prototype.resume=function(){var e=this._readableState;return e.flowing||(A("resume"),e.flowing=!0,e.reading||(A("resume read 0"),this.read(0)),m(this,e)),this},r.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this},r.prototype.wrap=function(e){var n=this._readableState,l=!1,t=this;e.on("end",function(){if(A("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(r){if(A("wrapped data"),n.decoder&&(r=n.decoder.write(r)),r&&(n.objectMode||r.length)){var a=t.push(r);a||(l=!0,e.pause())}});for(var r in e)S.isFunction(e[r])&&S.isUndefined(this[r])&&(this[r]=function(n){return function(){return e[n].apply(e,arguments)}}(r));var a=["error","close","destroy","pause","resume"];return v(a,function(n){e.on(n,t.emit.bind(t,n))}),t._read=function(n){A("wrapped _read",n),l&&(l=!1,e.resume())},t},r._fromList=x}).call(this,e("_process"))},{"./_stream_duplex":153,_process:151,buffer:143,"core-util-is":158,events:147,inherits:148,isarray:149,stream:163,"string_decoder/":164,util:142}],156:[function(e,n){function l(e,n){this.afterTransform=function(e,l){return t(n,e,l)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function t(e,n,l){var t=e._transformState;t.transforming=!1;var r=t.writecb;if(!r)return e.emit("error",new Error("no writecb in Transform class"));t.writechunk=null,t.writecb=null,o.isNullOrUndefined(l)||e.push(l),r&&r(n);var a=e._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&e._read(a.highWaterMark)}function r(e){if(!(this instanceof r))return new r(e);u.call(this,e),this._transformState=new l(e,this);var n=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){o.isFunction(this._flush)?this._flush(function(e){a(n,e)}):a(n)})}function a(e,n){if(n)return e.emit("error",n);var l=e._writableState,t=e._transformState;if(l.length)throw new Error("calling transform done when ws.length != 0");if(t.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}n.exports=r;var u=e("./_stream_duplex"),o=e("core-util-is");o.inherits=e("inherits"),o.inherits(r,u),r.prototype.push=function(e,n){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,n)},r.prototype._transform=function(){throw new Error("not implemented")},r.prototype._write=function(e,n,l){var t=this._transformState;if(t.writecb=l,t.writechunk=e,t.writeencoding=n,!t.transforming){var r=this._readableState;(t.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},r.prototype._read=function(){var e=this._transformState;o.isNull(e.writechunk)||!e.writecb||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))}},{"./_stream_duplex":153,"core-util-is":158,inherits:148}],157:[function(e,n){(function(l){function t(e,n,l){this.chunk=e,this.encoding=n,this.callback=l}function r(n,l){var t=e("./_stream_duplex");n=n||{};var r=n.highWaterMark,a=n.objectMode?16:16384;this.highWaterMark=r||0===r?r:a,this.objectMode=!!n.objectMode,l instanceof t&&(this.objectMode=this.objectMode||!!n.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var u=n.decodeStrings===!1;this.decodeStrings=!u,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){f(l,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function a(n){var l=e("./_stream_duplex");return this instanceof a||this instanceof l?(this._writableState=new r(n,this),this.writable=!0,void w.call(this)):new a(n)}function u(e,n,t){var r=new Error("write after end");e.emit("error",r),l.nextTick(function(){t(r)})}function o(e,n,t,r){var a=!0;if(!(I.isBuffer(t)||I.isString(t)||I.isNullOrUndefined(t)||n.objectMode)){var u=new TypeError("Invalid non-string/buffer chunk");e.emit("error",u),l.nextTick(function(){r(u)}),a=!1}return a}function s(e,n,l){return!e.objectMode&&e.decodeStrings!==!1&&I.isString(n)&&(n=new v(n,l)),n}function i(e,n,l,r,a){l=s(n,l,r),I.isBuffer(l)&&(r="buffer");var u=n.objectMode?1:l.length;n.length+=u;var o=n.length<n.highWaterMark;return o||(n.needDrain=!0),n.writing||n.corked?n.buffer.push(new t(l,r,a)):c(e,n,!1,u,l,r,a),o}function c(e,n,l,t,r,a,u){n.writelen=t,n.writecb=u,n.writing=!0,n.sync=!0,l?e._writev(r,n.onwrite):e._write(r,a,n.onwrite),n.sync=!1}function p(e,n,t,r,a){t?l.nextTick(function(){n.pendingcb--,a(r)}):(n.pendingcb--,a(r)),e._writableState.errorEmitted=!0,e.emit("error",r)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function f(e,n){var t=e._writableState,r=t.sync,a=t.writecb;if(d(t),n)p(e,t,r,n,a);else{var u=y(e,t);u||t.corked||t.bufferProcessing||!t.buffer.length||m(e,t),r?l.nextTick(function(){h(e,t,u,a)}):h(e,t,u,a)}}function h(e,n,l,t){l||g(e,n),n.pendingcb--,t(),x(e,n)}function g(e,n){0===n.length&&n.needDrain&&(n.needDrain=!1,e.emit("drain"))}function m(e,n){if(n.bufferProcessing=!0,e._writev&&n.buffer.length>1){for(var l=[],t=0;t<n.buffer.length;t++)l.push(n.buffer[t].callback);n.pendingcb++,c(e,n,!0,n.length,n.buffer,"",function(e){for(var t=0;t<l.length;t++)n.pendingcb--,l[t](e)}),n.buffer=[]}else{for(var t=0;t<n.buffer.length;t++){var r=n.buffer[t],a=r.chunk,u=r.encoding,o=r.callback,s=n.objectMode?1:a.length;if(c(e,n,!1,s,a,u,o),n.writing){t++;break}}t<n.buffer.length?n.buffer=n.buffer.slice(t):n.buffer.length=0}n.bufferProcessing=!1}function y(e,n){return n.ending&&0===n.length&&!n.finished&&!n.writing}function _(e,n){n.prefinished||(n.prefinished=!0,e.emit("prefinish"))}function x(e,n){var l=y(e,n);return l&&(0===n.pendingcb?(_(e,n),n.finished=!0,e.emit("finish")):_(e,n)),l}function b(e,n,t){n.ending=!0,x(e,n),t&&(n.finished?l.nextTick(t):e.once("finish",t)),n.ended=!0}n.exports=a;var v=e("buffer").Buffer;a.WritableState=r;var I=e("core-util-is");I.inherits=e("inherits");var w=e("stream");I.inherits(a,w),a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},a.prototype.write=function(e,n,l){var t=this._writableState,r=!1;return I.isFunction(n)&&(l=n,n=null),I.isBuffer(e)?n="buffer":n||(n=t.defaultEncoding),I.isFunction(l)||(l=function(){}),t.ended?u(this,t,l):o(this,t,e,l)&&(t.pendingcb++,r=i(this,t,e,n,l)),r},a.prototype.cork=function(){var e=this._writableState;e.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||m(this,e))},a.prototype._write=function(e,n,l){l(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,n,l){var t=this._writableState;I.isFunction(e)?(l=e,e=null,n=null):I.isFunction(n)&&(l=n,n=null),I.isNullOrUndefined(e)||this.write(e,n),t.corked&&(t.corked=1,this.uncork()),t.ending||t.finished||b(this,t,l)}}).call(this,e("_process"))},{"./_stream_duplex":153,_process:151,buffer:143,"core-util-is":158,inherits:148,stream:163}],158:[function(e,n,l){(function(e){function n(e){return Array.isArray(e)}function t(e){return"boolean"==typeof e}function r(e){return null===e}function a(e){return null==e}function u(e){return"number"==typeof e}function o(e){return"string"==typeof e}function s(e){return"symbol"==typeof e}function i(e){return void 0===e}function c(e){return p(e)&&"[object RegExp]"===y(e)}function p(e){return"object"==typeof e&&null!==e}function d(e){return p(e)&&"[object Date]"===y(e)}function f(e){return p(e)&&("[object Error]"===y(e)||e instanceof Error)}function h(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function m(n){return e.isBuffer(n)}function y(e){return Object.prototype.toString.call(e)}l.isArray=n,l.isBoolean=t,l.isNull=r,l.isNullOrUndefined=a,l.isNumber=u,l.isString=o,l.isSymbol=s,l.isUndefined=i,l.isRegExp=c,l.isObject=p,l.isDate=d,l.isError=f,l.isFunction=h,l.isPrimitive=g,l.isBuffer=m}).call(this,e("buffer").Buffer)},{buffer:143}],159:[function(e,n){n.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":154}],160:[function(e,n,l){l=n.exports=e("./lib/_stream_readable.js"),l.Stream=e("stream"),l.Readable=l,l.Writable=e("./lib/_stream_writable.js"),l.Duplex=e("./lib/_stream_duplex.js"),l.Transform=e("./lib/_stream_transform.js"),l.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,stream:163}],161:[function(e,n){n.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":156}],162:[function(e,n){n.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":157}],163:[function(e,n){function l(){t.call(this)}n.exports=l;var t=e("events").EventEmitter,r=e("inherits");r(l,t),l.Readable=e("readable-stream/readable.js"),l.Writable=e("readable-stream/writable.js"),l.Duplex=e("readable-stream/duplex.js"),l.Transform=e("readable-stream/transform.js"),l.PassThrough=e("readable-stream/passthrough.js"),l.Stream=l,l.prototype.pipe=function(e,n){function l(n){e.writable&&!1===e.write(n)&&i.pause&&i.pause()}function r(){i.readable&&i.resume&&i.resume()}function a(){c||(c=!0,e.end())}function u(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function o(e){if(s(),0===t.listenerCount(this,"error"))throw e}function s(){i.removeListener("data",l),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",o),e.removeListener("error",o),i.removeListener("end",s),i.removeListener("close",s),e.removeListener("close",s)}var i=this;i.on("data",l),e.on("drain",r),e._isStdio||n&&n.end===!1||(i.on("end",a),i.on("close",u));var c=!1;return i.on("error",o),e.on("error",o),i.on("end",s),i.on("close",s),e.on("close",s),e.emit("pipe",i),e}},{events:147,inherits:148,"readable-stream/duplex.js":152,"readable-stream/passthrough.js":159,"readable-stream/readable.js":160,"readable-stream/transform.js":161,"readable-stream/writable.js":162}],164:[function(e,n,l){function t(e){if(e&&!s(e))throw new Error("Unknown encoding: "+e)}function r(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var o=e("buffer").Buffer,s=o.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},i=l.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),t(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=r)}this.charBuffer=new o(6),this.charReceived=0,this.charLength=0};i.prototype.write=function(e){for(var n="";this.charLength;){var l=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,l),this.charReceived+=l,this.charReceived<this.charLength)return"";e=e.slice(l,e.length),n=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var t=n.charCodeAt(n.length-1);if(!(t>=55296&&56319>=t)){if(this.charReceived=this.charLength=0,0===e.length)return n;break}this.charLength+=this.surrogateSize,n=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived),n+=e.toString(this.encoding,0,r);var r=n.length-1,t=n.charCodeAt(r);if(t>=55296&&56319>=t){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),n.substring(0,r)}return n},i.prototype.detectIncompleteChar=function(e){for(var n=e.length>=3?3:e.length;n>0;n--){var l=e[e.length-n];if(1==n&&l>>5==6){this.charLength=2;break}if(2>=n&&l>>4==14){this.charLength=3;break}if(3>=n&&l>>3==30){this.charLength=4;break}}this.charReceived=n},i.prototype.end=function(e){var n="";if(e&&e.length&&(n=this.write(e)),this.charReceived){var l=this.charReceived,t=this.charBuffer,r=this.encoding;n+=t.slice(0,l).toString(r)}return n}},{buffer:143}],165:[function(e,n,l){function t(){throw new Error("tty.ReadStream is not implemented")}function r(){throw new Error("tty.ReadStream is not implemented")}l.isatty=function(){return!1},l.ReadStream=t,l.WriteStream=r},{}],166:[function(e,n){n.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],167:[function(e,n,l){(function(n,t){function r(e,n){var t={seen:[],stylize:u};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),g(n)?t.showHidden=n:n&&l._extend(t,n),v(t.showHidden)&&(t.showHidden=!1),v(t.depth)&&(t.depth=2),v(t.colors)&&(t.colors=!1),v(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=a),s(t,e,t.depth)}function a(e,n){var l=r.styles[n];return l?"["+r.colors[l][0]+"m"+e+"["+r.colors[l][1]+"m":e}function u(e){return e}function o(e){var n={};return e.forEach(function(e){n[e]=!0}),n}function s(e,n,t){if(e.customInspect&&n&&R(n.inspect)&&n.inspect!==l.inspect&&(!n.constructor||n.constructor.prototype!==n)){var r=n.inspect(t,e);return x(r)||(r=s(e,r,t)),r}var a=i(e,n);if(a)return a;var u=Object.keys(n),g=o(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),k(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return c(n);if(0===u.length){if(R(n)){var m=n.name?": "+n.name:"";return e.stylize("[Function"+m+"]","special")}if(I(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(k(n))return c(n)}var y="",_=!1,b=["{","}"];if(h(n)&&(_=!0,b=["[","]"]),R(n)){var v=n.name?": "+n.name:"";y=" [Function"+v+"]"}if(I(n)&&(y=" "+RegExp.prototype.toString.call(n)),E(n)&&(y=" "+Date.prototype.toUTCString.call(n)),k(n)&&(y=" "+c(n)),0===u.length&&(!_||0==n.length))return b[0]+y+b[1];if(0>t)return I(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var w;return w=_?p(e,n,t,g,u):u.map(function(l){return d(e,n,t,g,l,_)}),e.seen.pop(),f(w,y,b)}function i(e,n){if(v(n))return e.stylize("undefined","undefined");if(x(n)){var l="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(l,"string")}return _(n)?e.stylize(""+n,"number"):g(n)?e.stylize(""+n,"boolean"):m(n)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,n,l,t,r){for(var a=[],u=0,o=n.length;o>u;++u)a.push(j(n,String(u))?d(e,n,l,t,String(u),!0):"");return r.forEach(function(r){r.match(/^\d+$/)||a.push(d(e,n,l,t,r,!0))}),a}function d(e,n,l,t,r,a){var u,o,i;if(i=Object.getOwnPropertyDescriptor(n,r)||{value:n[r]},i.get?o=i.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):i.set&&(o=e.stylize("[Setter]","special")),j(t,r)||(u="["+r+"]"),o||(e.seen.indexOf(i.value)<0?(o=m(l)?s(e,i.value,null):s(e,i.value,l-1),o.indexOf("\n")>-1&&(o=a?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),v(u)){if(a&&r.match(/^\d+$/))return o;u=JSON.stringify(""+r),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+o}function f(e,n,l){var t=0,r=e.reduce(function(e,n){return t++,n.indexOf("\n")>=0&&t++,e+n.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?l[0]+(""===n?"":n+"\n ")+" "+e.join(",\n ")+" "+l[1]:l[0]+n+" "+e.join(", ")+" "+l[1]}function h(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function y(e){return null==e}function _(e){return"number"==typeof e}function x(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function v(e){return void 0===e}function I(e){return w(e)&&"[object RegExp]"===C(e)}function w(e){return"object"==typeof e&&null!==e}function E(e){return w(e)&&"[object Date]"===C(e)}function k(e){return w(e)&&("[object Error]"===C(e)||e instanceof Error)}function R(e){return"function"==typeof e}function S(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function A(e){return 10>e?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,n=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],n].join(" ")}function j(e,n){return Object.prototype.hasOwnProperty.call(e,n)}var T=/%[sdj%]/g;l.format=function(e){if(!x(e)){for(var n=[],l=0;l<arguments.length;l++)n.push(r(arguments[l]));return n.join(" ")}for(var l=1,t=arguments,a=t.length,u=String(e).replace(T,function(e){if("%%"===e)return"%";if(l>=a)return e;switch(e){case"%s":return String(t[l++]);case"%d":return Number(t[l++]);case"%j":try{return JSON.stringify(t[l++])}catch(n){return"[Circular]"}default:return e}}),o=t[l];a>l;o=t[++l])u+=m(o)||!w(o)?" "+o:" "+r(o);return u},l.deprecate=function(e,r){function a(){if(!u){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),u=!0}return e.apply(this,arguments)}if(v(t.process))return function(){return l.deprecate(e,r).apply(this,arguments)};if(n.noDeprecation===!0)return e;var u=!1;return a};var P,L={};l.debuglog=function(e){if(v(P)&&(P=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(P)){var t=n.pid;L[e]=function(){var n=l.format.apply(l,arguments);console.error("%s %d: %s",e,t,n)}}else L[e]=function(){};return L[e]},l.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},l.isArray=h,l.isBoolean=g,l.isNull=m,l.isNullOrUndefined=y,l.isNumber=_,l.isString=x,l.isSymbol=b,l.isUndefined=v,l.isRegExp=I,l.isObject=w,l.isDate=E,l.isError=k,l.isFunction=R,l.isPrimitive=S,l.isBuffer=e("./support/isBuffer");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];l.log=function(){console.log("%s - %s",M(),l.format.apply(l,arguments))},l.inherits=e("inherits"),l._extend=function(e,n){if(!n||!w(n))return e;for(var l=Object.keys(n),t=l.length;t--;)e[l[t]]=n[l[t]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":166,_process:151,inherits:148}],168:[function(e,n){(function(l){"use strict";function t(e){this.enabled=e&&void 0!==e.enabled?e.enabled:p}function r(e){var n=function l(){return a.apply(l,arguments)};return n._styles=e,n.enabled=this.enabled,n.__proto__=h,n}function a(){var e=arguments,n=e.length,l=0!==n&&String(arguments[0]);if(n>1)for(var t=1;n>t;t++)l+=" "+e[t];if(!this.enabled||!l)return l;for(var r=this._styles,a=r.length;a--;){var u=s[r[a]];l=u.open+l.replace(u.closeRe,u.open)+u.close}return l}function u(){var e={};return Object.keys(f).forEach(function(n){e[n]={get:function(){return r.call(this,[n])}}}),e}var o=e("escape-string-regexp"),s=e("ansi-styles"),i=e("strip-ansi"),c=e("has-ansi"),p=e("supports-color"),d=Object.defineProperties;"win32"===l.platform&&(s.blue.open="[94m");var f=function(){var e={};return Object.keys(s).forEach(function(n){s[n].closeRe=new RegExp(o(s[n].close),"g"),e[n]={get:function(){return r.call(this,this._styles.concat(n))}}}),e}(),h=d(function(){},f);d(t.prototype,u()),n.exports=new t,n.exports.styles=s,n.exports.hasColor=c,n.exports.stripColor=i,n.exports.supportsColor=p}).call(this,e("_process"))},{_process:151,"ansi-styles":169,"escape-string-regexp":170,"has-ansi":171,"strip-ansi":173,"supports-color":175}],169:[function(e,n){"use strict";var l=n.exports={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};l.colors.grey=l.colors.gray,Object.keys(l).forEach(function(e){var n=l[e];Object.keys(n).forEach(function(e){var t=n[e];l[e]=n[e]={open:"["+t[0]+"m",close:"["+t[1]+"m"}}),Object.defineProperty(l,e,{value:n,enumerable:!1})})},{}],170:[function(e,n){"use strict";var l=/[|\\{}()[\]^$+*?.]/g;n.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");
return e.replace(l,"\\$&")}},{}],171:[function(e,n){"use strict";var l=e("ansi-regex"),t=new RegExp(l().source);n.exports=t.test.bind(t)},{"ansi-regex":172}],172:[function(e,n){"use strict";n.exports=function(){return/(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g}},{}],173:[function(e,n){"use strict";var l=e("ansi-regex")();n.exports=function(e){return"string"==typeof e?e.replace(l,""):e}},{"ansi-regex":174}],174:[function(e,n,l){arguments[4][172][0].apply(l,arguments)},{dup:172}],175:[function(e,n){(function(e){"use strict";var l=e.argv;n.exports=function(){return"FORCE_COLOR"in e.env?!0:-1!==l.indexOf("--no-color")||-1!==l.indexOf("--no-colors")||-1!==l.indexOf("--color=false")?!1:-1!==l.indexOf("--color")||-1!==l.indexOf("--colors")||-1!==l.indexOf("--color=true")||-1!==l.indexOf("--color=always")?!0:e.stdout&&!e.stdout.isTTY?!1:"UPSTART_JOB"in e.env?!1:"win32"===e.platform?!0:"COLORTERM"in e.env?!0:"dumb"===e.env.TERM?!1:/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(e.env.TERM)?!0:!1}()}).call(this,e("_process"))},{_process:151}],176:[function(e,n,l){(function(n){"use strict";function t(e){return new n(e,"base64").toString()}function r(e){return e.split(",").pop()}function a(e,n){var l=c.exec(e);c.lastIndex=0;var t=l[1]||l[2],r=s.join(n,t);try{return o.readFileSync(r,"utf8")}catch(a){throw new Error("An error occurred while trying to read the map file at "+r+"\n"+a)}}function u(e,n){n=n||{};try{n.isFileComment&&(e=a(e,n.commentFileDir)),n.hasComment&&(e=r(e)),n.isEncoded&&(e=t(e)),(n.isJSON||n.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}catch(l){return console.error(l),null}}var o=e("fs"),s=e("path"),i=/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset:\S+;)?base64,(.*)$/gm,c=/(?:\/\/[@#][ \t]+sourceMappingURL=(.+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm;u.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},u.prototype.toBase64=function(){var e=this.toJSON();return new n(e).toString("base64")},u.prototype.toComment=function(){var e=this.toBase64();return"//# sourceMappingURL=data:application/json;base64,"+e},u.prototype.toObject=function(){return JSON.parse(this.toJSON())},u.prototype.addProperty=function(e,n){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,n)},u.prototype.setProperty=function(e,n){return this.sourcemap[e]=n,this},u.prototype.getProperty=function(e){return this.sourcemap[e]},l.fromObject=function(e){return new u(e)},l.fromJSON=function(e){return new u(e,{isJSON:!0})},l.fromBase64=function(e){return new u(e,{isEncoded:!0})},l.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new u(e,{isEncoded:!0,hasComment:!0})},l.fromMapFileComment=function(e,n){return new u(e,{commentFileDir:n,isFileComment:!0,isJSON:!0})},l.fromSource=function(e){var n=e.match(i);return i.lastIndex=0,n?l.fromComment(n.pop()):null},l.fromMapFileSource=function(e,n){var t=e.match(c);return c.lastIndex=0,t?l.fromMapFileComment(t.pop(),n):null},l.removeComments=function(e){return i.lastIndex=0,e.replace(i,"")},l.removeMapFileComments=function(e){return c.lastIndex=0,e.replace(c,"")},l.__defineGetter__("commentRegex",function(){return i.lastIndex=0,i}),l.__defineGetter__("mapFileCommentRegex",function(){return c.lastIndex=0,c})}).call(this,e("buffer").Buffer)},{buffer:143,fs:140,path:150}],177:[function(e,n){!function(e,l,t){"use strict";function r(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function a(e){return"function"==typeof e}function u(e,n,l){e&&!xl(e=l?e:e[bn],Ul)&&Dl(e,Ul,n)}function o(e){return ol.call(e).slice(8,-1)}function s(e){var n,l;return e==t?e===t?"Undefined":"Null":"string"==typeof(l=(n=Tn(e))[Ul])?l:o(n)}function i(){for(var e=j(this),n=arguments.length,l=Pn(n),t=0,r=Wl._,a=!1;n>t;)(l[t]=arguments[t++])===r&&(a=!0);return function(){var t,u=this,o=arguments.length,s=0,i=0;if(!a&&!o)return p(e,l,u);if(t=l.slice(),a)for(;n>s;s++)t[s]===r&&(t[s]=arguments[i++]);for(;o>i;)t.push(arguments[i++]);return p(e,t,u)}}function c(e,n,l){if(j(e),~l&&n===t)return e;switch(l){case 1:return function(l){return e.call(n,l)};case 2:return function(l,t){return e.call(n,l,t)};case 3:return function(l,t,r){return e.call(n,l,t,r)}}return function(){return e.apply(n,arguments)}}function p(e,n,l){var r=l===t;switch(0|n.length){case 0:return r?e():e.call(l);case 1:return r?e(n[0]):e.call(l,n[0]);case 2:return r?e(n[0],n[1]):e.call(l,n[0],n[1]);case 3:return r?e(n[0],n[1],n[2]):e.call(l,n[0],n[1],n[2]);case 4:return r?e(n[0],n[1],n[2],n[3]):e.call(l,n[0],n[1],n[2],n[3]);case 5:return r?e(n[0],n[1],n[2],n[3],n[4]):e.call(l,n[0],n[1],n[2],n[3],n[4])}return e.apply(l,n)}function d(e){return bl(M(e))}function f(e){return e}function h(){return this}function g(e,n){return xl(e,n)?e[n]:void 0}function m(e){return T(e),yl?ml(e).concat(yl(e)):ml(e)}function y(e,n){for(var l,t=d(e),r=gl(t),a=r.length,u=0;a>u;)if(t[l=r[u++]]===n)return l}function _(e){return Ln(e).split(",")}function x(e){var n=1==e,l=2==e,r=3==e,a=4==e,u=6==e,o=5==e||u;return function(s){for(var i,p,d=Tn(M(this)),f=arguments[1],h=bl(d),g=c(s,f,3),m=E(h.length),y=0,_=n?Pn(m):l?[]:t;m>y;y++)if((o||y in h)&&(i=h[y],p=g(i,y,d),e))if(n)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return i;case 6:return y;case 2:_.push(i)}else if(a)return!1;return u?-1:r||a?a:_}}function b(e){return function(n){var l=d(this),t=E(l.length),r=k(arguments[1],t);if(e&&n!=n){for(;t>r;r++)if(I(l[r]))return e||r}else for(;t>r;r++)if((e||r in l)&&l[r]===n)return e||r;return!e&&-1}}function v(e,n){return"function"==typeof e?e:n}function I(e){return e!=e}function w(e){return isNaN(e)?0:Tl(e)}function E(e){return e>0?Ml(w(e),El):0}function k(e,n){var e=w(e);return 0>e?Al(e+n,0):Ml(e,n)}function R(e){return e>9?e:"0"+e}function S(e,n,l){var t=r(n)?function(e){return n[e]}:n;return function(n){return Ln(l?n:this).replace(e,t)}}function C(e){return function(n){var l,r,a=Ln(M(this)),u=w(n),o=a.length;return 0>u||u>=o?e?"":t:(l=a.charCodeAt(u),55296>l||l>56319||u+1===o||(r=a.charCodeAt(u+1))<56320||r>57343?e?a.charAt(u):l:e?a.slice(u,u+2):(l-55296<<10)+(r-56320)+65536)}}function A(e,n,l){if(!e)throw qn(l?n+l:n)}function M(e){if(e==t)throw qn("Function called on null or undefined");return e}function j(e){return A(a(e),e," is not a function!"),e}function T(e){return A(r(e),e," is not an object!"),e}function P(e,n,l){A(e instanceof n,l,": use the 'new' operator!")}function L(e,n){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:n}}function O(e,n,l){return e[n]=l,e}function D(e){return Ll?function(n,l,t){return fl(n,l,L(e,t))}:O}function F(e){return mn+"("+e+")_"+(++Ol+jl())[In](36)}function B(e,n){return Vn&&Vn[e]||(n?Vn:Bl)(mn+al+e)}function N(e,n){for(var l in n)Dl(e,l,n[l]);return e}function V(e){!Ll||!l&&ul(e)||fl(e,ql,{configurable:!0,get:h})}function U(n,t,r){var u,o,s,i,p=n&Xl,d=p?e:n&zl?e[t]:(e[t]||ll)[bn],f=p?Hl:Hl[t]||(Hl[t]={});p&&(r=t);for(u in r)o=!(n&Yl)&&d&&u in d&&(!a(d[u])||ul(d[u])),s=(o?d:r)[u],l||!p||a(d[u])?n&$l&&o?i=c(s,e):n&Ql&&!l&&d[u]==s?(i=function(e){return this instanceof s?new s(e):s(e)},i[bn]=s[bn]):i=n&Kl&&a(s)?c(sl,s):s:i=r[u],l&&d&&!o&&(p?d[u]=s:delete d[u]&&Dl(d,u,s)),f[u]!=s&&Dl(f,u,i)}function q(e,n){Dl(e,ln,n),Cn in nl&&Dl(e,Cn,n)}function G(e,n,l,t){e[bn]=cl(t||tt,{next:L(1,l)}),u(e,n+" Iterator")}function H(e,n,t,r){var a=e[bn],o=g(a,ln)||g(a,Cn)||r&&g(a,r)||t;if(l&&(q(a,o),o!==t)){var s=pl(o.call(new e));u(s,n+" Iterator",!0),xl(a,Cn)&&q(s,h)}return lt[n]=o,lt[n+" Iterator"]=h,o}function W(e,n,l,t,r,a){function u(e){return function(){return new l(this,e)}}G(l,n,t);var o=u(et+nt),s=u(nt);r==nt?s=H(e,n,s,"values"):o=H(e,n,o,"entries"),r&&U(Kl+Yl*rt,n,{entries:o,keys:a?s:u(et),values:s})}function J(e,n){return{value:n,done:!!e}}function Y(n){var l=Tn(n),t=e[mn],r=(t&&t[Sn]||Cn)in l;return r||ln in l||xl(lt,s(l))}function X(n){var l=e[mn],t=n[l&&l[Sn]||Cn],r=t||n[ln]||lt[s(n)];return T(r.call(n))}function z(e,n,l){return l?p(e,n):e(n)}function K(e){var n=!0,l={next:function(){throw 1},"return":function(){n=!1}};l[ln]=h;try{e(l)}catch(t){}return n}function $(e){var n=e["return"];n!==t&&n.call(e)}function Q(e,n){try{e(n)}catch(l){throw $(n),l}}function Z(e,n,l,t){Q(function(e){for(var r,a=c(l,t,n?2:1);!(r=e.next()).done;)if(z(a,r.value,n)===!1)return $(e)},X(e))}var en,nn,ln,tn,rn="Object",an="Function",un="Array",on="String",sn="Number",cn="RegExp",pn="Date",dn="Map",fn="Set",hn="WeakMap",gn="WeakSet",mn="Symbol",yn="Promise",_n="Math",xn="Arguments",bn="prototype",vn="constructor",In="toString",wn=In+"Tag",En="toLocaleString",kn="hasOwnProperty",Rn="forEach",Sn="iterator",Cn="@@"+Sn,An="process",Mn="createElement",jn=e[an],Tn=e[rn],Pn=e[un],Ln=e[on],On=e[sn],Dn=(e[cn],e[pn],e[dn]),Fn=e[fn],Bn=e[hn],Nn=e[gn],Vn=e[mn],Un=e[_n],qn=e.TypeError,Gn=e.RangeError,Hn=e.setTimeout,Wn=e.setImmediate,Jn=e.clearImmediate,Yn=e.parseInt,Xn=e.isFinite,zn=e[An],Kn=zn&&zn.nextTick,$n=e.document,Qn=$n&&$n.documentElement,Zn=(e.navigator,e.define),el=e.console||{},nl=Pn[bn],ll=Tn[bn],tl=jn[bn],rl=1/0,al=".",ul=c(/./.test,/\[native code\]\s*\}\s*$/,1),ol=ll[In],sl=tl.call,il=tl.apply,cl=Tn.create,pl=Tn.getPrototypeOf,dl=Tn.setPrototypeOf,fl=Tn.defineProperty,hl=(Tn.defineProperties,Tn.getOwnPropertyDescriptor),gl=Tn.keys,ml=Tn.getOwnPropertyNames,yl=Tn.getOwnPropertySymbols,_l=Tn.isFrozen,xl=c(sl,ll[kn],2),bl=Tn,vl=Tn.assign||function(e){for(var n=Tn(M(e)),l=arguments.length,t=1;l>t;)for(var r,a=bl(arguments[t++]),u=gl(a),o=u.length,s=0;o>s;)n[r=u[s++]]=a[r];return n},Il=nl.push,wl=(nl.unshift,nl.slice,nl.splice,nl.indexOf,nl[Rn]),El=9007199254740991,kl=Un.pow,Rl=Un.abs,Sl=Un.ceil,Cl=Un.floor,Al=Un.max,Ml=Un.min,jl=Un.random,Tl=Un.trunc||function(e){return(e>0?Cl:Sl)(e)},Pl="Reduce of empty object with no initial value",Ll=!!function(){try{return 2==fl({},"a",{get:function(){return 2}}).a}catch(e){}}(),Ol=0,Dl=D(1),Fl=Vn?O:Dl,Bl=Vn||F,Nl=B("unscopables"),Vl=nl[Nl]||{},Ul=B(wn),ql=B("species"),Gl=o(zn)==An,Hl={},Wl=l?e:Hl,Jl=e.core,Yl=1,Xl=2,zl=4,Kl=8,$l=16,Ql=32;"undefined"!=typeof n&&n.exports?n.exports=Hl:a(Zn)&&Zn.amd?Zn(function(){return Hl}):tn=!0,(tn||l)&&(Hl.noConflict=function(){return e.core=Jl,Hl},e.core=Hl),ln=B(Sn);var Zl=Bl("iter"),et=1,nt=2,lt={},tt={},rt="keys"in nl&&!("next"in[].keys());q(tt,h),!function(n,l,t,r){ul(Vn)||(Vn=function(e){A(!(this instanceof Vn),mn+" is not a "+vn);var l=F(e),a=Fl(cl(Vn[bn]),n,l);return t[l]=a,Ll&&r&&fl(ll,l,{configurable:!0,set:function(e){Dl(this,l,e)}}),a},Dl(Vn[bn],In,function(){return this[n]})),U(Xl+Ql,{Symbol:Vn});var a={"for":function(e){return xl(l,e+="")?l[e]:l[e]=Vn(e)},iterator:ln||B(Sn),keyFor:i.call(y,l),species:ql,toStringTag:Ul=B(wn,!0),unscopables:Nl,pure:Bl,set:Fl,useSetter:function(){r=!0},useSimple:function(){r=!1}};wl.call(_("hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive"),function(e){a[e]=B(e)}),U(zl,mn,a),u(Vn,mn),U(zl+Yl*!ul(Vn),rn,{getOwnPropertyNames:function(e){for(var n,l=ml(d(e)),r=[],a=0;l.length>a;)xl(t,n=l[a++])||r.push(n);return r},getOwnPropertySymbols:function(e){for(var n,l=ml(d(e)),r=[],a=0;l.length>a;)xl(t,n=l[a++])&&r.push(t[n]);return r}}),u(Un,_n,!0),u(e.JSON,"JSON",!0)}(Bl("tag"),{},{},!0),!function(){var e={assign:vl,is:function(e,n){return e===n?0!==e||1/e===1/n:e!=e&&n!=n}};"__proto__"in ll&&function(n,l){try{l=c(sl,hl(ll,"__proto__").set,2),l({},nl)}catch(t){n=!0}e.setPrototypeOf=dl=dl||function(e,t){return T(e),A(null===t||r(t),t,": can't set as prototype!"),n?e.__proto__=t:l(e,t),e}}(),U(zl,rn,e)}(),!function(){function e(e,n){var l=Tn[e],t=Hl[rn][e],a=0,u={};if(!t||ul(t)){u[e]=1==n?function(e){return r(e)?l(e):e}:2==n?function(e){return r(e)?l(e):!0}:3==n?function(e){return r(e)?l(e):!1}:4==n?function(e,n){return l(d(e),n)}:function(e){return l(d(e))};try{l(al)}catch(o){a=1}U(zl+Yl*a,rn,u)}}e("freeze",1),e("seal",1),e("preventExtensions",1),e("isFrozen",2),e("isSealed",2),e("isExtensible",3),e("getOwnPropertyDescriptor",4),e("getPrototypeOf"),e("keys"),e("getOwnPropertyNames")}(),!function(e){U(zl,sn,{EPSILON:kl(2,-52),isFinite:function(e){return"number"==typeof e&&Xn(e)},isInteger:e,isNaN:I,isSafeInteger:function(n){return e(n)&&Rl(n)<=El},MAX_SAFE_INTEGER:El,MIN_SAFE_INTEGER:-El,parseFloat:parseFloat,parseInt:Yn})}(On.isInteger||function(e){return!r(e)&&Xn(e)&&Cl(e)===e}),!function(){function e(n){return Xn(n=+n)&&0!=n?0>n?-e(-n):r(n+a(n*n+1)):n}function n(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:t(e)-1}var l=Un.E,t=Un.exp,r=Un.log,a=Un.sqrt,u=Un.sign||function(e){return 0==(e=+e)||e!=e?e:0>e?-1:1};U(zl,_n,{acosh:function(e){return(e=+e)<1?0/0:Xn(e)?r(e/l+a(e+1)*a(e-1)/l)+1:e},asinh:e,atanh:function(e){return 0==(e=+e)?e:r((1+e)/(1-e))/2},cbrt:function(e){return u(e=+e)*kl(Rl(e),1/3)},clz32:function(e){return(e>>>=0)?32-e[In](2).length:32},cosh:function(e){return(t(e=+e)+t(-e))/2},expm1:n,fround:function(e){return new Float32Array([e])[0]},hypot:function(){for(var e,n=0,l=arguments.length,t=l,r=Pn(l),u=-rl;l--;){if(e=r[l]=+arguments[l],e==rl||e==-rl)return rl;e>u&&(u=e)}for(u=e||1;t--;)n+=kl(r[t]/u,2);return u*a(n)},imul:function(e,n){var l=65535,t=+e,r=+n,a=l&t,u=l&r;return 0|a*u+((l&t>>>16)*u+a*(l&r>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:r(1+e)},log10:function(e){return r(e)/Un.LN10},log2:function(e){return r(e)/Un.LN2},sign:u,sinh:function(e){return Rl(e=+e)<1?(n(e)-n(-e))/2:(t(e-1)-t(-e-1))*(l/2)},tanh:function(e){var l=n(e=+e),r=n(-e);return l==rl?1:r==rl?-1:(l-r)/(t(e)+t(-e))},trunc:Tl})}(),!function(e){function n(e){if(o(e)==cn)throw qn()}U(zl,on,{fromCodePoint:function(){for(var n,l=[],t=arguments.length,r=0;t>r;){if(n=+arguments[r++],k(n,1114111)!==n)throw Gn(n+" is not a valid code point");l.push(65536>n?e(n):e(((n-=65536)>>10)+55296,n%1024+56320))}return l.join("")},raw:function(e){for(var n=d(e.raw),l=E(n.length),t=arguments.length,r=[],a=0;l>a;)r.push(Ln(n[a++])),t>a&&r.push(Ln(arguments[a]));return r.join("")}}),U(Kl,on,{codePointAt:C(!1),endsWith:function(e){n(e);var l=Ln(M(this)),r=arguments[1],a=E(l.length),u=r===t?a:Ml(E(r),a);return e+="",l.slice(u-e.length,u)===e},includes:function(e){return n(e),!!~Ln(M(this)).indexOf(e,arguments[1])},repeat:function(e){var n=Ln(M(this)),l="",t=w(e);if(0>t||t==rl)throw Gn("Count can't be negative");for(;t>0;(t>>>=1)&&(n+=n))1&t&&(l+=n);return l},startsWith:function(e){n(e);var l=Ln(M(this)),t=E(Ml(arguments[1],l.length));return e+="",l.slice(t,t+e.length)===e}})}(Ln.fromCharCode),!function(){U(zl+Yl*K(Pn.from),un,{from:function(e){var n,l,r,a=Tn(M(e)),u=arguments[1],o=u!==t,s=o?c(u,arguments[2],2):t,i=0;if(Y(a))l=new(v(this,Pn)),Q(function(e){for(;!(r=e.next()).done;i++)l[i]=o?s(r.value,i):r.value},X(a));else for(l=new(v(this,Pn))(n=E(a.length));n>i;i++)l[i]=o?s(a[i],i):a[i];return l.length=i,l}}),U(zl,un,{of:function(){for(var e=0,n=arguments.length,l=new(v(this,Pn))(n);n>e;)l[e]=arguments[e++];return l.length=n,l}}),V(Pn)}(),!function(){U(Kl,un,{copyWithin:function(e,n){var l=Tn(M(this)),r=E(l.length),a=k(e,r),u=k(n,r),o=arguments[2],s=o===t?r:k(o,r),i=Ml(s-u,r-a),c=1;for(a>u&&u+i>a&&(c=-1,u=u+i-1,a=a+i-1);i-->0;)u in l?l[a]=l[u]:delete l[a],a+=c,u+=c;return l},fill:function(e){for(var n=Tn(M(this)),l=E(n.length),r=k(arguments[1],l),a=arguments[2],u=a===t?l:k(a,l);u>r;)n[r++]=e;return n},find:x(5),findIndex:x(6)}),l&&(wl.call(_("find,findIndex,fill,copyWithin,entries,keys,values"),function(e){Vl[e]=!0}),Nl in nl||Dl(nl,Nl,Vl))}(),!function(e){W(Pn,un,function(e,n){Fl(this,Zl,{o:d(e),i:0,k:n})},function(){var e=this[Zl],n=e.o,l=e.k,r=e.i++;return!n||r>=n.length?(e.o=t,J(1)):l==et?J(0,r):l==nt?J(0,n[r]):J(0,[r,n[r]])},nt),lt[xn]=lt[un],W(Ln,on,function(e){Fl(this,Zl,{o:Ln(e),i:0})},function(){var n,l=this[Zl],t=l.o,r=l.i;return r>=t.length?J(1):(n=e.call(t,r),l.i+=n.length,J(0,n))})}(C(!0)),a(Wn)&&a(Jn)||function(n){function l(e){if(xl(g,e)){var n=g[e];delete g[e],n()}}function t(e){l(e.data)}var r,u,o,s=e.postMessage,d=e.addEventListener,f=e.MessageChannel,h=0,g={};Wn=function(e){for(var n=[],l=1;arguments.length>l;)n.push(arguments[l++]);return g[++h]=function(){p(a(e)?e:jn(e),n)},r(h),h},Jn=function(e){delete g[e]},Gl?r=function(e){Kn(i.call(l,e))}:d&&a(s)&&!e.importScripts?(r=function(e){s(e,"*")},d("message",t,!1)):a(f)?(u=new f,o=u.port2,u.port1.onmessage=t,r=c(o.postMessage,o,1)):r=$n&&n in $n[Mn]("script")?function(e){Qn.appendChild($n[Mn]("script"))[n]=function(){Qn.removeChild(this),l(e)}}:function(e){Hn(l,0,e)}}("onreadystatechange"),U(Xl+$l,{setImmediate:Wn,clearImmediate:Jn}),!function(e,n){a(e)&&a(e.resolve)&&e.resolve(n=new e(function(){}))==n||function(n,l){function u(e){var n;return r(e)&&(n=e.then),a(n)?n:!1}function o(e){var n,t=e[l],r=t.c,a=0;if(t.h)return!0;for(;r.length>a;)if(n=r[a++],n.fail||o(n.P))return!0}function s(e,l){var t=e.c;(l||t.length)&&n(function(){var n=e.p,r=e.v,s=1==e.s,i=0;if(l&&!o(n))Hn(function(){o(n)||(Gl?!zn.emit("unhandledRejection",r,n):a(el.error)&&el.error("Unhandled promise rejection",r))},1e3);else for(;t.length>i;)!function(n){var l,t,a=s?n.ok:n.fail;try{a?(s||(e.h=!0),l=a===!0?r:a(r),l===n.P?n.rej(qn(yn+"-chain cycle")):(t=u(l))?t.call(l,n.res,n.rej):n.res(l)):n.rej(r)}catch(o){n.rej(o)}}(t[i++]);t.length=0})}function i(e){var n,l,t=this;if(!t.d){t.d=!0,t=t.r||t;try{(n=u(e))?(l={r:t,d:!1},n.call(e,c(i,l,1),c(p,l,1))):(t.v=e,t.s=1,s(t))}catch(r){p.call(l||{r:t,d:!1},r)}}}function p(e){var n=this;n.d||(n.d=!0,n=n.r||n,n.v=e,n.s=2,s(n,!0))}function d(e){var n=T(e)[ql];return n!=t?n:e}e=function(n){j(n),P(this,e,yn);var r={p:this,c:[],s:0,d:!1,v:t,h:!1};Dl(this,l,r);try{n(c(i,r,1),c(p,r,1))}catch(a){p.call(r,a)}},N(e[bn],{then:function(n,r){var u=T(T(this)[vn])[ql],o={ok:a(n)?n:!0,fail:a(r)?r:!1},i=o.P=new(u!=t?u:e)(function(e,n){o.res=j(e),o.rej=j(n)}),c=this[l];return c.c.push(o),c.s&&s(c),i},"catch":function(e){return this.then(t,e)}}),N(e,{all:function(e){var n=d(this),l=[];return new n(function(t,r){Z(e,!1,Il,l);var a=l.length,u=Pn(a);a?wl.call(l,function(e,l){n.resolve(e).then(function(e){u[l]=e,--a||t(u)},r)}):t(u)})},race:function(e){var n=d(this);return new n(function(l,t){Z(e,!1,function(e){n.resolve(e).then(l,t)})})},reject:function(e){return new(d(this))(function(n,l){l(e)})},resolve:function(e){return r(e)&&l in e&&pl(e)===this[bn]?e:new(d(this))(function(n){n(e)})}})}(Kn||Wn,Bl("record")),u(e,yn),V(e),U(Xl+Yl*!ul(e),{Promise:e})}(e[yn]),!function(){function e(e,n,r,a,o,s){function i(e,n){return n!=t&&Z(n,o,e[f],e),e}function c(e,n){var t=h[e];l&&(h[e]=function(e,l){var r=t.call(this,0===e?0:e,l);return n?this:r})}var f=o?"set":"add",h=e&&e[bn],_={};if(ul(e)&&(s||!rt&&xl(h,Rn)&&xl(h,"entries"))){var b,v=e,I=new e,w=I[f](s?{}:-0,1);K(function(n){new e(n)})&&(e=function(l){return P(this,e,n),i(new v,l)},e[bn]=h,l&&(h[vn]=e)),s||I[Rn](function(e,n){b=1/n===-rl}),b&&(c("delete"),c("has"),o&&c("get")),(b||w!==I)&&c(f,!0)}else e=s?function(l){P(this,e,n),Fl(this,p,x++),i(this,l)}:function(l){var r=this;P(r,e,n),Fl(r,d,cl(null)),Fl(r,y,0),Fl(r,g,t),Fl(r,m,t),i(r,l)},N(N(e[bn],r),a),s||!Ll||fl(e[bn],"size",{get:function(){return M(this[y])}});return u(e,n),V(e),_[n]=e,U(Xl+Ql+Yl*!ul(e),_),s||W(e,n,function(e,n){Fl(this,Zl,{o:e,k:n})},function(){for(var e=this[Zl],n=e.k,l=e.l;l&&l.r;)l=l.p;return e.o&&(e.l=l=l?l.n:e.o[m])?n==et?J(0,l.k):n==nt?J(0,l.v):J(0,[l.k,l.v]):(e.o=t,J(1))},o?et+nt:nt,!o),e}function n(e,n){if(!r(e))return("string"==typeof e?"S":"P")+e;if(_l(e))return"F";if(!xl(e,p)){if(!n)return"E";Dl(e,p,++x)}return"O"+e[p]}function a(e,l){var t,r=n(l);if("F"!=r)return e[d][r];for(t=e[m];t;t=t.n)if(t.k==l)return t}function o(e,l,r){var u,o,s=a(e,l);return s?s.v=r:(e[g]=s={i:o=n(l,!0),k:l,v:r,p:u=e[g],n:t,r:!1},e[m]||(e[m]=s),u&&(u.n=s),e[y]++,"F"!=o&&(e[d][o]=s)),e}function s(e,n,l){return _l(T(n))?i(e).set(n,l):(xl(n,f)||Dl(n,f,{}),n[f][e[p]]=l),e}function i(e){return e[h]||Dl(e,h,new Dn)[h]}var p=Bl("uid"),d=Bl("O1"),f=Bl("weak"),h=Bl("leak"),g=Bl("last"),m=Bl("first"),y=Ll?Bl("size"):"size",x=0,b={},v={clear:function(){for(var e=this,n=e[d],l=e[m];l;l=l.n)l.r=!0,l.p&&(l.p=l.p.n=t),delete n[l.i];e[m]=e[g]=t,e[y]=0},"delete":function(e){var n=this,l=a(n,e);if(l){var t=l.n,r=l.p;delete n[d][l.i],l.r=!0,r&&(r.n=t),t&&(t.p=r),n[m]==l&&(n[m]=t),n[g]==l&&(n[g]=r),n[y]--}return!!l},forEach:function(e){for(var n,l=c(e,arguments[1],3);n=n?n.n:this[m];)for(l(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!a(this,e)}};Dn=e(Dn,dn,{get:function(e){var n=a(this,e);return n&&n.v},set:function(e,n){return o(this,0===e?0:e,n)}},v,!0),Fn=e(Fn,fn,{add:function(e){return o(this,e=0===e?0:e,e)}},v);var I={"delete":function(e){return r(e)?_l(e)?i(this)["delete"](e):xl(e,f)&&xl(e[f],this[p])&&delete e[f][this[p]]:!1},has:function(e){return r(e)?_l(e)?i(this).has(e):xl(e,f)&&xl(e[f],this[p]):!1}};Bn=e(Bn,hn,{get:function(e){if(r(e)){if(_l(e))return i(this).get(e);if(xl(e,f))return e[f][this[p]]}},set:function(e,n){return s(this,e,n)}},I,!0,!0),l&&7!=(new Bn).set(Tn.freeze(b),7).get(b)&&wl.call(_("delete,has,get,set"),function(e){var n=Bn[bn][e];Bn[bn][e]=function(l,t){if(r(l)&&_l(l)){var a=i(this)[e](l,t);return"set"==e?this:a}return n.call(this,l,t)}}),Nn=e(Nn,gn,{add:function(e){return s(this,e,!0)}},I,!1,!0)}(),!function(){function e(e){var n,l=[];for(n in e)l.push(n);Fl(this,Zl,{o:e,a:l,i:0})}function n(e){return function(n){T(n);try{return e.apply(t,arguments),!0}catch(l){return!1}}}function l(e,n){var a,u=arguments.length<3?e:arguments[2],o=hl(T(e),n);return o?xl(o,"value")?o.value:o.get===t?t:o.get.call(u):r(a=pl(e))?l(a,n,u):t}function a(e,n,l){var u,o,s=arguments.length<4?e:arguments[3],i=hl(T(e),n);if(!i){if(r(o=pl(e)))return a(o,n,l,s);i=L(0)}return xl(i,"value")?i.writable!==!1&&r(s)?(u=hl(s,n)||L(0),u.value=l,fl(s,n,u),!0):!1:i.set===t?!1:(i.set.call(s,l),!0)}G(e,rn,function(){var e,n=this[Zl],l=n.a;do if(n.i>=l.length)return J(1);while(!((e=l[n.i++])in n.o));return J(0,e)});var u=Tn.isExtensible||f,o={apply:c(sl,il,3),construct:function(e,n){var l=j(arguments.length<3?e:arguments[2])[bn],t=cl(r(l)?l:ll),a=il.call(e,t,n);return r(a)?a:t},defineProperty:n(fl),deleteProperty:function(e,n){var l=hl(T(e),n);return l&&!l.configurable?!1:delete e[n]},enumerate:function(n){return new e(T(n))},get:l,getOwnPropertyDescriptor:function(e,n){return hl(T(e),n)},getPrototypeOf:function(e){return pl(T(e))},has:function(e,n){return n in e},isExtensible:function(e){return!!u(T(e))},ownKeys:m,preventExtensions:n(Tn.preventExtensions||f),set:a};dl&&(o.setPrototypeOf=function(e,n){return dl(T(e),n),!0}),U(Xl,{Reflect:{}}),U(zl,"Reflect",o)}(),!function(){function e(e){return function(n){var l,t=d(n),r=gl(n),a=r.length,u=0,o=Pn(a);if(e)for(;a>u;)o[u]=[l=r[u++],t[l]];else for(;a>u;)o[u]=t[r[u++]];return o}}U(Kl,un,{includes:b(!0)}),U(Kl,on,{at:C(!0)}),U(zl,rn,{getOwnPropertyDescriptors:function(e){var n=d(e),l={};return wl.call(m(n),function(e){fl(l,e,L(0,hl(n,e)))}),l},values:e(!1),entries:e(!0)}),U(zl,cn,{escape:S(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",!0)})}(),!function(e){function n(e){if(e){var n=e[bn];Dl(n,en,n.get),Dl(n,l,n.set),Dl(n,t,n["delete"])}}en=B(e+"Get",!0);var l=B(e+fn,!0),t=B(e+"Delete",!0);U(zl,mn,{referenceGet:en,referenceSet:l,referenceDelete:t}),Dl(tl,en,h),n(Dn),n(Bn)}("reference"),!function(e){function n(e,n){Fl(this,Zl,{o:d(e),a:gl(e),i:0,k:n})}function l(e){return function(l){return new n(l,e)}}function a(e){var n=1==e,l=4==e;return function(r,a,u){var o,s,i,p=c(a,u,3),f=d(r),h=n||7==e||2==e?new(v(this,nn)):t;for(o in f)if(xl(f,o)&&(s=f[o],i=p(s,o,r),e))if(n)h[o]=i;else if(i)switch(e){case 2:h[o]=s;break;case 3:return!0;case 5:return s;case 6:return o;case 7:h[i[0]]=i[1]}else if(l)return!1;return 3==e||l?l:h}}function u(e){return function(n,l,r){j(l);var a,u,o,s=d(n),i=gl(s),c=i.length,p=0;for(e?a=r==t?new(v(this,nn)):Tn(r):arguments.length<3?(A(c,Pl),a=s[i[p++]]):a=Tn(r);c>p;)if(xl(s,u=i[p++]))if(o=l(a,s[u],u,n),e){if(o===!1)break}else a=o;return a}}function o(e,n){return(n==n?y(e,n):s(e,I))!==t}nn=function(e){var n=cl(null);return e!=t&&(Y(e)?Z(e,!0,function(e,l){n[e]=l}):vl(n,e)),n},nn[bn]=null,G(n,e,function(){var e,n=this[Zl],l=n.o,r=n.a,a=n.k;do if(n.i>=r.length)return n.o=t,J(1);while(!xl(l,e=r[n.i++]));return a==et?J(0,e):a==nt?J(0,l[e]):J(0,[e,l[e]])});var s=a(6),i={keys:l(et),values:l(nt),entries:l(et+nt),forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findKey:s,mapPairs:a(7),reduce:u(!1),turn:u(!0),keyOf:y,includes:o,has:xl,get:g,set:D(0),isDict:function(e){return r(e)&&pl(e)===nn[bn]}};if(en)for(var f in i)!function(e){function n(){for(var n=[this],l=0;l<arguments.length;)n.push(arguments[l++]);return p(e,n)}e[en]=function(){return n}}(i[f]);U(Xl+Yl,{Dict:N(nn,i)})}("Dict"),!function(e,n){function l(n,t){return this instanceof l?(this[Zl]=X(n),void(this[e]=!!t)):new l(n,t)}function r(l){function t(l,t,r){this[Zl]=X(l),this[e]=l[e],this[n]=c(t,r,l[e]?2:1)}return G(t,"Chain",l,a),q(t[bn],h),t}G(l,"Wrapper",function(){return this[Zl].next()});var a=l[bn];q(a,function(){return this[Zl]});var u=r(function(){var l=this[Zl].next();return l.done?l:J(0,z(this[n],l.value,this[e]))}),o=r(function(){for(;;){var l=this[Zl].next();if(l.done||z(this[n],l.value,this[e]))return l}});N(a,{of:function(n,l){Z(this,this[e],n,l)},array:function(e,n){var l=[];return Z(e!=t?this.map(e,n):this,!1,Il,l),l},filter:function(e,n){return new o(this,e,n)},map:function(e,n){return new u(this,e,n)}}),l.isIterable=Y,l.getIterator=X,U(Xl+Yl,{$for:l})}("entries",Bl("fn")),U(Xl+Yl,{delay:function(e){return new Promise(function(n){Hn(n,e,!0)})}}),!function(e,n){function l(l){var r=this,a={};return Dl(r,e,function(e){return e!==t&&e in r?xl(a,e)?a[e]:a[e]=c(r[e],r,-1):n.call(r)})[e](l)}Hl._=Wl._=Wl._||{},U(Kl+Yl,an,{part:i,only:function(e,n){var l=j(this),t=E(e),r=arguments.length>1;return function(){for(var e=Ml(t,arguments.length),a=Pn(e),u=0;e>u;)a[u]=arguments[u++];return p(l,a,r?n:this)}}}),Dl(Wl._,In,function(){return e}),Dl(ll,e,l),Ll||Dl(nl,e,l)}(Ll?F("tie"):En,ll[En]),!function(){function e(e,n){for(var l,t=m(d(n)),r=t.length,a=0;r>a;)fl(e,l=t[a++],hl(n,l));return e}U(zl+Yl,rn,{isObject:r,classof:s,define:e,make:function(n,l){return e(cl(n),l)}})}(),U(Kl+Yl,un,{turn:function(e,n){j(e);for(var l=n==t?[]:Tn(n),r=bl(this),a=E(r.length),u=0;a>u&&e(l,r[u],u++,this)!==!1;);return l}}),l&&(Vl.turn=!0),!function(e){function n(e){Fl(this,Zl,{l:E(e),i:0})}G(n,sn,function(){var e=this[Zl],n=e.i++;return n<e.l?J(0,n):J(1)}),H(On,sn,function(){return new n(this)}),e.random=function(e){var n=+this,l=e==t?0:+e,r=Ml(n,l);return jl()*(Al(n,l)-r)+r},wl.call(_("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc"),function(n){var l=Un[n];l&&(e[n]=function(){for(var e=[+this],n=0;arguments.length>n;)e.push(arguments[n++]);return p(l,e)})}),U(Kl+Yl,sn,e)}({}),!function(){var e,n={"&":"&","<":"<",">":">",'"':""","'":"'"},l={};for(e in n)l[n[e]]=e;U(Kl+Yl,on,{escapeHTML:S(/[&<>"']/g,n),unescapeHTML:S(/&(?:amp|lt|gt|quot|apos);/g,l)})}(),!function(e,n,l,t,r,a,u,o,s){function i(n){return function(i,c){function p(e){return d[n+e]()}var d=this,f=l[xl(l,c)?c:t];return Ln(i).replace(e,function(e){switch(e){case"s":return p(r);case"ss":return R(p(r));case"m":return p(a);case"mm":return R(p(a));case"h":return p(u);case"hh":return R(p(u));case"D":return p(pn);case"DD":return R(p(pn));case"W":return f[0][p("Day")];case"N":return p(o)+1;case"NN":return R(p(o)+1);case"M":return f[2][p(o)];case"MM":return f[1][p(o)];case"Y":return p(s);case"YY":return R(p(s)%100)}return e})}}function c(e,t){function r(e){var l=[];return wl.call(_(t.months),function(t){l.push(t.replace(n,"$"+e))}),l}return l[e]=[_(t.weekdays),r(1),r(2)],Hl}U(Kl+Yl,pn,{format:i("get"),formatUTC:i("getUTC")}),c(t,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"}),c("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"}),Hl.locale=function(e){return xl(l,e)?t=e:t},Hl.addLocale=c}(/\b\w\w?\b/g,/:(.*)\|(.*)$/,{},"en","Seconds","Minutes","Hours","Month","FullYear"),U(Xl+Yl,{global:e}),!function(e){function n(n,l){wl.call(_(n),function(n){n in nl&&(e[n]=c(sl,nl[n],l))})}n("pop,reverse,shift,keys,values,entries",1),n("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),n("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill,turn"),U(zl,un,e)}({}),!function(e){!l||!e||ln in e[bn]||Dl(e[bn],ln,lt[un]),lt.NodeList=lt[un]}(e.NodeList),!function(e,n){wl.call(_("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,markTimeline,profile,profileEnd,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn"),function(l){e[l]=function(){return n&&l in el?il.call(el[l],el,arguments):void 0}}),U(Xl+Yl,{log:vl(e.log,e,{enable:function(){n=!0},disable:function(){n=!1}})})}({},!0)}("undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),!1)},{}],178:[function(e,n,l){function t(){return l.colors[c++%l.colors.length]}function r(e){function n(){}function r(){var e=r,n=+new Date,a=n-(i||n);e.diff=a,e.prev=i,e.curr=n,i=n,null==e.useColors&&(e.useColors=l.useColors()),null==e.color&&e.useColors&&(e.color=t());var u=Array.prototype.slice.call(arguments);u[0]=l.coerce(u[0]),"string"!=typeof u[0]&&(u=["%o"].concat(u));var o=0;u[0]=u[0].replace(/%([a-z%])/g,function(n,t){if("%%"===n)return n;o++;var r=l.formatters[t];if("function"==typeof r){var a=u[o];n=r.call(e,a),u.splice(o,1),o--}return n}),"function"==typeof l.formatArgs&&(u=l.formatArgs.apply(e,u));var s=r.log||l.log||console.log.bind(console);s.apply(e,u)}n.enabled=!1,r.enabled=!0;var a=l.enabled(e)?r:n;return a.namespace=e,a}function a(e){l.save(e);for(var n=(e||"").split(/[\s,]+/),t=n.length,r=0;t>r;r++)n[r]&&(e=n[r].replace(/\*/g,".*?"),"-"===e[0]?l.skips.push(new RegExp("^"+e.substr(1)+"$")):l.names.push(new RegExp("^"+e+"$")))}function u(){l.enable("")}function o(e){var n,t;for(n=0,t=l.skips.length;t>n;n++)if(l.skips[n].test(e))return!1;for(n=0,t=l.names.length;t>n;n++)if(l.names[n].test(e))return!0;return!1}function s(e){return e instanceof Error?e.stack||e.message:e}l=n.exports=r,l.coerce=s,l.disable=u,l.enable=a,l.enabled=o,l.humanize=e("ms"),l.names=[],l.skips=[],l.formatters={};var i,c=0},{ms:180}],179:[function(e,n,l){(function(t){function r(){var e=(t.env.DEBUG_COLORS||"").trim().toLowerCase();return 0===e.length?c.isatty(d):"0"!==e&&"no"!==e&&"false"!==e&&"disabled"!==e}function a(){var e=arguments,n=this.useColors,t=this.namespace;if(n){var r=this.color;e[0]=" [9"+r+"m"+t+" [0m"+e[0]+"[3"+r+"m +"+l.humanize(this.diff)+"[0m"}else e[0]=(new Date).toUTCString()+" "+t+" "+e[0];return e}function u(){return f.write(p.format.apply(this,arguments)+"\n")}function o(e){null==e?delete t.env.DEBUG:t.env.DEBUG=e}function s(){return t.env.DEBUG}function i(n){var l,r=t.binding("tty_wrap");switch(r.guessHandleType(n)){case"TTY":l=new c.WriteStream(n),l._type="tty",l._handle&&l._handle.unref&&l._handle.unref();break;case"FILE":var a=e("fs");l=new a.SyncWriteStream(n,{autoClose:!1}),l._type="fs";break;case"PIPE":case"TCP":var u=e("net");l=new u.Socket({fd:n,readable:!1,writable:!0}),l.readable=!1,l.read=null,l._type="pipe",l._handle&&l._handle.unref&&l._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return l.fd=n,l._isStdio=!0,l}var c=e("tty"),p=e("util");l=n.exports=e("./debug"),l.log=u,l.formatArgs=a,l.save=o,l.load=s,l.useColors=r,l.colors=[6,2,3,4,5,1];var d=parseInt(t.env.DEBUG_FD,10)||2,f=1===d?t.stdout:2===d?t.stderr:i(d),h=4===p.inspect.length?function(e,n){return p.inspect(e,void 0,void 0,n)
}:function(e,n){return p.inspect(e,{colors:n})};l.formatters.o=function(e){return h(e,this.useColors).replace(/\s*\n\s*/g," ")},l.enable(s())}).call(this,e("_process"))},{"./debug":178,_process:151,fs:140,net:140,tty:165,util:167}],180:[function(e,n){function l(e){var n=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(e);if(n){var l=parseFloat(n[1]),t=(n[2]||"ms").toLowerCase();switch(t){case"years":case"year":case"y":return l*c;case"days":case"day":case"d":return l*i;case"hours":case"hour":case"h":return l*s;case"minutes":case"minute":case"m":return l*o;case"seconds":case"second":case"s":return l*u;case"ms":return l}}}function t(e){return e>=i?Math.round(e/i)+"d":e>=s?Math.round(e/s)+"h":e>=o?Math.round(e/o)+"m":e>=u?Math.round(e/u)+"s":e+"ms"}function r(e){return a(e,i,"day")||a(e,s,"hour")||a(e,o,"minute")||a(e,u,"second")||e+" ms"}function a(e,n,l){return n>e?void 0:1.5*n>e?Math.floor(e/n)+" "+l:Math.ceil(e/n)+" "+l+"s"}var u=1e3,o=60*u,s=60*o,i=24*s,c=365.25*i;n.exports=function(e,n){return n=n||{},"string"==typeof e?l(e):n.long?r(e):t(e)}},{}],181:[function(e,n){"use strict";function l(e){var n=0,l=0,t=0;for(var r in e){var a=e[r],u=a[0],o=a[1];(u>l||u===l&&o>t)&&(l=u,t=o,n=+r)}return n}var t=e("repeating"),r=/^(?:( )+|\t+)/;n.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var n,a,u=0,o=0,s=0,i={};e.split(/\n/g).forEach(function(e){if(e){var l,t=e.match(r);t?(l=t[0].length,t[1]?o++:u++):l=0;var c=l-s;s=l,c?(a=c>0,n=i[a?c:-c],n?n[0]++:n=i[c]=[1,0]):n&&(n[1]+=+a)}});var c,p,d=l(i);return d?o>=u?(c="space",p=t(" ",d)):(c="tab",p=t(" ",d)):(c=null,p=""),{amount:d,type:c,indent:p}}},{repeating:329}],182:[function(n,l,t){!function(n,l){"use strict";"function"==typeof e&&e.amd?e(["exports"],l):l("undefined"!=typeof t?t:n.estraverse={})}(this,function r(e){"use strict";function n(){}function l(e){var n,t,r={};for(n in e)e.hasOwnProperty(n)&&(t=e[n],r[n]="object"==typeof t&&null!==t?l(t):t);return r}function t(e){var n,l={};for(n in e)e.hasOwnProperty(n)&&(l[n]=e[n]);return l}function a(e,n){var l,t,r,a;for(t=e.length,r=0;t;)l=t>>>1,a=r+l,n(e[a])?t=l:(r=a+1,t-=l+1);return r}function u(e,n){var l,t,r,a;for(t=e.length,r=0;t;)l=t>>>1,a=r+l,n(e[a])?(r=a+1,t-=l+1):t=l;return r}function o(e,n){return I(n).forEach(function(l){e[l]=n[l]}),e}function s(e,n){this.parent=e,this.key=n}function i(e,n,l,t){this.node=e,this.path=n,this.wrap=l,this.ref=t}function c(){}function p(e){return null==e?!1:"object"==typeof e&&"string"==typeof e.type}function d(e,n){return(e===y.ObjectExpression||e===y.ObjectPattern)&&"properties"===n}function f(e,n){var l=new c;return l.traverse(e,n)}function h(e,n){var l=new c;return l.replace(e,n)}function g(e,n){var l;return l=a(n,function(n){return n.range[0]>e.range[0]}),e.extendedRange=[e.range[0],e.range[1]],l!==n.length&&(e.extendedRange[1]=n[l].range[0]),l-=1,l>=0&&(e.extendedRange[0]=n[l].range[1]),e}function m(e,n,t){var r,a,u,o,s=[];if(!e.range)throw new Error("attachComments needs range information");if(!t.length){if(n.length){for(u=0,a=n.length;a>u;u+=1)r=l(n[u]),r.extendedRange=[0,e.range[0]],s.push(r);e.leadingComments=s}return e}for(u=0,a=n.length;a>u;u+=1)s.push(g(l(n[u]),t));return o=0,f(e,{enter:function(e){for(var n;o<s.length&&(n=s[o],!(n.extendedRange[1]>e.range[0]));)n.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(n),s.splice(o,1)):o+=1;return o===s.length?x.Break:s[o].extendedRange[0]>e.range[1]?x.Skip:void 0}}),o=0,f(e,{leave:function(e){for(var n;o<s.length&&(n=s[o],!(e.range[1]<n.extendedRange[0]));)e.range[1]===n.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(n),s.splice(o,1)):o+=1;return o===s.length?x.Break:s[o].extendedRange[0]>e.range[1]?x.Skip:void 0}}),e}var y,_,x,b,v,I,w,E,k;return _=Array.isArray,_||(_=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),n(t),n(u),v=Object.create||function(){function e(){}return function(n){return e.prototype=n,new e}}(),I=Object.keys||function(e){var n,l=[];for(n in e)l.push(n);return l},y={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},b={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},w={},E={},k={},x={Break:w,Skip:E,Remove:k},s.prototype.replace=function(e){this.parent[this.key]=e},s.prototype.remove=function(){return _(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},c.prototype.path=function(){function e(e,n){if(_(n))for(t=0,r=n.length;r>t;++t)e.push(n[t]);else e.push(n)}var n,l,t,r,a,u;if(!this.__current.path)return null;for(a=[],n=2,l=this.__leavelist.length;l>n;++n)u=this.__leavelist[n],e(a,u.path);return e(a,this.__current.path),a},c.prototype.type=function(){var e=this.current();return e.type||this.__current.wrap},c.prototype.parents=function(){var e,n,l;for(l=[],e=1,n=this.__leavelist.length;n>e;++e)l.push(this.__leavelist[e].node);return l},c.prototype.current=function(){return this.__current.node},c.prototype.__execute=function(e,n){var l,t;return t=void 0,l=this.__current,this.__current=n,this.__state=null,e&&(t=e.call(this,n.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=l,t},c.prototype.notify=function(e){this.__state=e},c.prototype.skip=function(){this.notify(E)},c.prototype["break"]=function(){this.notify(w)},c.prototype.remove=function(){this.notify(k)},c.prototype.__initialize=function(e,n){this.visitor=n,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback="iteration"===n.fallback,this.__keys=b,n.keys&&(this.__keys=o(v(this.__keys),n.keys))},c.prototype.traverse=function(e,n){var l,t,r,a,u,o,s,c,f,h,g,m;for(this.__initialize(e,n),m={},l=this.__worklist,t=this.__leavelist,l.push(new i(e,null,null,null)),t.push(new i(null,null,null,null));l.length;)if(r=l.pop(),r!==m){if(r.node){if(o=this.__execute(n.enter,r),this.__state===w||o===w)return;if(l.push(m),t.push(r),this.__state===E||o===E)continue;if(a=r.node,u=r.wrap||a.type,h=this.__keys[u],!h){if(!this.__fallback)throw new Error("Unknown node type "+u+".");h=I(a)}for(c=h.length;(c-=1)>=0;)if(s=h[c],g=a[s])if(_(g)){for(f=g.length;(f-=1)>=0;)if(g[f]){if(d(u,h[c]))r=new i(g[f],[s,f],"Property",null);else{if(!p(g[f]))continue;r=new i(g[f],[s,f],null,null)}l.push(r)}}else p(g)&&l.push(new i(g,s,null,null))}}else if(r=t.pop(),o=this.__execute(n.leave,r),this.__state===w||o===w)return},c.prototype.replace=function(e,n){function l(e){var n,l,r,a;if(e.ref.remove())for(l=e.ref.key,a=e.ref.parent,n=t.length;n--;)if(r=t[n],r.ref&&r.ref.parent===a){if(r.ref.key<l)break;--r.ref.key}}var t,r,a,u,o,c,f,h,g,m,y,x,b;for(this.__initialize(e,n),y={},t=this.__worklist,r=this.__leavelist,x={root:e},c=new i(e,null,null,new s(x,"root")),t.push(c),r.push(c);t.length;)if(c=t.pop(),c!==y){if(o=this.__execute(n.enter,c),void 0!==o&&o!==w&&o!==E&&o!==k&&(c.ref.replace(o),c.node=o),(this.__state===k||o===k)&&(l(c),c.node=null),this.__state===w||o===w)return x.root;if(a=c.node,a&&(t.push(y),r.push(c),this.__state!==E&&o!==E)){if(u=c.wrap||a.type,g=this.__keys[u],!g){if(!this.__fallback)throw new Error("Unknown node type "+u+".");g=I(a)}for(f=g.length;(f-=1)>=0;)if(b=g[f],m=a[b])if(_(m)){for(h=m.length;(h-=1)>=0;)if(m[h]){if(d(u,g[f]))c=new i(m[h],[b,h],"Property",new s(m,h));else{if(!p(m[h]))continue;c=new i(m[h],[b,h],null,new s(m,h))}t.push(c)}}else p(m)&&t.push(new i(m,b,null,new s(a,b)))}}else if(c=r.pop(),o=this.__execute(n.leave,c),void 0!==o&&o!==w&&o!==E&&o!==k&&c.ref.replace(o),(this.__state===k||o===k)&&l(c),this.__state===w||o===w)return x.root;return x.root},e.version="1.8.1-dev",e.Syntax=y,e.traverse=f,e.replace=h,e.attachComments=m,e.VisitorKeys=b,e.VisitorOption=x,e.Controller=c,e.cloneEnvironment=function(){return r({})},e})},{}],183:[function(e,n){!function(){"use strict";function e(e){if(null==e)return!1;switch(e.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function l(e){if(null==e)return!1;switch(e.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function t(e){if(null==e)return!1;switch(e.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function r(e){return t(e)||null!=e&&"FunctionDeclaration"===e.type}function a(e){switch(e.type){case"IfStatement":return null!=e.alternate?e.alternate:e.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return e.body}return null}function u(e){var n;if("IfStatement"!==e.type)return!1;if(null==e.alternate)return!1;n=e.consequent;do{if("IfStatement"===n.type&&null==n.alternate)return!0;n=a(n)}while(n);return!1}n.exports={isExpression:e,isStatement:t,isIterationStatement:l,isSourceElement:r,isProblematicIfStatement:u,trailingStatement:a}}()},{}],184:[function(e,n){!function(){"use strict";function e(e){return e>=48&&57>=e}function l(n){return e(n)||n>=97&&102>=n||n>=65&&70>=n}function t(e){return e>=48&&55>=e}function r(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&i.indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function u(e){return e>=97&&122>=e||e>=65&&90>=e||36===e||95===e||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function o(e){return e>=97&&122>=e||e>=65&&90>=e||e>=48&&57>=e||36===e||95===e||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}var s,i;s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},i=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],n.exports={isDecimalDigit:e,isHexDigit:l,isOctalDigit:t,isWhiteSpace:r,isLineTerminator:a,isIdentifierStart:u,isIdentifierPart:o}}()},{}],185:[function(e,n){!function(){"use strict";function l(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function t(e,n){return n||"yield"!==e?r(e,n):!1}function r(e,n){if(n&&l(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function a(e,n){return"null"===e||"true"===e||"false"===e||t(e,n)}function u(e,n){return"null"===e||"true"===e||"false"===e||r(e,n)}function o(e){return"eval"===e||"arguments"===e}function s(e){var n,l,t;if(0===e.length)return!1;if(t=e.charCodeAt(0),!p.isIdentifierStart(t)||92===t)return!1;for(n=1,l=e.length;l>n;++n)if(t=e.charCodeAt(n),!p.isIdentifierPart(t)||92===t)return!1;return!0}function i(e,n){return s(e)&&!a(e,n)}function c(e,n){return s(e)&&!u(e,n)}var p=e("./code");n.exports={isKeywordES5:t,isKeywordES6:r,isReservedWordES5:a,isReservedWordES6:u,isRestrictedWord:o,isIdentifierName:s,isIdentifierES5:i,isIdentifierES6:c}}()},{"./code":184}],186:[function(e,n,l){!function(){"use strict";l.ast=e("./ast"),l.code=e("./code"),l.keyword=e("./keyword")}()},{"./ast":183,"./code":184,"./keyword":185}],187:[function(e,n){n.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},nonstandard:{escape:!1,unescape:!1},browser:{addEventListener:!1,alert:!1,applicationCache:!1,atob:!1,Audio:!1,AudioProcessingEvent:!1,BeforeUnloadEvent:!1,Blob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,crypto:!1,CSS:!1,CustomEvent:!1,DataView:!1,Debug:!1,defaultStatus:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DOMParser:!1,DragEvent:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FormData:!1,frameElement:!1,frames:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,history:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,Intl:!1,KeyboardEvent:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,navigator:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProgressEvent:!1,prompt:!1,Range:!1,removeEventListener:!1,requestAnimationFrame:!1,resizeBy:!1,resizeTo:!1,screen:!1,screenX:!1,screenY:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,self:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,showModalDialog:!1,status:!1,stop:!1,StorageEvent:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,TouchEvent:!1,UIEvent:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},worker:{importScripts:!0,postMessage:!0,self:!0},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,DataView:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,target:!1,tempdir:!1,test:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,ObjectId:!1,PlanCache:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1}}},{}],188:[function(e,n){n.exports=e("./globals.json")},{"./globals.json":187}],189:[function(e,n){var l=e("is-nan"),t=e("is-finite");n.exports=Number.isInteger||function(e){return"number"==typeof e&&!l(e)&&t(e)&&parseInt(e,10)===e}},{"is-finite":190,"is-nan":191}],190:[function(e,n){"use strict";n.exports=Number.isFinite||function(e){return"number"!=typeof e||e!==e||1/0===e||e===-1/0?!1:!0}},{}],191:[function(e,n){"use strict";n.exports=function(e){return e!==e}},{}],192:[function(e,n){n.exports=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|((?:0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?))|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]{1,6}\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-*\/%&|^]|<{1,2}|>{1,3}|!=?|={1,2})=?|[?:~]|[;,.[\](){}])|(\s+)|(^$|[\s\S])/g,n.exports.matchToToken=function(e){return token={type:"invalid",value:e[0]},e[1]?(token.type="string",token.closed=!(!e[3]&&!e[4])):e[5]?token.type="comment":e[6]?(token.type="comment",token.closed=!!e[7]):e[8]?token.type="regex":e[9]?token.type="number":e[10]?token.type="name":e[11]?token.type="punctuator":e[12]&&(token.type="whitespace"),token}},{}],193:[function(e,n){var l=[],t=[];n.exports=function(e,n){if(e===n)return 0;var r=e.length,a=n.length;if(0===r)return a;if(0===a)return r;for(var u,o,s,i,c=0,p=0;r>c;)t[c]=e.charCodeAt(c),l[c]=++c;for(;a>p;)for(u=n.charCodeAt(p),s=p++,o=p,c=0;r>c;c++)i=u===t[c]?s:s+1,s=l[c],o=l[c]=s>o?i>o?o+1:i:i>s?s+1:i;return o}},{}],194:[function(e,n){function l(e,n,l){return n in e?e[n]:l}function t(e,n){var t=l.bind(null,n||{}),a=t("transform",Function.prototype),u=t("padding"," "),o=t("before"," "),s=t("after"," | "),i=t("start",1),c=Array.isArray(e),p=c?e:e.split("\n"),d=i+p.length-1,f=String(d).length,h=p.map(function(e,n){var l=i+n,t={before:o,number:l,width:f,after:s,line:e};return a(t),t.before+r(t.number,f,u)+t.after+t.line});return c?h:h.join("\n")}var r=e("left-pad");n.exports=t},{"left-pad":195}],195:[function(e,n){function l(e,n,l){e=String(e);var t=-1;for(l||(l=" "),n-=e.length;++t<n;)e=l+e;return e}n.exports=l},{}],196:[function(e,n){function l(e){for(var n=-1,l=e?e.length:0,t=-1,r=[];++n<l;){var a=e[n];a&&(r[++t]=a)}return r}n.exports=l},{}],197:[function(e,n){function l(e,n,l){var a=e?e.length:0;return l&&r(e,n,l)&&(n=!1),a?t(e,n):[]}var t=e("../internal/baseFlatten"),r=e("../internal/isIterateeCall");n.exports=l},{"../internal/baseFlatten":227,"../internal/isIterateeCall":274}],198:[function(e,n){function l(e){var n=e?e.length:0;
return n?e[n-1]:void 0}n.exports=l},{}],199:[function(e,n){function l(){var e=arguments[0];if(!e||!e.length)return e;for(var n=0,l=t,r=arguments.length;++n<r;)for(var u=0,o=arguments[n];(u=l(e,o,u))>-1;)a.call(e,u,1);return e}var t=e("../internal/baseIndexOf"),r=Array.prototype,a=r.splice;n.exports=l},{"../internal/baseIndexOf":233}],200:[function(e,n){function l(e,n,l,o){var s=e?e.length:0;return s?(null!=n&&"boolean"!=typeof n&&(o=l,l=a(e,n,o)?null:n,n=!1),l=null==l?l:t(l,o,3),n?u(e,l):r(e,l)):[]}var t=e("../internal/baseCallback"),r=e("../internal/baseUniq"),a=e("../internal/isIterateeCall"),u=e("../internal/sortedUniq");n.exports=l},{"../internal/baseCallback":220,"../internal/baseUniq":247,"../internal/isIterateeCall":274,"../internal/sortedUniq":285}],201:[function(e,n){n.exports=e("./includes")},{"./includes":205}],202:[function(e,n){n.exports=e("./forEach")},{"./forEach":203}],203:[function(e,n){function l(e,n,l){return"function"==typeof n&&"undefined"==typeof l&&u(e)?t(e,n):r(e,a(n,l,3))}var t=e("../internal/arrayEach"),r=e("../internal/baseEach"),a=e("../internal/bindCallback"),u=e("../lang/isArray");n.exports=l},{"../internal/arrayEach":214,"../internal/baseEach":225,"../internal/bindCallback":249,"../lang/isArray":290}],204:[function(e,n){var l=e("../internal/createAggregator"),t=Object.prototype,r=t.hasOwnProperty,a=l(function(e,n,l){r.call(e,l)?e[l].push(n):e[l]=[n]});n.exports=a},{"../internal/createAggregator":256}],205:[function(e,n){function l(e,n,l){var i=e?e.length:0;return a(i)||(e=o(e),i=e.length),i?(l="number"==typeof l?0>l?s(i+l,0):l||0:0,"string"==typeof e||!r(e)&&u(e)?i>l&&e.indexOf(n,l)>-1:t(e,n,l)>-1):!1}var t=e("../internal/baseIndexOf"),r=e("../lang/isArray"),a=e("../internal/isLength"),u=e("../lang/isString"),o=e("../object/values"),s=Math.max;n.exports=l},{"../internal/baseIndexOf":233,"../internal/isLength":275,"../lang/isArray":290,"../lang/isString":299,"../object/values":307}],206:[function(e,n){function l(e,n,l){var o=u(e)?t:a;return n=r(n,l,3),o(e,n)}var t=e("../internal/arrayMap"),r=e("../internal/baseCallback"),a=e("../internal/baseMap"),u=e("../lang/isArray");n.exports=l},{"../internal/arrayMap":215,"../internal/baseCallback":220,"../internal/baseMap":238,"../lang/isArray":290}],207:[function(e,n){function l(e,n,l,s){var i=o(e)?t:u;return i(e,r(n,s,4),l,arguments.length<3,a)}var t=e("../internal/arrayReduceRight"),r=e("../internal/baseCallback"),a=e("../internal/baseEachRight"),u=e("../internal/baseReduce"),o=e("../lang/isArray");n.exports=l},{"../internal/arrayReduceRight":216,"../internal/baseCallback":220,"../internal/baseEachRight":226,"../internal/baseReduce":242,"../lang/isArray":290}],208:[function(e,n){function l(e,n,l){var o=u(e)?t:a;return("function"!=typeof n||"undefined"!=typeof l)&&(n=r(n,l,3)),o(e,n)}var t=e("../internal/arraySome"),r=e("../internal/baseCallback"),a=e("../internal/baseSome"),u=e("../lang/isArray");n.exports=l},{"../internal/arraySome":217,"../internal/baseCallback":220,"../internal/baseSome":244,"../lang/isArray":290}],209:[function(e,n){function l(e,n,l){var i=-1,c=e?e.length:0,p=s(c)?Array(c):[];return l&&o(e,n,l)&&(n=null),n=t(n,l,3),r(e,function(e,l,t){p[++i]={criteria:n(e,l,t),index:i,value:e}}),a(p,u)}var t=e("../internal/baseCallback"),r=e("../internal/baseEach"),a=e("../internal/baseSortBy"),u=e("../internal/compareAscending"),o=e("../internal/isIterateeCall"),s=e("../internal/isLength");n.exports=l},{"../internal/baseCallback":220,"../internal/baseEach":225,"../internal/baseSortBy":245,"../internal/compareAscending":253,"../internal/isIterateeCall":274,"../internal/isLength":275}],210:[function(e,n){var l=e("../lang/isNative"),t=l(t=Date.now)&&t,r=t||function(){return(new Date).getTime()};n.exports=r},{"../lang/isNative":294}],211:[function(e,n){function l(e,n,l){return l&&r(e,n,l)&&(n=null),n=e&&null==n?e.length:u(+n||0,0),t(e,a,null,null,null,null,n)}var t=e("../internal/createWrapper"),r=e("../internal/isIterateeCall"),a=256,u=Math.max;n.exports=l},{"../internal/createWrapper":263,"../internal/isIterateeCall":274}],212:[function(e,n){(function(l){function t(e){var n=e?e.length:0;for(this.data={hash:o(null),set:new u};n--;)this.push(e[n])}var r=e("./cachePush"),a=e("../lang/isNative"),u=a(u=l.Set)&&u,o=a(o=Object.create)&&o;t.prototype.push=r,n.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":294,"./cachePush":252}],213:[function(e,n){function l(e,n){var l=-1,t=e.length;for(n||(n=Array(t));++l<t;)n[l]=e[l];return n}n.exports=l},{}],214:[function(e,n){function l(e,n){for(var l=-1,t=e.length;++l<t&&n(e[l],l,e)!==!1;);return e}n.exports=l},{}],215:[function(e,n){function l(e,n){for(var l=-1,t=e.length,r=Array(t);++l<t;)r[l]=n(e[l],l,e);return r}n.exports=l},{}],216:[function(e,n){function l(e,n,l,t){var r=e.length;for(t&&r&&(l=e[--r]);r--;)l=n(l,e[r],r,e);return l}n.exports=l},{}],217:[function(e,n){function l(e,n){for(var l=-1,t=e.length;++l<t;)if(n(e[l],l,e))return!0;return!1}n.exports=l},{}],218:[function(e,n){function l(e,n){return"undefined"==typeof e?n:e}n.exports=l},{}],219:[function(e,n){function l(e,n,l){var a=r(n);if(!l)return t(n,e,a);for(var u=-1,o=a.length;++u<o;){var s=a[u],i=e[s],c=l(i,n[s],s,e,n);(c===c?c===i:i!==i)&&("undefined"!=typeof i||s in e)||(e[s]=c)}return e}var t=e("./baseCopy"),r=e("../object/keys");n.exports=l},{"../object/keys":305,"./baseCopy":223}],220:[function(e,n){function l(e,n,l){var i=typeof e;return"function"==i?"undefined"!=typeof n&&s(e)?u(e,n,l):e:null==e?o:"object"==i?t(e):"undefined"==typeof n?a(e+""):r(e+"",n)}var t=e("./baseMatches"),r=e("./baseMatchesProperty"),a=e("./baseProperty"),u=e("./bindCallback"),o=e("../utility/identity"),s=e("./isBindable");n.exports=l},{"../utility/identity":311,"./baseMatches":239,"./baseMatchesProperty":240,"./baseProperty":241,"./bindCallback":249,"./isBindable":272}],221:[function(e,n){function l(e,n,h,g,m,y,x){var b;if(h&&(b=m?h(e,g,m):h(e)),"undefined"!=typeof b)return b;if(!p(e))return e;var I=c(e);if(I){if(b=o(e),!n)return t(e,b)}else{var w=B.call(e),E=w==_;if(w!=v&&w!=f&&(!E||m))return D[w]?s(e,w,n):m?e:{};if(b=i(E?{}:e),!n)return a(e,b,d(e))}y||(y=[]),x||(x=[]);for(var k=y.length;k--;)if(y[k]==e)return x[k];return y.push(e),x.push(b),(I?r:u)(e,function(t,r){b[r]=l(t,n,h,r,e,y,x)}),b}var t=e("./arrayCopy"),r=e("./arrayEach"),a=e("./baseCopy"),u=e("./baseForOwn"),o=e("./initCloneArray"),s=e("./initCloneByTag"),i=e("./initCloneObject"),c=e("../lang/isArray"),p=e("../lang/isObject"),d=e("../object/keys"),f="[object Arguments]",h="[object Array]",g="[object Boolean]",m="[object Date]",y="[object Error]",_="[object Function]",x="[object Map]",b="[object Number]",v="[object Object]",I="[object RegExp]",w="[object Set]",E="[object String]",k="[object WeakMap]",R="[object ArrayBuffer]",S="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",M="[object Int16Array]",j="[object Int32Array]",T="[object Uint8Array]",P="[object Uint8ClampedArray]",L="[object Uint16Array]",O="[object Uint32Array]",D={};D[f]=D[h]=D[R]=D[g]=D[m]=D[S]=D[C]=D[A]=D[M]=D[j]=D[b]=D[v]=D[I]=D[E]=D[T]=D[P]=D[L]=D[O]=!0,D[y]=D[_]=D[x]=D[w]=D[k]=!1;var F=Object.prototype,B=F.toString;n.exports=l},{"../lang/isArray":290,"../lang/isObject":296,"../object/keys":305,"./arrayCopy":213,"./arrayEach":214,"./baseCopy":223,"./baseForOwn":230,"./initCloneArray":269,"./initCloneByTag":270,"./initCloneObject":271}],222:[function(e,n){function l(e,n){if(e!==n){var l=e===e,t=n===n;if(e>n||!l||"undefined"==typeof e&&t)return 1;if(n>e||!t||"undefined"==typeof n&&l)return-1}return 0}n.exports=l},{}],223:[function(e,n){function l(e,n,l){l||(l=n,n={});for(var t=-1,r=l.length;++t<r;){var a=l[t];n[a]=e[a]}return n}n.exports=l},{}],224:[function(e,n){(function(l){var t=e("../lang/isObject"),r=function(){function e(){}return function(n){if(t(n)){e.prototype=n;var r=new e;e.prototype=null}return r||l.Object()}}();n.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isObject":296}],225:[function(e,n){function l(e,n){var l=e?e.length:0;if(!r(l))return t(e,n);for(var u=-1,o=a(e);++u<l&&n(o[u],u,o)!==!1;);return e}var t=e("./baseForOwn"),r=e("./isLength"),a=e("./toObject");n.exports=l},{"./baseForOwn":230,"./isLength":275,"./toObject":286}],226:[function(e,n){function l(e,n){var l=e?e.length:0;if(!r(l))return t(e,n);for(var u=a(e);l--&&n(u[l],l,u)!==!1;);return e}var t=e("./baseForOwnRight"),r=e("./isLength"),a=e("./toObject");n.exports=l},{"./baseForOwnRight":231,"./isLength":275,"./toObject":286}],227:[function(e,n){function l(e,n,o,s){for(var i=(s||0)-1,c=e.length,p=-1,d=[];++i<c;){var f=e[i];if(u(f)&&a(f.length)&&(r(f)||t(f))){n&&(f=l(f,n,o));var h=-1,g=f.length;for(d.length+=g;++h<g;)d[++p]=f[h]}else o||(d[++p]=f)}return d}var t=e("../lang/isArguments"),r=e("../lang/isArray"),a=e("./isLength"),u=e("./isObjectLike");n.exports=l},{"../lang/isArguments":289,"../lang/isArray":290,"./isLength":275,"./isObjectLike":276}],228:[function(e,n){function l(e,n,l){for(var r=-1,a=t(e),u=l(e),o=u.length;++r<o;){var s=u[r];if(n(a[s],s,a)===!1)break}return e}var t=e("./toObject");n.exports=l},{"./toObject":286}],229:[function(e,n){function l(e,n){return t(e,n,r)}var t=e("./baseFor"),r=e("../object/keysIn");n.exports=l},{"../object/keysIn":306,"./baseFor":228}],230:[function(e,n){function l(e,n){return t(e,n,r)}var t=e("./baseFor"),r=e("../object/keys");n.exports=l},{"../object/keys":305,"./baseFor":228}],231:[function(e,n){function l(e,n){return t(e,n,r)}var t=e("./baseForRight"),r=e("../object/keys");n.exports=l},{"../object/keys":305,"./baseForRight":232}],232:[function(e,n){function l(e,n,l){for(var r=t(e),a=l(e),u=a.length;u--;){var o=a[u];if(n(r[o],o,r)===!1)break}return e}var t=e("./toObject");n.exports=l},{"./toObject":286}],233:[function(e,n){function l(e,n,l){if(n!==n)return t(e,l);for(var r=(l||0)-1,a=e.length;++r<a;)if(e[r]===n)return r;return-1}var t=e("./indexOfNaN");n.exports=l},{"./indexOfNaN":268}],234:[function(e,n){function l(e,n,r,a,u,o){if(e===n)return 0!==e||1/e==1/n;var s=typeof e,i=typeof n;return"function"!=s&&"object"!=s&&"function"!=i&&"object"!=i||null==e||null==n?e!==e&&n!==n:t(e,n,l,r,a,u,o)}var t=e("./baseIsEqualDeep");n.exports=l},{"./baseIsEqualDeep":235}],235:[function(e,n){function l(e,n,l,p,h,g,m){var y=u(e),_=u(n),x=i,b=i;y||(x=f.call(e),x==s?x=c:x!=c&&(y=o(e))),_||(b=f.call(n),b==s?b=c:b!=c&&(_=o(n)));var v=x==c,I=b==c,w=x==b;if(w&&!y&&!v)return r(e,n,x);var E=v&&d.call(e,"__wrapped__"),k=I&&d.call(n,"__wrapped__");if(E||k)return l(E?e.value():e,k?n.value():n,p,h,g,m);if(!w)return!1;g||(g=[]),m||(m=[]);for(var R=g.length;R--;)if(g[R]==e)return m[R]==n;g.push(e),m.push(n);var S=(y?t:a)(e,n,l,p,h,g,m);return g.pop(),m.pop(),S}var t=e("./equalArrays"),r=e("./equalByTag"),a=e("./equalObjects"),u=e("../lang/isArray"),o=e("../lang/isTypedArray"),s="[object Arguments]",i="[object Array]",c="[object Object]",p=Object.prototype,d=p.hasOwnProperty,f=p.toString;n.exports=l},{"../lang/isArray":290,"../lang/isTypedArray":300,"./equalArrays":264,"./equalByTag":265,"./equalObjects":266}],236:[function(e,n){function l(e){return"function"==typeof e||!1}n.exports=l},{}],237:[function(e,n){function l(e,n,l,r,u){var o=n.length;if(null==e)return!o;for(var s=-1,i=!u;++s<o;)if(i&&r[s]?l[s]!==e[n[s]]:!a.call(e,n[s]))return!1;for(s=-1;++s<o;){var c=n[s];if(i&&r[s])var p=a.call(e,c);else{var d=e[c],f=l[s];p=u?u(d,f,c):void 0,"undefined"==typeof p&&(p=t(f,d,u,!0))}if(!p)return!1}return!0}var t=e("./baseIsEqual"),r=Object.prototype,a=r.hasOwnProperty;n.exports=l},{"./baseIsEqual":234}],238:[function(e,n){function l(e,n){var l=[];return t(e,function(e,t,r){l.push(n(e,t,r))}),l}var t=e("./baseEach");n.exports=l},{"./baseEach":225}],239:[function(e,n){function l(e){var n=a(e),l=n.length;if(1==l){var u=n[0],s=e[u];if(r(s))return function(e){return null!=e&&e[u]===s&&o.call(e,u)}}for(var i=Array(l),c=Array(l);l--;)s=e[n[l]],i[l]=s,c[l]=r(s);return function(e){return t(e,n,i,c)}}var t=e("./baseIsMatch"),r=e("./isStrictComparable"),a=e("../object/keys"),u=Object.prototype,o=u.hasOwnProperty;n.exports=l},{"../object/keys":305,"./baseIsMatch":237,"./isStrictComparable":277}],240:[function(e,n){function l(e,n){return r(n)?function(l){return null!=l&&l[e]===n}:function(l){return null!=l&&t(n,l[e],null,!0)}}var t=e("./baseIsEqual"),r=e("./isStrictComparable");n.exports=l},{"./baseIsEqual":234,"./isStrictComparable":277}],241:[function(e,n){function l(e){return function(n){return null==n?void 0:n[e]}}n.exports=l},{}],242:[function(e,n){function l(e,n,l,t,r){return r(e,function(e,r,a){l=t?(t=!1,e):n(l,e,r,a)}),l}n.exports=l},{}],243:[function(e,n){var l=e("../utility/identity"),t=e("./metaMap"),r=t?function(e,n){return t.set(e,n),e}:l;n.exports=r},{"../utility/identity":311,"./metaMap":279}],244:[function(e,n){function l(e,n){var l;return t(e,function(e,t,r){return l=n(e,t,r),!l}),!!l}var t=e("./baseEach");n.exports=l},{"./baseEach":225}],245:[function(e,n){function l(e,n){var l=e.length;for(e.sort(n);l--;)e[l]=e[l].value;return e}n.exports=l},{}],246:[function(e,n){function l(e){return"string"==typeof e?e:null==e?"":e+""}n.exports=l},{}],247:[function(e,n){function l(e,n){var l=-1,u=t,o=e.length,s=!0,i=s&&o>=200,c=i?a():null,p=[];c?(u=r,s=!1):(i=!1,c=n?[]:p);e:for(;++l<o;){var d=e[l],f=n?n(d,l,e):d;if(s&&d===d){for(var h=c.length;h--;)if(c[h]===f)continue e;n&&c.push(f),p.push(d)}else u(c,f)<0&&((n||i)&&c.push(f),p.push(d))}return p}var t=e("./baseIndexOf"),r=e("./cacheIndexOf"),a=e("./createCache");n.exports=l},{"./baseIndexOf":233,"./cacheIndexOf":251,"./createCache":259}],248:[function(e,n){function l(e,n){for(var l=-1,t=n.length,r=Array(t);++l<t;)r[l]=e[n[l]];return r}n.exports=l},{}],249:[function(e,n){function l(e,n,l){if("function"!=typeof e)return t;if("undefined"==typeof n)return e;switch(l){case 1:return function(l){return e.call(n,l)};case 3:return function(l,t,r){return e.call(n,l,t,r)};case 4:return function(l,t,r,a){return e.call(n,l,t,r,a)};case 5:return function(l,t,r,a,u){return e.call(n,l,t,r,a,u)}}return function(){return e.apply(n,arguments)}}var t=e("../utility/identity");n.exports=l},{"../utility/identity":311}],250:[function(e,n){(function(l){function t(e){return o.call(e,0)}var r=e("../utility/constant"),a=e("../lang/isNative"),u=a(u=l.ArrayBuffer)&&u,o=a(o=u&&new u(0).slice)&&o,s=Math.floor,i=a(i=l.Uint8Array)&&i,c=function(){try{var e=a(e=l.Float64Array)&&e,n=new e(new u(10),0,1)&&e}catch(t){}return n}(),p=c?c.BYTES_PER_ELEMENT:0;o||(t=u&&i?function(e){var n=e.byteLength,l=c?s(n/p):0,t=l*p,r=new u(n);if(l){var a=new c(r,0,l);a.set(new c(e,0,l))}return n!=t&&(a=new i(r,t),a.set(new i(e,t))),r}:r(null)),n.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":294,"../utility/constant":310}],251:[function(e,n){function l(e,n){var l=e.data,r="string"==typeof n||t(n)?l.set.has(n):l.hash[n];return r?0:-1}var t=e("../lang/isObject");n.exports=l},{"../lang/isObject":296}],252:[function(e,n){function l(e){var n=this.data;"string"==typeof e||t(e)?n.set.add(e):n.hash[e]=!0}var t=e("../lang/isObject");n.exports=l},{"../lang/isObject":296}],253:[function(e,n){function l(e,n){return t(e.criteria,n.criteria)||e.index-n.index}var t=e("./baseCompareAscending");n.exports=l},{"./baseCompareAscending":222}],254:[function(e,n){function l(e,n,l){for(var r=l.length,a=-1,u=t(e.length-r,0),o=-1,s=n.length,i=Array(u+s);++o<s;)i[o]=n[o];for(;++a<r;)i[l[a]]=e[a];for(;u--;)i[o++]=e[a++];return i}var t=Math.max;n.exports=l},{}],255:[function(e,n){function l(e,n,l){for(var r=-1,a=l.length,u=-1,o=t(e.length-a,0),s=-1,i=n.length,c=Array(o+i);++u<o;)c[u]=e[u];for(var p=u;++s<i;)c[p+s]=n[s];for(;++r<a;)c[p+l[r]]=e[u++];return c}var t=Math.max;n.exports=l},{}],256:[function(e,n){function l(e,n){return function(l,u,o){var s=n?n():{};if(u=t(u,o,3),a(l))for(var i=-1,c=l.length;++i<c;){var p=l[i];e(s,p,u(p,i,l),l)}else r(l,function(n,l,t){e(s,n,u(n,l,t),t)});return s}}var t=e("./baseCallback"),r=e("./baseEach"),a=e("../lang/isArray");n.exports=l},{"../lang/isArray":290,"./baseCallback":220,"./baseEach":225}],257:[function(e,n){function l(e){return function(){var n=arguments.length,l=arguments[0];if(2>n||null==l)return l;if(n>3&&r(arguments[1],arguments[2],arguments[3])&&(n=2),n>3&&"function"==typeof arguments[n-2])var a=t(arguments[--n-1],arguments[n--],5);else n>2&&"function"==typeof arguments[n-1]&&(a=arguments[--n]);for(var u=0;++u<n;){var o=arguments[u];o&&e(l,o,a)}return l}}var t=e("./bindCallback"),r=e("./isIterateeCall");n.exports=l},{"./bindCallback":249,"./isIterateeCall":274}],258:[function(e,n){function l(e,n){function l(){return(this instanceof l?r:e).apply(n,arguments)}var r=t(e);return l}var t=e("./createCtorWrapper");n.exports=l},{"./createCtorWrapper":260}],259:[function(e,n){(function(l){var t=e("./SetCache"),r=e("../utility/constant"),a=e("../lang/isNative"),u=a(u=l.Set)&&u,o=a(o=Object.create)&&o,s=o&&u?function(e){return new t(e)}:r(null);n.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":294,"../utility/constant":310,"./SetCache":212}],260:[function(e,n){function l(e){return function(){var n=t(e.prototype),l=e.apply(n,arguments);return r(l)?l:n}}var t=e("./baseCreate"),r=e("../lang/isObject");n.exports=l},{"../lang/isObject":296,"./baseCreate":224}],261:[function(e,n){function l(e,n,_,x,b,v,I,w,E,k){function R(){for(var p=arguments.length,d=p,f=Array(p);d--;)f[d]=arguments[d];if(x&&(f=r(f,x,b)),v&&(f=a(f,v,I)),M||T){var m=R.placeholder,O=s(f,m);if(p-=O.length,k>p){var D=w?t(w):null,F=y(k-p,0),B=M?O:null,N=M?null:O,V=M?f:null,U=M?null:f;n|=M?h:g,n&=~(M?g:h),j||(n&=~(i|c));var q=l(e,n,_,V,B,U,N,D,E,F);return q.placeholder=m,q}}var G=C?_:this;return A&&(e=G[L]),w&&(f=o(f,w)),S&&E<f.length&&(f.length=E),(this instanceof R?P||u(e):e).apply(G,f)}var S=n&m,C=n&i,A=n&c,M=n&d,j=n&p,T=n&f,P=!A&&u(e),L=e;return R}var t=e("./arrayCopy"),r=e("./composeArgs"),a=e("./composeArgsRight"),u=e("./createCtorWrapper"),o=e("./reorder"),s=e("./replaceHolders"),i=1,c=2,p=4,d=8,f=16,h=32,g=64,m=256,y=Math.max;n.exports=l},{"./arrayCopy":213,"./composeArgs":254,"./composeArgsRight":255,"./createCtorWrapper":260,"./reorder":280,"./replaceHolders":281}],262:[function(e,n){function l(e,n,l,a){function u(){for(var n=-1,t=arguments.length,r=-1,i=a.length,c=Array(t+i);++r<i;)c[r]=a[r];for(;t--;)c[r++]=arguments[++n];return(this instanceof u?s:e).apply(o?l:this,c)}var o=n&r,s=t(e);return u}var t=e("./createCtorWrapper"),r=1;n.exports=l},{"./createCtorWrapper":260}],263:[function(e,n){function l(e,n,l,m,y,_,x,b){var v=n&p;if(!v&&"function"!=typeof e)throw new TypeError(h);var I=m?m.length:0;if(I||(n&=~(d|f),m=y=null),I-=y?y.length:0,n&f){var w=m,E=y;m=y=null}var k=!v&&o(e),R=[e,n,l,m,y,w,E,_,x,b];if(k&&k!==!0&&(s(R,k),n=R[1],b=R[9]),R[9]=null==b?v?0:e.length:g(b-I,0)||0,n==c)var S=r(R[0],R[2]);else S=n!=d&&n!=(c|d)||R[4].length?a.apply(void 0,R):u.apply(void 0,R);var C=k?t:i;return C(S,R)}var t=e("./baseSetData"),r=e("./createBindWrapper"),a=e("./createHybridWrapper"),u=e("./createPartialWrapper"),o=e("./getData"),s=e("./mergeData"),i=e("./setData"),c=1,p=2,d=32,f=64,h="Expected a function",g=Math.max;n.exports=l},{"./baseSetData":243,"./createBindWrapper":258,"./createHybridWrapper":261,"./createPartialWrapper":262,"./getData":267,"./mergeData":278,"./setData":282}],264:[function(e,n){function l(e,n,l,t,r,a,u){var o=-1,s=e.length,i=n.length,c=!0;if(s!=i&&!(r&&i>s))return!1;for(;c&&++o<s;){var p=e[o],d=n[o];if(c=void 0,t&&(c=r?t(d,p,o):t(p,d,o)),"undefined"==typeof c)if(r)for(var f=i;f--&&(d=n[f],!(c=p&&p===d||l(p,d,t,r,a,u))););else c=p&&p===d||l(p,d,t,r,a,u)}return!!c}n.exports=l},{}],265:[function(e,n){function l(e,n,l){switch(l){case t:case r:return+e==+n;case a:return e.name==n.name&&e.message==n.message;case u:return e!=+e?n!=+n:0==e?1/e==1/n:e==+n;case o:case s:return e==n+""}return!1}var t="[object Boolean]",r="[object Date]",a="[object Error]",u="[object Number]",o="[object RegExp]",s="[object String]";n.exports=l},{}],266:[function(e,n){function l(e,n,l,r,u,o,s){var i=t(e),c=i.length,p=t(n),d=p.length;if(c!=d&&!u)return!1;for(var f,h=-1;++h<c;){var g=i[h],m=a.call(n,g);if(m){var y=e[g],_=n[g];m=void 0,r&&(m=u?r(_,y,g):r(y,_,g)),"undefined"==typeof m&&(m=y&&y===_||l(y,_,r,u,o,s))}if(!m)return!1;f||(f="constructor"==g)}if(!f){var x=e.constructor,b=n.constructor;if(x!=b&&"constructor"in e&&"constructor"in n&&!("function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b))return!1}return!0}var t=e("../object/keys"),r=Object.prototype,a=r.hasOwnProperty;n.exports=l},{"../object/keys":305}],267:[function(e,n){var l=e("./metaMap"),t=e("../utility/noop"),r=l?function(e){return l.get(e)}:t;n.exports=r},{"../utility/noop":312,"./metaMap":279}],268:[function(e,n){function l(e,n,l){for(var t=e.length,r=l?n||t:(n||0)-1;l?r--:++r<t;){var a=e[r];if(a!==a)return r}return-1}n.exports=l},{}],269:[function(e,n){function l(e){var n=e.length,l=new e.constructor(n);return n&&"string"==typeof e[0]&&r.call(e,"index")&&(l.index=e.index,l.input=e.input),l}var t=Object.prototype,r=t.hasOwnProperty;n.exports=l},{}],270:[function(e,n){function l(e,n,l){var b=e.constructor;switch(n){case i:return t(e);case r:case a:return new b(+e);case c:case p:case d:case f:case h:case g:case m:case y:case _:var v=e.buffer;return new b(l?t(v):v,e.byteOffset,e.length);case u:case s:return new b(e);case o:var I=new b(e.source,x.exec(e));I.lastIndex=e.lastIndex}return I}var t=e("./bufferClone"),r="[object Boolean]",a="[object Date]",u="[object Number]",o="[object RegExp]",s="[object String]",i="[object ArrayBuffer]",c="[object Float32Array]",p="[object Float64Array]",d="[object Int8Array]",f="[object Int16Array]",h="[object Int32Array]",g="[object Uint8Array]",m="[object Uint8ClampedArray]",y="[object Uint16Array]",_="[object Uint32Array]",x=/\w*$/;n.exports=l},{"./bufferClone":250}],271:[function(e,n){function l(e){var n=e.constructor;return"function"==typeof n&&n instanceof n||(n=Object),new n}n.exports=l},{}],272:[function(e,n){function l(e){var n=!(a.funcNames?e.name:a.funcDecomp);if(!n){var l=s.call(e);a.funcNames||(n=!u.test(l)),n||(n=o.test(l)||r(e),t(e,n))}return n}var t=e("./baseSetData"),r=e("../lang/isNative"),a=e("../support"),u=/^\s*function[ \n\r\t]+\w/,o=/\bthis\b/,s=Function.prototype.toString;n.exports=l},{"../lang/isNative":294,"../support":309,"./baseSetData":243}],273:[function(e,n){function l(e,n){return e=+e,n=null==n?t:n,e>-1&&e%1==0&&n>e}var t=Math.pow(2,53)-1;n.exports=l},{}],274:[function(e,n){function l(e,n,l){if(!a(l))return!1;var u=typeof n;if("number"==u)var o=l.length,s=r(o)&&t(n,o);else s="string"==u&&n in l;if(s){var i=l[n];return e===e?e===i:i!==i}return!1}var t=e("./isIndex"),r=e("./isLength"),a=e("../lang/isObject");n.exports=l},{"../lang/isObject":296,"./isIndex":273,"./isLength":275}],275:[function(e,n){function l(e){return"number"==typeof e&&e>-1&&e%1==0&&t>=e}var t=Math.pow(2,53)-1;n.exports=l},{}],276:[function(e,n){function l(e){return e&&"object"==typeof e||!1}n.exports=l},{}],277:[function(e,n){function l(e){return e===e&&(0===e?1/e>0:!t(e))}var t=e("../lang/isObject");n.exports=l},{"../lang/isObject":296}],278:[function(e,n){function l(e,n){var l=e[1],g=n[1],m=l|g,y=d|p,_=o|s,x=y|_|i|c,b=l&d&&!(g&d),v=l&p&&!(g&p),I=(v?e:n)[7],w=(b?e:n)[8],E=!(l>=p&&g>_||l>_&&g>=p),k=m>=y&&x>=m&&(p>l||(v||b)&&I.length<=w);if(!E&&!k)return e;g&o&&(e[2]=n[2],m|=l&o?0:i);var R=n[3];if(R){var S=e[3];e[3]=S?r(S,R,n[4]):t(R),e[4]=S?u(e[3],f):t(n[4])}return R=n[5],R&&(S=e[5],e[5]=S?a(S,R,n[6]):t(R),e[6]=S?u(e[5],f):t(n[6])),R=n[7],R&&(e[7]=t(R)),g&d&&(e[8]=null==e[8]?n[8]:h(e[8],n[8])),null==e[9]&&(e[9]=n[9]),e[0]=n[0],e[1]=m,e}var t=e("./arrayCopy"),r=e("./composeArgs"),a=e("./composeArgsRight"),u=e("./replaceHolders"),o=1,s=2,i=4,c=16,p=128,d=256,f="__lodash_placeholder__",h=Math.min;n.exports=l},{"./arrayCopy":213,"./composeArgs":254,"./composeArgsRight":255,"./replaceHolders":281}],279:[function(e,n){(function(l){var t=e("../lang/isNative"),r=t(r=l.WeakMap)&&r,a=r&&new r;n.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lang/isNative":294}],280:[function(e,n){function l(e,n){for(var l=e.length,u=a(n.length,l),o=t(e);u--;){var s=n[u];e[u]=r(s,l)?o[s]:void 0}return e}var t=e("./arrayCopy"),r=e("./isIndex"),a=Math.min;n.exports=l},{"./arrayCopy":213,"./isIndex":273}],281:[function(e,n){function l(e,n){for(var l=-1,r=e.length,a=-1,u=[];++l<r;)e[l]===n&&(e[l]=t,u[++a]=l);return u}var t="__lodash_placeholder__";n.exports=l},{}],282:[function(e,n){var l=e("./baseSetData"),t=e("../date/now"),r=150,a=16,u=function(){var e=0,n=0;return function(u,o){var s=t(),i=a-(s-n);if(n=s,i>0){if(++e>=r)return u}else e=0;return l(u,o)}}();n.exports=u},{"../date/now":210,"./baseSetData":243}],283:[function(e,n){function l(e){var n;if(!r(e)||s.call(e)!=a||!o.call(e,"constructor")&&(n=e.constructor,"function"==typeof n&&!(n instanceof n)))return!1;var l;return t(e,function(e,n){l=n}),"undefined"==typeof l||o.call(e,l)}var t=e("./baseForIn"),r=e("./isObjectLike"),a="[object Object]",u=Object.prototype,o=u.hasOwnProperty,s=u.toString;n.exports=l},{"./baseForIn":229,"./isObjectLike":276}],284:[function(e,n){function l(e){for(var n=o(e),l=n.length,i=l&&e.length,p=i&&u(i)&&(r(e)||s.nonEnumArgs&&t(e)),d=-1,f=[];++d<l;){var h=n[d];(p&&a(h,i)||c.call(e,h))&&f.push(h)}return f}var t=e("../lang/isArguments"),r=e("../lang/isArray"),a=e("./isIndex"),u=e("./isLength"),o=e("../object/keysIn"),s=e("../support"),i=Object.prototype,c=i.hasOwnProperty;n.exports=l},{"../lang/isArguments":289,"../lang/isArray":290,"../object/keysIn":306,"../support":309,"./isIndex":273,"./isLength":275}],285:[function(e,n){function l(e,n){for(var l,t=-1,r=e.length,a=-1,u=[];++t<r;){var o=e[t],s=n?n(o,t,e):o;t&&l===s||(l=s,u[++a]=o)}return u}n.exports=l},{}],286:[function(e,n){function l(e){return t(e)?e:Object(e)}var t=e("../lang/isObject");n.exports=l},{"../lang/isObject":296}],287:[function(e,n){function l(e,n,l,u){return n&&"boolean"!=typeof n&&a(e,n,l)?n=!1:"function"==typeof n&&(u=l,l=n,n=!1),l="function"==typeof l&&r(l,u,1),t(e,n,l)}var t=e("../internal/baseClone"),r=e("../internal/bindCallback"),a=e("../internal/isIterateeCall");n.exports=l},{"../internal/baseClone":221,"../internal/bindCallback":249,"../internal/isIterateeCall":274}],288:[function(e,n){function l(e,n,l){return n="function"==typeof n&&r(n,l,1),t(e,!0,n)}var t=e("../internal/baseClone"),r=e("../internal/bindCallback");n.exports=l},{"../internal/baseClone":221,"../internal/bindCallback":249}],289:[function(e,n){function l(e){var n=r(e)?e.length:void 0;return t(n)&&o.call(e)==a||!1}var t=e("../internal/isLength"),r=e("../internal/isObjectLike"),a="[object Arguments]",u=Object.prototype,o=u.toString;n.exports=l},{"../internal/isLength":275,"../internal/isObjectLike":276}],290:[function(e,n){var l=e("../internal/isLength"),t=e("./isNative"),r=e("../internal/isObjectLike"),a="[object Array]",u=Object.prototype,o=u.toString,s=t(s=Array.isArray)&&s,i=s||function(e){return r(e)&&l(e.length)&&o.call(e)==a||!1};n.exports=i},{"../internal/isLength":275,"../internal/isObjectLike":276,"./isNative":294}],291:[function(e,n){function l(e){return e===!0||e===!1||t(e)&&u.call(e)==r||!1}var t=e("../internal/isObjectLike"),r="[object Boolean]",a=Object.prototype,u=a.toString;n.exports=l},{"../internal/isObjectLike":276}],292:[function(e,n){function l(e){if(null==e)return!0;var n=e.length;return u(n)&&(r(e)||s(e)||t(e)||o(e)&&a(e.splice))?!n:!i(e).length}var t=e("./isArguments"),r=e("./isArray"),a=e("./isFunction"),u=e("../internal/isLength"),o=e("../internal/isObjectLike"),s=e("./isString"),i=e("../object/keys");n.exports=l},{"../internal/isLength":275,"../internal/isObjectLike":276,"../object/keys":305,"./isArguments":289,"./isArray":290,"./isFunction":293,"./isString":299}],293:[function(e,n){(function(l){var t=e("../internal/baseIsFunction"),r=e("./isNative"),a="[object Function]",u=Object.prototype,o=u.toString,s=r(s=l.Uint8Array)&&s,i=t(/x/)||s&&!t(s)?function(e){return o.call(e)==a}:t;n.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../internal/baseIsFunction":236,"./isNative":294}],294:[function(e,n){function l(e){return null==e?!1:i.call(e)==a?c.test(s.call(e)):r(e)&&u.test(e)||!1}var t=e("../string/escapeRegExp"),r=e("../internal/isObjectLike"),a="[object Function]",u=/^\[object .+?Constructor\]$/,o=Object.prototype,s=Function.prototype.toString,i=o.toString,c=RegExp("^"+t(i).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.exports=l},{"../internal/isObjectLike":276,"../string/escapeRegExp":308}],295:[function(e,n){function l(e){return"number"==typeof e||t(e)&&u.call(e)==r||!1}var t=e("../internal/isObjectLike"),r="[object Number]",a=Object.prototype,u=a.toString;n.exports=l},{"../internal/isObjectLike":276}],296:[function(e,n){function l(e){var n=typeof e;return"function"==n||e&&"object"==n||!1}n.exports=l},{}],297:[function(e,n){var l=e("./isNative"),t=e("../internal/shimIsPlainObject"),r="[object Object]",a=Object.prototype,u=a.toString,o=l(o=Object.getPrototypeOf)&&o,s=o?function(e){if(!e||u.call(e)!=r)return!1;var n=e.valueOf,a=l(n)&&(a=o(n))&&o(a);return a?e==a||o(e)==a:t(e)}:t;n.exports=s},{"../internal/shimIsPlainObject":283,"./isNative":294}],298:[function(e,n){function l(e){return t(e)&&u.call(e)==r||!1}var t=e("../internal/isObjectLike"),r="[object RegExp]",a=Object.prototype,u=a.toString;n.exports=l},{"../internal/isObjectLike":276}],299:[function(e,n){function l(e){return"string"==typeof e||t(e)&&u.call(e)==r||!1}var t=e("../internal/isObjectLike"),r="[object String]",a=Object.prototype,u=a.toString;n.exports=l},{"../internal/isObjectLike":276}],300:[function(e,n){function l(e){return r(e)&&t(e.length)&&C[M.call(e)]||!1}var t=e("../internal/isLength"),r=e("../internal/isObjectLike"),a="[object Arguments]",u="[object Array]",o="[object Boolean]",s="[object Date]",i="[object Error]",c="[object Function]",p="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",g="[object Set]",m="[object String]",y="[object WeakMap]",_="[object ArrayBuffer]",x="[object Float32Array]",b="[object Float64Array]",v="[object Int8Array]",I="[object Int16Array]",w="[object Int32Array]",E="[object Uint8Array]",k="[object Uint8ClampedArray]",R="[object Uint16Array]",S="[object Uint32Array]",C={};C[x]=C[b]=C[v]=C[I]=C[w]=C[E]=C[k]=C[R]=C[S]=!0,C[a]=C[u]=C[_]=C[o]=C[s]=C[i]=C[c]=C[p]=C[d]=C[f]=C[h]=C[g]=C[m]=C[y]=!1;var A=Object.prototype,M=A.toString;n.exports=l},{"../internal/isLength":275,"../internal/isObjectLike":276}],301:[function(e,n){var l=e("../internal/baseAssign"),t=e("../internal/createAssigner"),r=t(l);n.exports=r},{"../internal/baseAssign":219,"../internal/createAssigner":257}],302:[function(e,n){function l(e){if(null==e)return e;var n=t(arguments);return n.push(a),r.apply(void 0,n)}var t=e("../internal/arrayCopy"),r=e("./assign"),a=e("../internal/assignDefaults");n.exports=l},{"../internal/arrayCopy":213,"../internal/assignDefaults":218,"./assign":301}],303:[function(e,n){n.exports=e("./assign")},{"./assign":301}],304:[function(e,n){function l(e,n){return e?r.call(e,n):!1}var t=Object.prototype,r=t.hasOwnProperty;n.exports=l},{}],305:[function(e,n){var l=e("../internal/isLength"),t=e("../lang/isNative"),r=e("../lang/isObject"),a=e("../internal/shimKeys"),u=t(u=Object.keys)&&u,o=u?function(e){if(e)var n=e.constructor,t=e.length;return"function"==typeof n&&n.prototype===e||"function"!=typeof e&&t&&l(t)?a(e):r(e)?u(e):[]}:a;n.exports=o},{"../internal/isLength":275,"../internal/shimKeys":284,"../lang/isNative":294,"../lang/isObject":296}],306:[function(e,n){function l(e){if(null==e)return[];
o(e)||(e=Object(e));var n=e.length;n=n&&u(n)&&(r(e)||s.nonEnumArgs&&t(e))&&n||0;for(var l=e.constructor,i=-1,p="function"==typeof l&&l.prototype===e,d=Array(n),f=n>0;++i<n;)d[i]=i+"";for(var h in e)f&&a(h,n)||"constructor"==h&&(p||!c.call(e,h))||d.push(h);return d}var t=e("../lang/isArguments"),r=e("../lang/isArray"),a=e("../internal/isIndex"),u=e("../internal/isLength"),o=e("../lang/isObject"),s=e("../support"),i=Object.prototype,c=i.hasOwnProperty;n.exports=l},{"../internal/isIndex":273,"../internal/isLength":275,"../lang/isArguments":289,"../lang/isArray":290,"../lang/isObject":296,"../support":309}],307:[function(e,n){function l(e){return t(e,r(e))}var t=e("../internal/baseValues"),r=e("./keys");n.exports=l},{"../internal/baseValues":248,"./keys":305}],308:[function(e,n){function l(e){return e=t(e),e&&a.test(e)?e.replace(r,"\\$&"):e}var t=e("../internal/baseToString"),r=/[.*+?^${}()|[\]\/\\]/g,a=RegExp(r.source);n.exports=l},{"../internal/baseToString":246}],309:[function(e,n){(function(l){var t=e("./lang/isNative"),r=/\bthis\b/,a=Object.prototype,u=(u=l.window)&&u.document,o=a.propertyIsEnumerable,s={};!function(){s.funcDecomp=!t(l.WinRTError)&&r.test(function(){return this}),s.funcNames="string"==typeof Function.name;try{s.dom=11===u.createDocumentFragment().nodeType}catch(e){s.dom=!1}try{s.nonEnumArgs=!o.call(arguments,1)}catch(e){s.nonEnumArgs=!0}}(0,0),n.exports=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lang/isNative":294}],310:[function(e,n){function l(e){return function(){return e}}n.exports=l},{}],311:[function(e,n){function l(e){return e}n.exports=l},{}],312:[function(e,n){function l(){}n.exports=l},{}],313:[function(e,n,l){"use strict";function t(e,n,l){if(p)try{p.call(c,e,n,{value:l})}catch(t){e[n]=l}else e[n]=l}function r(e){return e&&(t(e,"call",e.call),t(e,"apply",e.apply)),e}function a(e){return d?d.call(c,e):(m.prototype=e||null,new m)}function u(){do var e=o(g.call(h.call(y(),36),2));while(f.call(_,e));return _[e]=e}function o(e){var n={};return n[e]=!0,Object.keys(n)[0]}function s(){return a(null)}function i(e){function n(n){function l(l,t){return l===o?t?a=null:a||(a=e(n)):void 0}var a;t(n,r,l)}function l(e){return f.call(e,r)||n(e),e[r](o)}var r=u(),o=a(null);return e=e||s,l.forget=function(e){f.call(e,r)&&e[r](o,!0)},l}var c=Object,p=Object.defineProperty,d=Object.create;r(p),r(d);var f=r(Object.prototype.hasOwnProperty),h=r(Number.prototype.toString),g=r(String.prototype.slice),m=function(){},y=Math.random,_=a(null);t(l,"makeUniqueKey",u);var x=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function(e){for(var n=x(e),l=0,t=0,r=n.length;r>l;++l)f.call(_,n[l])||(l>t&&(n[t]=n[l]),++t);return n.length=t,n},t(l,"makeAccessor",i)},{}],314:[function(e,n,l){function t(e){s.ok(this instanceof t),p.Identifier.assert(e),Object.defineProperties(this,{contextId:{value:e},listing:{value:[]},marked:{value:[!0]},finalLoc:{value:r()},tryEntries:{value:[]}}),Object.defineProperties(this,{leapManager:{value:new d.LeapManager(this)}})}function r(){return c.literal(-1)}function a(e){return p.BreakStatement.check(e)||p.ContinueStatement.check(e)||p.ReturnStatement.check(e)||p.ThrowStatement.check(e)}function u(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+JSON.stringify(e))}function o(e){var n=e.type;return"normal"===n?!g.call(e,"target"):"break"===n||"continue"===n?!g.call(e,"value")&&p.Literal.check(e.target):"return"===n||"throw"===n?g.call(e,"value")&&!g.call(e,"target"):!1}var s=e("assert"),i=e("ast-types"),c=(i.builtInTypes.array,i.builders),p=i.namedTypes,d=e("./leap"),f=e("./meta"),h=e("./util"),g=Object.prototype.hasOwnProperty,m=t.prototype;l.Emitter=t,m.mark=function(e){p.Literal.assert(e);var n=this.listing.length;return-1===e.value?e.value=n:s.strictEqual(e.value,n),this.marked[n]=!0,e},m.emit=function(e){p.Expression.check(e)&&(e=c.expressionStatement(e)),p.Statement.assert(e),this.listing.push(e)},m.emitAssign=function(e,n){return this.emit(this.assign(e,n)),e},m.assign=function(e,n){return c.expressionStatement(c.assignmentExpression("=",e,n))},m.contextProperty=function(e,n){return c.memberExpression(this.contextId,n?c.literal(e):c.identifier(e),!!n)};var y={prev:!0,next:!0,sent:!0,rval:!0};m.isVolatileContextProperty=function(e){if(p.MemberExpression.check(e)){if(e.computed)return!0;if(p.Identifier.check(e.object)&&p.Identifier.check(e.property)&&e.object.name===this.contextId.name&&g.call(y,e.property.name))return!0}return!1},m.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},m.setReturnValue=function(e){p.Expression.assert(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},m.clearPendingException=function(e,n){p.Literal.assert(e);var l=c.callExpression(this.contextProperty("catch",!0),[e]);n?this.emitAssign(n,l):this.emit(l)},m.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(c.breakStatement())},m.jumpIf=function(e,n){p.Expression.assert(e),p.Literal.assert(n),this.emit(c.ifStatement(e,c.blockStatement([this.assign(this.contextProperty("next"),n),c.breakStatement()])))},m.jumpIfNot=function(e,n){p.Expression.assert(e),p.Literal.assert(n);var l;l=p.UnaryExpression.check(e)&&"!"===e.operator?e.argument:c.unaryExpression("!",e),this.emit(c.ifStatement(l,c.blockStatement([this.assign(this.contextProperty("next"),n),c.breakStatement()])))};var _=0;m.makeTempVar=function(){return this.contextProperty("t"+_++)},m.getContextFunction=function(e){var n=c.functionExpression(e||null,[this.contextId],c.blockStatement([this.getDispatchLoop()]),!1,!1);return n._aliasFunction=!0,n},m.getDispatchLoop=function(){var e,n=this,l=[],t=!1;return n.listing.forEach(function(r,u){n.marked.hasOwnProperty(u)&&(l.push(c.switchCase(c.literal(u),e=[])),t=!1),t||(e.push(r),a(r)&&(t=!0))}),this.finalLoc.value=this.listing.length,l.push(c.switchCase(this.finalLoc,[]),c.switchCase(c.literal("end"),[c.returnStatement(c.callExpression(this.contextProperty("stop"),[]))])),c.whileStatement(c.literal(1),c.switchStatement(c.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),l))},m.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return c.arrayExpression(this.tryEntries.map(function(n){var l=n.firstLoc.value;s.ok(l>=e,"try entries out of order"),e=l;var t=n.catchEntry,r=n.finallyEntry,a=[n.firstLoc,t?t.firstLoc:null];return r&&(a[2]=r.firstLoc,a[3]=r.afterLoc),c.arrayExpression(a)}))},m.explode=function(e,n){s.ok(e instanceof i.NodePath);var l=e.value,t=this;if(p.Node.assert(l),p.Statement.check(l))return t.explodeStatement(e);if(p.Expression.check(l))return t.explodeExpression(e,n);if(p.Declaration.check(l))throw u(l);switch(l.type){case"Program":return e.get("body").map(t.explodeStatement,t);case"VariableDeclarator":throw u(l);case"Property":case"SwitchCase":case"CatchClause":throw new Error(l.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(l.type))}},m.explodeStatement=function(e,n){s.ok(e instanceof i.NodePath);var l=e.value,t=this;if(p.Statement.assert(l),n?p.Identifier.assert(n):n=null,p.BlockStatement.check(l))return e.get("body").each(t.explodeStatement,t);if(!f.containsLeap(l))return void t.emit(l);switch(l.type){case"ExpressionStatement":t.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":var a=r();t.leapManager.withEntry(new d.LabeledEntry(a,l.label),function(){t.explodeStatement(e.get("body"),l.label)}),t.mark(a);break;case"WhileStatement":var u=r(),a=r();t.mark(u),t.jumpIfNot(t.explodeExpression(e.get("test")),a),t.leapManager.withEntry(new d.LoopEntry(a,u,n),function(){t.explodeStatement(e.get("body"))}),t.jump(u),t.mark(a);break;case"DoWhileStatement":var o=r(),g=r(),a=r();t.mark(o),t.leapManager.withEntry(new d.LoopEntry(a,g,n),function(){t.explode(e.get("body"))}),t.mark(g),t.jumpIf(t.explodeExpression(e.get("test")),o),t.mark(a);break;case"ForStatement":var m=r(),y=r(),a=r();l.init&&t.explode(e.get("init"),!0),t.mark(m),l.test&&t.jumpIfNot(t.explodeExpression(e.get("test")),a),t.leapManager.withEntry(new d.LoopEntry(a,y,n),function(){t.explodeStatement(e.get("body"))}),t.mark(y),l.update&&t.explode(e.get("update"),!0),t.jump(m),t.mark(a);break;case"ForInStatement":p.Identifier.assert(l.left);var m=r(),a=r(),_=t.makeTempVar();t.emitAssign(_,c.callExpression(h.runtimeProperty("keys"),[t.explodeExpression(e.get("right"))])),t.mark(m);var x=t.makeTempVar();t.jumpIf(c.memberExpression(c.assignmentExpression("=",x,c.callExpression(_,[])),c.identifier("done"),!1),a),t.emitAssign(l.left,c.memberExpression(x,c.identifier("value"),!1)),t.leapManager.withEntry(new d.LoopEntry(a,m,n),function(){t.explodeStatement(e.get("body"))}),t.jump(m),t.mark(a);break;case"BreakStatement":t.emitAbruptCompletion({type:"break",target:t.leapManager.getBreakLoc(l.label)});break;case"ContinueStatement":t.emitAbruptCompletion({type:"continue",target:t.leapManager.getContinueLoc(l.label)});break;case"SwitchStatement":for(var b=t.emitAssign(t.makeTempVar(),t.explodeExpression(e.get("discriminant"))),a=r(),v=r(),I=v,w=[],E=l.cases||[],k=E.length-1;k>=0;--k){var R=E[k];p.SwitchCase.assert(R),R.test?I=c.conditionalExpression(c.binaryExpression("===",b,R.test),w[k]=r(),I):w[k]=v}t.jump(t.explodeExpression(new i.NodePath(I,e,"discriminant"))),t.leapManager.withEntry(new d.SwitchEntry(a),function(){e.get("cases").each(function(e){var n=(e.value,e.name);t.mark(w[n]),e.get("consequent").each(t.explodeStatement,t)})}),t.mark(a),-1===v.value&&(t.mark(v),s.strictEqual(a.value,v.value));break;case"IfStatement":var S=l.alternate&&r(),a=r();t.jumpIfNot(t.explodeExpression(e.get("test")),S||a),t.explodeStatement(e.get("consequent")),S&&(t.jump(a),t.mark(S),t.explodeStatement(e.get("alternate"))),t.mark(a);break;case"ReturnStatement":t.emitAbruptCompletion({type:"return",value:t.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var a=r(),C=l.handler;!C&&l.handlers&&(C=l.handlers[0]||null);var A=C&&r(),M=A&&new d.CatchEntry(A,C.param),j=l.finalizer&&r(),T=j&&new d.FinallyEntry(j,a),P=new d.TryEntry(t.getUnmarkedCurrentLoc(),M,T);t.tryEntries.push(P),t.updateContextPrevLoc(P.firstLoc),t.leapManager.withEntry(P,function(){if(t.explodeStatement(e.get("block")),A){t.jump(j?j:a),t.updateContextPrevLoc(t.mark(A));var n=e.get("handler","body"),l=t.makeTempVar();t.clearPendingException(P.firstLoc,l);var r=n.scope,u=C.param.name;p.CatchClause.assert(r.node),s.strictEqual(r.lookup(u),r),i.visit(n,{visitIdentifier:function(e){return h.isReference(e,u)&&e.scope.lookup(u)===r?l:void this.traverse(e)},visitFunction:function(e){return e.scope.declares(u)?!1:void this.traverse(e)}}),t.leapManager.withEntry(M,function(){t.explodeStatement(n)})}j&&(t.updateContextPrevLoc(t.mark(j)),t.leapManager.withEntry(T,function(){t.explodeStatement(e.get("finalizer"))}),t.emit(c.returnStatement(c.callExpression(t.contextProperty("finish"),[T.firstLoc]))))}),t.mark(a);break;case"ThrowStatement":t.emit(c.throwStatement(t.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(l.type))}},m.emitAbruptCompletion=function(e){o(e)||s.ok(!1,"invalid completion record: "+JSON.stringify(e)),s.notStrictEqual(e.type,"normal","normal completions are not abrupt");var n=[c.literal(e.type)];"break"===e.type||"continue"===e.type?(p.Literal.assert(e.target),n[1]=e.target):("return"===e.type||"throw"===e.type)&&e.value&&(p.Expression.assert(e.value),n[1]=e.value),this.emit(c.returnStatement(c.callExpression(this.contextProperty("abrupt"),n)))},m.getUnmarkedCurrentLoc=function(){return c.literal(this.listing.length)},m.updateContextPrevLoc=function(e){e?(p.Literal.assert(e),-1===e.value?e.value=this.listing.length:s.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},m.explodeExpression=function(e,n){function l(e){return p.Expression.assert(e),n?void o.emit(e):e}function t(e,n,l){s.ok(n instanceof i.NodePath),s.ok(!l||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var t=o.explodeExpression(n,l);return l||(e||d&&(o.isVolatileContextProperty(t)||f.hasSideEffects(t)))&&(t=o.emitAssign(e||o.makeTempVar(),t)),t}s.ok(e instanceof i.NodePath);var a=e.value;if(!a)return a;p.Expression.assert(a);var u,o=this;if(!f.containsLeap(a))return l(a);var d=f.containsLeap.onlyChildren(a);switch(a.type){case"MemberExpression":return l(c.memberExpression(o.explodeExpression(e.get("object")),a.computed?t(null,e.get("property")):a.property,a.computed));case"CallExpression":var h=e.get("callee"),g=o.explodeExpression(h);return!p.MemberExpression.check(h.node)&&p.MemberExpression.check(g)&&(g=c.sequenceExpression([c.literal(0),g])),l(c.callExpression(g,e.get("arguments").map(function(e){return t(null,e)})));case"NewExpression":return l(c.newExpression(t(null,e.get("callee")),e.get("arguments").map(function(e){return t(null,e)})));case"ObjectExpression":return l(c.objectExpression(e.get("properties").map(function(e){return c.property(e.value.kind,e.value.key,t(null,e.get("value")))})));case"ArrayExpression":return l(c.arrayExpression(e.get("elements").map(function(e){return t(null,e)})));case"SequenceExpression":var m=a.expressions.length-1;return e.get("expressions").each(function(e){e.name===m?u=o.explodeExpression(e,n):o.explodeExpression(e,!0)}),u;case"LogicalExpression":var y=r();n||(u=o.makeTempVar());var _=t(u,e.get("left"));return"&&"===a.operator?o.jumpIfNot(_,y):(s.strictEqual(a.operator,"||"),o.jumpIf(_,y)),t(u,e.get("right"),n),o.mark(y),u;case"ConditionalExpression":var x=r(),y=r(),b=o.explodeExpression(e.get("test"));return o.jumpIfNot(b,x),n||(u=o.makeTempVar()),t(u,e.get("consequent"),n),o.jump(y),o.mark(x),t(u,e.get("alternate"),n),o.mark(y),u;case"UnaryExpression":return l(c.unaryExpression(a.operator,o.explodeExpression(e.get("argument")),!!a.prefix));case"BinaryExpression":return l(c.binaryExpression(a.operator,t(null,e.get("left")),t(null,e.get("right"))));case"AssignmentExpression":return l(c.assignmentExpression(a.operator,o.explodeExpression(e.get("left")),o.explodeExpression(e.get("right"))));case"UpdateExpression":return l(c.updateExpression(a.operator,o.explodeExpression(e.get("argument")),a.prefix));case"YieldExpression":var y=r(),v=a.argument&&o.explodeExpression(e.get("argument"));if(v&&a.delegate){var u=o.makeTempVar();return o.emit(c.returnStatement(c.callExpression(o.contextProperty("delegateYield"),[v,c.literal(u.property.name),y]))),o.mark(y),u}return o.emitAssign(o.contextProperty("next"),y),o.emit(c.returnStatement(v||null)),o.mark(y),o.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(a.type))}}},{"./leap":316,"./meta":317,"./util":318,assert:141,"ast-types":139}],315:[function(e,n,l){var t=e("assert"),r=e("ast-types"),a=r.namedTypes,u=r.builders,o=Object.prototype.hasOwnProperty;l.hoist=function(e){function n(e,n){a.VariableDeclaration.assert(e);var t=[];return e.declarations.forEach(function(e){l[e.id.name]=e.id,e.init?t.push(u.assignmentExpression("=",e.id,e.init)):n&&t.push(e.id)}),0===t.length?null:1===t.length?t[0]:u.sequenceExpression(t)}t.ok(e instanceof r.NodePath),a.Function.assert(e.value);var l={};r.visit(e.get("body"),{visitVariableDeclaration:function(e){var l=n(e.value,!1);return null!==l?u.expressionStatement(l):(e.replace(),!1)},visitForStatement:function(e){var l=e.value.init;a.VariableDeclaration.check(l)&&e.get("init").replace(n(l,!1)),this.traverse(e)},visitForInStatement:function(e){var l=e.value.left;a.VariableDeclaration.check(l)&&e.get("left").replace(n(l,!0)),this.traverse(e)},visitFunctionDeclaration:function(e){var n=e.value;l[n.id.name]=n.id;var t=(e.parent.node,u.expressionStatement(u.assignmentExpression("=",n.id,u.functionExpression(n.id,n.params,n.body,n.generator,n.expression))));return a.BlockStatement.check(e.parent.node)?(e.parent.get("body").unshift(t),e.replace()):e.replace(t),!1},visitFunctionExpression:function(){return!1}});var s={};e.get("params").each(function(e){var n=e.value;a.Identifier.check(n)&&(s[n.name]=n)});var i=[];return Object.keys(l).forEach(function(e){o.call(s,e)||i.push(u.variableDeclarator(l[e],null))}),0===i.length?null:u.variableDeclaration("var",i)}},{assert:141,"ast-types":139}],316:[function(e,n,l){function t(){d.ok(this instanceof t)}function r(e){t.call(this),h.Literal.assert(e),this.returnLoc=e}function a(e,n,l){t.call(this),h.Literal.assert(e),h.Literal.assert(n),l?h.Identifier.assert(l):l=null,this.breakLoc=e,this.continueLoc=n,this.label=l}function u(e){t.call(this),h.Literal.assert(e),this.breakLoc=e}function o(e,n,l){t.call(this),h.Literal.assert(e),n?d.ok(n instanceof s):n=null,l?d.ok(l instanceof i):l=null,d.ok(n||l),this.firstLoc=e,this.catchEntry=n,this.finallyEntry=l}function s(e,n){t.call(this),h.Literal.assert(e),h.Identifier.assert(n),this.firstLoc=e,this.paramId=n}function i(e,n){t.call(this),h.Literal.assert(e),h.Literal.assert(n),this.firstLoc=e,this.afterLoc=n}function c(e,n){t.call(this),h.Literal.assert(e),h.Identifier.assert(n),this.breakLoc=e,this.label=n}function p(n){d.ok(this instanceof p);var l=e("./emit").Emitter;d.ok(n instanceof l),this.emitter=n,this.entryStack=[new r(n.finalLoc)]}{var d=e("assert"),f=e("ast-types"),h=f.namedTypes,g=(f.builders,e("util").inherits);Object.prototype.hasOwnProperty}g(r,t),l.FunctionEntry=r,g(a,t),l.LoopEntry=a,g(u,t),l.SwitchEntry=u,g(o,t),l.TryEntry=o,g(s,t),l.CatchEntry=s,g(i,t),l.FinallyEntry=i,g(c,t),l.LabeledEntry=c;var m=p.prototype;l.LeapManager=p,m.withEntry=function(e,n){d.ok(e instanceof t),this.entryStack.push(e);try{n.call(this.emitter)}finally{var l=this.entryStack.pop();d.strictEqual(l,e)}},m._findLeapLocation=function(e,n){for(var l=this.entryStack.length-1;l>=0;--l){var t=this.entryStack[l],r=t[e];if(r)if(n){if(t.label&&t.label.name===n.name)return r}else if(!(t instanceof c))return r}return null},m.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},m.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},{"./emit":314,assert:141,"ast-types":139,util:167}],317:[function(e,n,l){function t(e,n){function l(e){function n(e){return l||(o.check(e)?e.some(n):s.Node.check(e)&&(r.strictEqual(l,!1),l=t(e))),l}s.Node.assert(e);var l=!1;return u.eachField(e,function(e,l){n(l)}),l}function t(t){s.Node.assert(t);var r=a(t);return i.call(r,e)?r[e]:r[e]=i.call(c,t.type)?!1:i.call(n,t.type)?!0:l(t)}return t.onlyChildren=l,t}var r=e("assert"),a=e("private").makeAccessor(),u=e("ast-types"),o=u.builtInTypes.array,s=u.namedTypes,i=Object.prototype.hasOwnProperty,c={FunctionExpression:!0},p={CallExpression:!0,ForInStatement:!0,UnaryExpression:!0,BinaryExpression:!0,AssignmentExpression:!0,UpdateExpression:!0,NewExpression:!0},d={YieldExpression:!0,BreakStatement:!0,ContinueStatement:!0,ReturnStatement:!0,ThrowStatement:!0};for(var f in d)i.call(d,f)&&(p[f]=d[f]);l.hasSideEffects=t("hasSideEffects",p),l.containsLeap=t("containsLeap",d)},{assert:141,"ast-types":139,"private":313}],318:[function(e,n,l){var t=(e("assert"),e("ast-types")),r=t.namedTypes,a=t.builders,u=Object.prototype.hasOwnProperty;l.defaults=function(e){for(var n,l=arguments.length,t=1;l>t;++t)if(n=arguments[t])for(var r in n)u.call(n,r)&&!u.call(e,r)&&(e[r]=n[r]);return e},l.runtimeProperty=function(e){return a.memberExpression(a.identifier("regeneratorRuntime"),a.identifier(e),!1)},l.isReference=function(e,n){var l=e.value;if(!r.Identifier.check(l))return!1;if(n&&l.name!==n)return!1;var t=e.parent.value;switch(t.type){case"VariableDeclarator":return"init"===e.name;case"MemberExpression":return"object"===e.name||t.computed&&"property"===e.name;case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":return"id"===e.name?!1:t.params===e.parentPath&&t.params[e.name]===l?!1:!0;case"ClassDeclaration":case"ClassExpression":return"id"!==e.name;case"CatchClause":return"param"!==e.name;case"Property":case"MethodDefinition":return"key"!==e.name;case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return!1;default:return!0}}},{assert:141,"ast-types":139}],319:[function(e,n,l){var t=(e("assert"),e("fs"),e("ast-types")),r=t.namedTypes,a=t.builders,u=(t.builtInTypes.array,t.builtInTypes.object,t.NodePath),o=e("./hoist").hoist,s=e("./emit").Emitter,i=e("./util").runtimeProperty;l.transform=function(e,n){n=n||{};var l=e instanceof u?e:new u(e);return c.visit(l,n),e=l.value,n.madeChanges=c.wasChangeReported(),e};var c=t.PathVisitor.fromMethodsObject({reset:function(e,n){this.options=n},visitFunction:function(e){this.traverse(e);var n=e.value,l=n.async&&!this.options.disableAsync;if(n.generator||l){this.reportChanged(),n.generator=!1,n.expression&&(n.expression=!1,n.body=a.blockStatement([a.returnStatement(n.body)])),l&&p.visit(e.get("body"));var t=n.id||(n.id=e.scope.parent.declareTemporary("callee$")),u=[],c=e.value.body;c.body=c.body.filter(function(e){return e&&null!=e._blockHoist?(u.push(e),!1):!0});var d=a.identifier(n.id.name+"$"),f=e.scope.declareTemporary("context$"),h=o(e),g=new s(f);g.explode(e.get("body")),h&&h.declarations.length>0&&u.push(h);var m=[g.getContextFunction(d),l?a.literal(null):t,a.thisExpression()],y=g.getTryLocsList();y&&m.push(y);var _=a.callExpression(i(l?"async":"wrap"),m);if(u.push(a.returnStatement(_)),n.body=a.blockStatement(u),n.body._declarations=c._declarations,l)return void(n.async=!1);if(!r.FunctionDeclaration.check(n))return r.FunctionExpression.assert(n),a.callExpression(i("mark"),[n]);for(var x=e.parent;x&&!r.BlockStatement.check(x.value)&&!r.Program.check(x.value);)x=x.parent;if(x){e.replace(),n.type="FunctionExpression";var b=a.variableDeclaration("var",[a.variableDeclarator(n.id,a.callExpression(i("mark"),[n]))]);n.comments&&(b.leadingComments=n.leadingComments,b.trailingComments=n.trailingComments,n.leadingComments=null,n.trailingComments=null),b._blockHoist=3;{var v=x.get("body");v.value.length}v.push(b)}}}}),p=t.PathVisitor.fromMethodsObject({visitFunction:function(){return!1},visitAwaitExpression:function(e){var n=e.value.argument;return e.value.all&&(n=a.callExpression(a.memberExpression(a.identifier("Promise"),a.identifier("all"),!1),[n])),a.yieldExpression(n,!1)}})},{"./emit":314,"./hoist":315,"./util":318,assert:141,"ast-types":139,fs:140}],320:[function(e,n){(function(l){function t(e,n){function l(e){r.push(e)}function t(){this.queue(compile(r.join(""),n).code),this.queue(null)}var r=[];return u(l,t)}function r(){e("./runtime")}{var a=(e("assert"),e("path")),u=(e("fs"),e("through")),o=e("./lib/visit").transform;e("./lib/util"),e("ast-types")}n.exports=t,t.runtime=r,r.path=a.join(l,"runtime.js"),t.transform=o}).call(this,"/node_modules/regenerator-babel")},{"./lib/util":318,"./lib/visit":319,"./runtime":322,assert:141,"ast-types":139,fs:140,path:150,through:321}],321:[function(e,n,l){(function(t){function r(e,n,l){function r(){for(;i.length&&!p.paused;){var e=i.shift();if(null===e)return p.emit("end");p.emit("data",e)}}function u(){p.writable=!1,n.call(p),!p.readable&&p.autoDestroy&&p.destroy()}e=e||function(e){this.queue(e)},n=n||function(){this.queue(null)};var o=!1,s=!1,i=[],c=!1,p=new a;return p.readable=p.writable=!0,p.paused=!1,p.autoDestroy=!(l&&l.autoDestroy===!1),p.write=function(n){return e.call(this,n),!p.paused},p.queue=p.push=function(e){return c?p:(null==e&&(c=!0),i.push(e),r(),p)},p.on("end",function(){p.readable=!1,!p.writable&&p.autoDestroy&&t.nextTick(function(){p.destroy()})}),p.end=function(e){return o?void 0:(o=!0,arguments.length&&p.write(e),u(),p)},p.destroy=function(){return s?void 0:(s=!0,o=!0,i.length=0,p.writable=p.readable=!1,p.emit("close"),p)},p.pause=function(){return p.paused?void 0:(p.paused=!0,p)},p.resume=function(){return p.paused&&(p.paused=!1,p.emit("resume")),r(),p.paused||p.emit("drain"),p},p}var a=e("stream");l=n.exports=r,r.through=r}).call(this,e("_process"))},{_process:151,stream:163}],322:[function(e,n){(function(e){!function(e){"use strict";function l(e,n,l,t){return new u(e,n,l||null,t||[])}function t(e,n,l){try{return{type:"normal",arg:e.call(n,l)}}catch(t){return{type:"throw",arg:t}}}function r(){}function a(){}function u(e,n,l,r){function a(n,r){if(s===x)throw new Error("Generator is already running");if(s===b)return p();for(;;){var a=o.delegate;if(a){var u=t(a.iterator[n],a.iterator,r);if("throw"===u.type){o.delegate=null,n="throw",r=u.arg;continue}n="next",r=d;var i=u.arg;if(!i.done)return s=_,i;o[a.resultName]=i.value,o.next=a.nextLoc,o.delegate=null}if("next"===n){if(s===y&&"undefined"!=typeof r)throw new TypeError("attempt to send "+JSON.stringify(r)+" to newborn generator");s===_?o.sent=r:delete o.sent}else if("throw"===n){if(s===y)throw s=b,r;o.dispatchException(r)&&(n="next",r=d)}else"return"===n&&o.abrupt("return",r);s=x;var u=t(e,l,o);if("normal"===u.type){s=o.done?b:_;var i={value:u.arg,done:o.done};if(u.arg!==v)return i;o.delegate&&"next"===n&&(r=d)}else"throw"===u.type&&(s=b,"next"===n?o.dispatchException(u.arg):r=u.arg)}}var u=n?Object.create(n.prototype):this,o=new i(r),s=y;return u.next=a.bind(u,"next"),u["throw"]=a.bind(u,"throw"),u["return"]=a.bind(u,"return"),u}function o(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function s(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function i(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(o,this),this.reset()}function c(e){if(e){var n=e[h];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var l=-1,t=function r(){for(;++l<e.length;)if(f.call(e,l))return r.value=e[l],r.done=!1,r;return r.value=d,r.done=!0,r};return t.next=t}}return{next:p}}function p(){return{value:d,done:!0}}var d,f=Object.prototype.hasOwnProperty,h="function"==typeof Symbol&&Symbol.iterator||"@@iterator",g="object"==typeof n,m=e.regeneratorRuntime;if(m)return void(g&&(n.exports=m));m=e.regeneratorRuntime=g?n.exports:{},m.wrap=l;var y="suspendedStart",_="suspendedYield",x="executing",b="completed",v={},I=a.prototype=u.prototype;r.prototype=I.constructor=a,a.constructor=r,r.displayName="GeneratorFunction",m.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return n?n===r||"GeneratorFunction"===(n.displayName||n.name):!1},m.mark=function(e){return e.__proto__=a,e.prototype=Object.create(I),e},m.async=function(e,n,r,a){return new Promise(function(u,o){function s(e){var n=t(this,null,e);if("throw"===n.type)return void o(n.arg);var l=n.arg;l.done?u(l.value):Promise.resolve(l.value).then(c,p)}var i=l(e,n,r,a),c=s.bind(i.next),p=s.bind(i["throw"]);c()})},I[h]=function(){return this},I.toString=function(){return"[object Generator]"},m.keys=function(e){var n=[];for(var l in e)n.push(l);return n.reverse(),function t(){for(;n.length;){var l=n.pop();if(l in e)return t.value=l,t.done=!1,t}return t.done=!0,t}},m.values=c,i.prototype={constructor:i,reset:function(){this.prev=0,this.next=0,this.sent=d,this.done=!1,this.delegate=null,this.tryEntries.forEach(s);for(var e,n=0;f.call(this,e="t"+n)||20>n;++n)this[e]=null},stop:function(){this.done=!0;var e=this.tryEntries[0],n=e.completion;if("throw"===n.type)throw n.arg;return this.rval},dispatchException:function(e){function n(n,t){return a.type="throw",a.arg=e,l.next=n,!!t}if(this.done)throw e;for(var l=this,t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var u=f.call(r,"catchLoc"),o=f.call(r,"finallyLoc");if(u&&o){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(u){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,n){for(var l=this.tryEntries.length-1;l>=0;--l){var t=this.tryEntries[l];if(t.tryLoc<=this.prev&&f.call(t,"finallyLoc")&&this.prev<t.finallyLoc){var r=t;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=n&&n<r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=n,r?this.next=r.finallyLoc:this.complete(a),v},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=e.arg,this.next="end"):"normal"===e.type&&n&&(this.next=n),v},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var l=this.tryEntries[n];if(l.finallyLoc===e)return this.complete(l.completion,l.afterLoc)}},"catch":function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var l=this.tryEntries[n];if(l.tryLoc===e){var t=l.completion;if("throw"===t.type){var r=t.arg;s(l)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,l){return this.delegate={iterator:c(e),resultName:n,nextLoc:l},v}}}("object"==typeof e?e:"object"==typeof window?window:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],323:[function(e,n,l){var t=e("regenerate");l.REGULAR={d:t().addRange(48,57),D:t().addRange(0,47).addRange(58,65535),s:t(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:t().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:t(95).addRange(48,57).addRange(65,90).addRange(97,122),W:t(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)},l.UNICODE={d:t().addRange(48,57),D:t().addRange(0,47).addRange(58,1114111),s:t(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:t().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:t(95).addRange(48,57).addRange(65,90).addRange(97,122),W:t(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)},l.UNICODE_IGNORE_CASE={d:t().addRange(48,57),D:t().addRange(0,47).addRange(58,1114111),s:t(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:t().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:t(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:t(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:325}],324:[function(e,n){n.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}
},{}],325:[function(n,l,t){(function(n){!function(r){var a="object"==typeof t&&t,u="object"==typeof l&&l&&l.exports==a&&l,o="object"==typeof n&&n;(o.global===o||o.window===o)&&(r=o);var s={rangeOrder:"A range’s `stop` value must be greater than or equal to the `start` value.",codePointRange:"Invalid code point value. Code points range from U+000000 to U+10FFFF."},i=55296,c=56319,p=56320,d=57343,f=/\\x00([^0123456789]|$)/g,h={},g=h.hasOwnProperty,m=function(e,n){var l;for(l in n)g.call(n,l)&&(e[l]=n[l]);return e},y=function(e,n){for(var l=-1,t=e.length;++l<t;)n(e[l],l)},_=h.toString,x=function(e){return"[object Array]"==_.call(e)},b=function(e){return"number"==typeof e||"[object Number]"==_.call(e)},v="0000",I=function(e,n){var l=String(e);return l.length<n?(v+l).slice(-n):l},w=function(e){return Number(e).toString(16).toUpperCase()},E=[].slice,k=function(e){for(var n,l=-1,t=e.length,r=t-1,a=[],u=!0,o=0;++l<t;)if(n=e[l],u)a.push(n),o=n,u=!1;else if(n==o+1){if(l!=r){o=n;continue}u=!0,a.push(n+1)}else a.push(o+1,n),o=n;return u||a.push(n+1),a},R=function(e,n){for(var l,t,r=0,a=e.length;a>r;){if(l=e[r],t=e[r+1],n>=l&&t>n)return n==l?t==l+1?(e.splice(r,2),e):(e[r]=n+1,e):n==t-1?(e[r+1]=n,e):(e.splice(r,2,l,n,n+1,t),e);r+=2}return e},S=function(e,n,l){if(n>l)throw Error(s.rangeOrder);for(var t,r,a=0;a<e.length;){if(t=e[a],r=e[a+1]-1,t>l)return e;if(t>=n&&l>=r)e.splice(a,2);else{if(n>=t&&r>l)return n==t?(e[a]=l+1,e[a+1]=r+1,e):(e.splice(a,2,t,n,l+1,r+1),e);if(n>=t&&r>=n)e[a+1]=n;else if(l>=t&&r>=l)return e[a]=l+1,e;a+=2}}return e},C=function(e,n){var l,t,r=0,a=null,u=e.length;if(0>n||n>1114111)throw RangeError(s.codePointRange);for(;u>r;){if(l=e[r],t=e[r+1],n>=l&&t>n)return e;if(n==l-1)return e[r]=n,e;if(l>n)return e.splice(null!=a?a+2:0,0,n,n+1),e;if(n==t)return n+1==e[r+2]?(e.splice(r,4,l,e[r+3]),e):(e[r+1]=n+1,e);a=r,r+=2}return e.push(n,n+1),e},A=function(e,n){for(var l,t,r=0,a=e.slice(),u=n.length;u>r;)l=n[r],t=n[r+1]-1,a=l==t?C(a,l):j(a,l,t),r+=2;return a},M=function(e,n){for(var l,t,r=0,a=e.slice(),u=n.length;u>r;)l=n[r],t=n[r+1]-1,a=l==t?R(a,l):S(a,l,t),r+=2;return a},j=function(e,n,l){if(n>l)throw Error(s.rangeOrder);if(0>n||n>1114111||0>l||l>1114111)throw RangeError(s.codePointRange);for(var t,r,a=0,u=!1,o=e.length;o>a;){if(t=e[a],r=e[a+1],u){if(t==l+1)return e.splice(a-1,2),e;if(t>l)return e;t>=n&&l>=t&&(r>n&&l>=r-1?(e.splice(a,2),a-=2):(e.splice(a-1,2),a-=2))}else{if(t==l+1)return e[a]=n,e;if(t>l)return e.splice(a,0,n,l+1),e;if(n>=t&&r>n&&r>=l+1)return e;n>=t&&r>n||r==n?(e[a+1]=l+1,u=!0):t>=n&&l+1>=r&&(e[a]=n,e[a+1]=l+1,u=!0)}a+=2}return u||e.push(n,l+1),e},T=function(e,n){var l=0,t=e.length,r=e[l],a=e[t-1];if(t>=2&&(r>n||n>a))return!1;for(;t>l;){if(r=e[l],a=e[l+1],n>=r&&a>n)return!0;l+=2}return!1},P=function(e,n){for(var l,t=0,r=n.length,a=[];r>t;)l=n[t],T(e,l)&&a.push(l),++t;return k(a)},L=function(e){return!e.length},O=function(e){return 2==e.length&&e[0]+1==e[1]},D=function(e){for(var n,l,t=0,r=[],a=e.length;a>t;){for(n=e[t],l=e[t+1];l>n;)r.push(n),++n;t+=2}return r},F=Math.floor,B=function(e){return parseInt(F((e-65536)/1024)+i,10)},N=function(e){return parseInt((e-65536)%1024+p,10)},V=String.fromCharCode,U=function(e){var n;return n=9==e?"\\t":10==e?"\\n":12==e?"\\f":13==e?"\\r":92==e?"\\\\":36==e||e>=40&&43>=e||45==e||46==e||63==e||e>=91&&94>=e||e>=123&&125>=e?"\\"+V(e):e>=32&&126>=e?V(e):255>=e?"\\x"+I(w(e),2):"\\u"+I(w(e),4)},q=function(e){var n,l=e.length,t=e.charCodeAt(0);return t>=i&&c>=t&&l>1?(n=e.charCodeAt(1),1024*(t-i)+n-p+65536):t},G=function(e){var n,l,t="",r=0,a=e.length;if(O(e))return U(e[0]);for(;a>r;)n=e[r],l=e[r+1]-1,t+=n==l?U(n):n+1==l?U(n)+U(l):U(n)+"-"+U(l),r+=2;return"["+t+"]"},H=function(e){for(var n,l,t=[],r=[],a=[],u=[],o=0,s=e.length;s>o;)n=e[o],l=e[o+1]-1,i>n?(i>l&&a.push(n,l+1),l>=i&&c>=l&&(a.push(n,i),t.push(i,l+1)),l>=p&&d>=l&&(a.push(n,i),t.push(i,c+1),r.push(p,l+1)),l>d&&(a.push(n,i),t.push(i,c+1),r.push(p,d+1),65535>=l?a.push(d+1,l+1):(a.push(d+1,65536),u.push(65536,l+1)))):n>=i&&c>=n?(l>=i&&c>=l&&t.push(n,l+1),l>=p&&d>=l&&(t.push(n,c+1),r.push(p,l+1)),l>d&&(t.push(n,c+1),r.push(p,d+1),65535>=l?a.push(d+1,l+1):(a.push(d+1,65536),u.push(65536,l+1)))):n>=p&&d>=n?(l>=p&&d>=l&&r.push(n,l+1),l>d&&(r.push(n,d+1),65535>=l?a.push(d+1,l+1):(a.push(d+1,65536),u.push(65536,l+1)))):n>d&&65535>=n?65535>=l?a.push(n,l+1):(a.push(n,65536),u.push(65536,l+1)):u.push(n,l+1),o+=2;return{loneHighSurrogates:t,loneLowSurrogates:r,bmp:a,astral:u}},W=function(e){for(var n,l,t,r,a,u,o=[],s=[],i=!1,c=-1,p=e.length;++c<p;)if(n=e[c],l=e[c+1]){for(t=n[0],r=n[1],a=l[0],u=l[1],s=r;a&&t[0]==a[0]&&t[1]==a[1];)s=O(u)?C(s,u[0]):j(s,u[0],u[1]-1),++c,n=e[c],t=n[0],r=n[1],l=e[c+1],a=l&&l[0],u=l&&l[1],i=!0;o.push([t,i?s:r]),i=!1}else o.push(n);return J(o)},J=function(e){if(1==e.length)return e;for(var n=-1,l=-1;++n<e.length;){var t=e[n],r=t[1],a=r[0],u=r[1];for(l=n;++l<e.length;){var o=e[l],s=o[1],i=s[0],c=s[1];a==i&&u==c&&(t[0]=O(o[0])?C(t[0],o[0][0]):j(t[0],o[0][0],o[0][1]-1),e.splice(l,1),--l)}}return e},Y=function(e){if(!e.length)return[];for(var n,l,t,r,a,u,o=0,s=0,i=0,c=[],f=e.length;f>o;){n=e[o],l=e[o+1]-1,t=B(n),r=N(n),a=B(l),u=N(l);var h=r==p,g=u==d,m=!1;t==a||h&&g?(c.push([[t,a+1],[r,u+1]]),m=!0):c.push([[t,t+1],[r,d+1]]),!m&&a>t+1&&(g?(c.push([[t+1,a+1],[p,u+1]]),m=!0):c.push([[t+1,a],[p,d+1]])),m||c.push([[a,a+1],[p,u+1]]),s=t,i=a,o+=2}return W(c)},X=function(e){var n=[];return y(e,function(e){var l=e[0],t=e[1];n.push(G(l)+G(t))}),n.join("|")},z=function(e,n){var l=[],t=H(e),r=t.loneHighSurrogates,a=t.loneLowSurrogates,u=t.bmp,o=t.astral,s=(!L(t.astral),!L(r)),i=!L(a),c=Y(o);return n&&(u=A(u,r),s=!1,u=A(u,a),i=!1),L(u)||l.push(G(u)),c.length&&l.push(X(c)),s&&l.push(G(r)+"(?![\\uDC00-\\uDFFF])"),i&&l.push("(?:[^\\uD800-\\uDBFF]|^)"+G(a)),l.join("|")},K=function(e){return arguments.length>1&&(e=E.call(arguments)),this instanceof K?(this.data=[],e?this.add(e):this):(new K).add(e)};K.version="1.2.0";var $=K.prototype;m($,{add:function(e){var n=this;return null==e?n:e instanceof K?(n.data=A(n.data,e.data),n):(arguments.length>1&&(e=E.call(arguments)),x(e)?(y(e,function(e){n.add(e)}),n):(n.data=C(n.data,b(e)?e:q(e)),n))},remove:function(e){var n=this;return null==e?n:e instanceof K?(n.data=M(n.data,e.data),n):(arguments.length>1&&(e=E.call(arguments)),x(e)?(y(e,function(e){n.remove(e)}),n):(n.data=R(n.data,b(e)?e:q(e)),n))},addRange:function(e,n){var l=this;return l.data=j(l.data,b(e)?e:q(e),b(n)?n:q(n)),l},removeRange:function(e,n){var l=this,t=b(e)?e:q(e),r=b(n)?n:q(n);return l.data=S(l.data,t,r),l},intersection:function(e){var n=this,l=e instanceof K?D(e.data):e;return n.data=P(n.data,l),n},contains:function(e){return T(this.data,b(e)?e:q(e))},clone:function(){var e=new K;return e.data=this.data.slice(0),e},toString:function(e){var n=z(this.data,e?e.bmpOnly:!1);return n.replace(f,"\\0$1")},toRegExp:function(e){return RegExp(this.toString(),e||"")},valueOf:function(){return D(this.data)}}),$.toArray=$.valueOf,"function"==typeof e&&"object"==typeof e.amd&&e.amd?e(function(){return K}):a&&!a.nodeType?u?u.exports=K:a.regenerate=K:r.regenerate=K}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],326:[function(n,l,t){(function(n){(function(){"use strict";function r(){var e,n,l=16384,t=[],r=-1,a=arguments.length;if(!a)return"";for(var u="";++r<a;){var o=Number(arguments[r]);if(!isFinite(o)||0>o||o>1114111||S(o)!=o)throw RangeError("Invalid code point: "+o);65535>=o?t.push(o):(o-=65536,e=(o>>10)+55296,n=o%1024+56320,t.push(e,n)),(r+1==a||t.length>l)&&(u+=R.apply(null,t),t.length=0)}return u}function a(e,n){if(-1==n.indexOf("|")){if(e==n)return;throw Error("Invalid node type: "+e)}if(n=a.hasOwnProperty(n)?a[n]:a[n]=RegExp("^(?:"+n+")$"),!n.test(e))throw Error("Invalid node type: "+e)}function u(e){var n=e.type;if(u.hasOwnProperty(n)&&"function"==typeof u[n])return u[n](e);throw Error("Invalid node type: "+n)}function o(e){a(e.type,"alternative");var n=e.body,l=n?n.length:0;if(1==l)return x(n[0]);for(var t=-1,r="";++t<l;)r+=x(n[t]);return r}function s(e){switch(a(e.type,"anchor"),e.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function i(e){return a(e.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value"),u(e)}function c(e){a(e.type,"characterClass");var n=e.body,l=n?n.length:0,t=-1,r="[";for(e.negative&&(r+="^");++t<l;)r+=f(n[t]);return r+="]"}function p(e){return a(e.type,"characterClassEscape"),"\\"+e.value}function d(e){a(e.type,"characterClassRange");var n=e.min,l=e.max;if("characterClassRange"==n.type||"characterClassRange"==l.type)throw Error("Invalid character class range");return f(n)+"-"+f(l)}function f(e){return a(e.type,"anchor|characterClassEscape|characterClassRange|dot|value"),u(e)}function h(e){a(e.type,"disjunction");var n=e.body,l=n?n.length:0;if(0==l)throw Error("No body");if(1==l)return u(n[0]);for(var t=-1,r="";++t<l;)0!=t&&(r+="|"),r+=u(n[t]);return r}function g(e){return a(e.type,"dot"),"."}function m(e){a(e.type,"group");var n="(";switch(e.behavior){case"normal":break;case"ignore":n+="?:";break;case"lookahead":n+="?=";break;case"negativeLookahead":n+="?!";break;default:throw Error("Invalid behaviour: "+e.behaviour)}var l=e.body,t=l?l.length:0;if(1==t)n+=u(l[0]);else for(var r=-1;++r<t;)n+=u(l[r]);return n+=")"}function y(e){a(e.type,"quantifier");var n="",l=e.min,t=e.max;switch(t){case void 0:case null:switch(l){case 0:n="*";break;case 1:n="+";break;default:n="{"+l+",}"}break;default:n=l==t?"{"+l+"}":0==l&&1==t?"?":"{"+l+","+t+"}"}return e.greedy||(n+="?"),i(e.body[0])+n}function _(e){return a(e.type,"reference"),"\\"+e.matchIndex}function x(e){return a(e.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value"),u(e)}function b(e){a(e.type,"value");var n=e.kind,l=e.codePoint;switch(n){case"controlLetter":return"\\c"+r(l+64);case"hexadecimalEscape":return"\\x"+("00"+l.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+r(l);case"null":return"\\"+l;case"octal":return"\\"+l.toString(8);case"singleEscape":switch(l){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+l)}case"symbol":return r(l);case"unicodeEscape":return"\\u"+("0000"+l.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+l.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+n)}}var v={"function":!0,object:!0},I=v[typeof window]&&window||this,w=v[typeof t]&&t,E=v[typeof l]&&l&&!l.nodeType&&l,k=w&&E&&"object"==typeof n&&n;!k||k.global!==k&&k.window!==k&&k.self!==k||(I=k);var R=String.fromCharCode,S=Math.floor;u.alternative=o,u.anchor=s,u.characterClass=c,u.characterClassEscape=p,u.characterClassRange=d,u.disjunction=h,u.dot=g,u.group=m,u.quantifier=y,u.reference=_,u.value=b,"function"==typeof e&&"object"==typeof e.amd&&e.amd?e(function(){return{generate:u}}):w&&E?w.generate=u:I.regjsgen={generate:u}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],327:[function(e,n){!function(){function e(e,n){function l(n){return n.raw=e.substring(n.range[0],n.range[1]),n}function t(e,n){return e.range[0]=n,l(e)}function r(e,n){return l({type:"anchor",kind:e,range:[K-n,K]})}function a(e,n,t,r){return l({type:"value",kind:e,codePoint:n,range:[t,r]})}function u(e,n,l,t){return t=t||0,a(e,n,K-(l.length+t),K)}function o(e){var n=e[0],l=n.charCodeAt(0);if(z){var t;if(1===n.length&&l>=55296&&56319>=l&&(t=v().charCodeAt(0),t>=56320&&57343>=t))return K++,a("symbol",1024*(l-55296)+t-56320+65536,K-2,K)}return a("symbol",l,K-1,K)}function s(e,n,t){return l({type:"disjunction",body:e,range:[n,t]})}function i(){return l({type:"dot",range:[K-1,K]})}function c(e){return l({type:"characterClassEscape",value:e,range:[K-2,K]})}function p(e){return l({type:"reference",matchIndex:parseInt(e,10),range:[K-1-e.length,K]})}function d(e,n,t,r){return l({type:"group",behavior:e,body:n,range:[t,r]})}function f(e,n,t,r){return null==r&&(t=K-1,r=K),l({type:"quantifier",min:e,max:n,greedy:!0,body:null,range:[t,r]})}function h(e,n,t){return l({type:"alternative",body:e,range:[n,t]})}function g(e,n,t,r){return l({type:"characterClass",body:e,negative:n,range:[t,r]})}function m(e,n,t,r){if(e.codePoint>n.codePoint)throw SyntaxError("invalid range in character class");return l({type:"characterClassRange",min:e,max:n,range:[t,r]})}function y(e){return"alternative"===e.type?e.body:[e]}function _(n){n=n||1;var l=e.substring(K,K+n);return K+=n||1,l}function x(e){if(!b(e))throw SyntaxError("character: "+e)}function b(n){return e.indexOf(n,K)===K?_(n.length):void 0}function v(){return e[K]}function I(n){return e.indexOf(n,K)===K}function w(n){return e[K+1]===n}function E(n){var l=e.substring(K),t=l.match(n);return t&&(t.range=[],t.range[0]=K,_(t[0].length),t.range[1]=K),t}function k(){var e=[],n=K;for(e.push(R());b("|");)e.push(R());return 1===e.length?e[0]:s(e,n,K)}function R(){for(var e,n=[],l=K;e=S();)n.push(e);return 1===n.length?n[0]:h(n,l,K)}function S(){if(K>=e.length||I("|")||I(")"))return null;var n=A();if(n)return n;var l=j();if(!l)throw SyntaxError("Expected atom");var r=M()||!1;return r?(r.body=y(l),t(r,l.range[0]),r):l}function C(e,n,l,t){var r=null,a=K;if(b(e))r=n;else{if(!b(l))return!1;r=t}var u=k();if(!u)throw SyntaxError("Expected disjunction");x(")");var o=d(r,y(u),a,K);return"normal"==r&&X&&Y++,o}function A(){return b("^")?r("start",1):b("$")?r("end",1):b("\\b")?r("boundary",2):b("\\B")?r("not-boundary",2):C("(?=","lookahead","(?!","negativeLookahead")}function M(){var e,n,l,t;if(b("*"))n=f(0);else if(b("+"))n=f(1);else if(b("?"))n=f(0,1);else if(e=E(/^\{([0-9]+)\}/))l=parseInt(e[1],10),n=f(l,l,e.range[0],e.range[1]);else if(e=E(/^\{([0-9]+),\}/))l=parseInt(e[1],10),n=f(l,void 0,e.range[0],e.range[1]);else if(e=E(/^\{([0-9]+),([0-9]+)\}/)){if(l=parseInt(e[1],10),t=parseInt(e[2],10),l>t)throw SyntaxError("numbers out of order in {} quantifier");n=f(l,t,e.range[0],e.range[1])}return n&&b("?")&&(n.greedy=!1,n.range[1]+=1),n}function j(){var e;if(e=E(/^[^^$\\.*+?(){[|]/))return o(e);if(b("."))return i();if(b("\\")){if(e=L(),!e)throw SyntaxError("atomEscape");return e}return(e=N())?e:C("(?:","ignore","(","normal")}function T(e){if(z){var n,t;if("unicodeEscape"==e.kind&&(n=e.codePoint)>=55296&&56319>=n&&I("\\")&&w("u")){var r=K;K++;var a=P();"unicodeEscape"==a.kind&&(t=a.codePoint)>=56320&&57343>=t?(e.range[1]=a.range[1],e.codePoint=1024*(n-55296)+t-56320+65536,e.type="value",e.kind="unicodeCodePointEscape",l(e)):K=r}}return e}function P(){return L(!0)}function L(e){var n;if(n=O())return n;if(e){if(b("b"))return u("singleEscape",8,"\\b");if(b("B"))throw SyntaxError("\\B not possible inside of CharacterClass")}return n=D()}function O(){var e,n;if(e=E(/^(?!0)\d+/)){n=e[0];var l=parseInt(e[0],10);return Y>=l?p(e[0]):(J.push(l),_(-e[0].length),(e=E(/^[0-7]{1,3}/))?u("octal",parseInt(e[0],8),e[0],1):(e=o(E(/^[89]/)),t(e,e.range[0]-1)))}return(e=E(/^[0-7]{1,3}/))?(n=e[0],/^0{1,3}$/.test(n)?u("null",0,"0",n.length+1):u("octal",parseInt(n,8),n,1)):(e=E(/^[dDsSwW]/))?c(e[0]):!1}function D(){var e;if(e=E(/^[fnrtv]/)){var n=0;switch(e[0]){case"t":n=9;break;case"n":n=10;break;case"v":n=11;break;case"f":n=12;break;case"r":n=13}return u("singleEscape",n,"\\"+e[0])}return(e=E(/^c([a-zA-Z])/))?u("controlLetter",e[1].charCodeAt(0)%32,e[1],2):(e=E(/^x([0-9a-fA-F]{2})/))?u("hexadecimalEscape",parseInt(e[1],16),e[1],2):(e=E(/^u([0-9a-fA-F]{4})/))?T(u("unicodeEscape",parseInt(e[1],16),e[1],2)):z&&(e=E(/^u\{([0-9a-fA-F]+)\}/))?u("unicodeCodePointEscape",parseInt(e[1],16),e[1],4):B()}function F(e){var n=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||e>=48&&57>=e||92===e||e>=128&&n.test(String.fromCharCode(e))}function B(){var e,n="",l="";return F(v())?b(n)?u("identifier",8204,n):b(l)?u("identifier",8205,l):null:(e=_(),u("identifier",e.charCodeAt(0),e,1))}function N(){var e,n=K;return(e=E(/^\[\^/))?(e=V(),x("]"),g(e,!0,n,K)):b("[")?(e=V(),x("]"),g(e,!1,n,K)):null}function V(){var e;if(I("]"))return[];if(e=q(),!e)throw SyntaxError("nonEmptyClassRanges");return e}function U(e){var n,l,t;if(I("-")&&!w("]")){if(x("-"),t=H(),!t)throw SyntaxError("classAtom");l=K;var r=V();if(!r)throw SyntaxError("classRanges");return n=e.range[0],"empty"===r.type?[m(e,t,n,l)]:[m(e,t,n,l)].concat(r)}if(t=G(),!t)throw SyntaxError("nonEmptyClassRangesNoDash");return[e].concat(t)}function q(){var e=H();if(!e)throw SyntaxError("classAtom");return I("]")?[e]:U(e)}function G(){var e=H();if(!e)throw SyntaxError("classAtom");return I("]")?e:U(e)}function H(){return b("-")?o("-"):W()}function W(){var e;if(e=E(/^[^\\\]-]/))return o(e[0]);if(b("\\")){if(e=P(),!e)throw SyntaxError("classEscape");return T(e)}}var J=[],Y=0,X=!0,z=-1!==(n||"").indexOf("u"),K=0;e=String(e),""===e&&(e="(?:)");var $=k();if($.range[1]!==e.length)throw SyntaxError("Could not parse entire input - got stuck: "+e);for(var Q=0;Q<J.length;Q++)if(J[Q]<=Y)return K=0,X=!1,k();return $}var l={parse:e};"undefined"!=typeof n&&n.exports?n.exports=l:window.regjsparser=l}()},{}],328:[function(e,n){function l(e){return I?v?h.UNICODE_IGNORE_CASE[e]:h.UNICODE[e]:h.REGULAR[e]}function t(e,n){return m.call(e,n)}function r(e,n){for(var l in n)e[l]=n[l]}function a(e,n){if(n){var l=p(n,"");switch(l.type){case"characterClass":case"group":case"value":break;default:l=u(l,n)}r(e,l)}}function u(e,n){return{type:"group",behavior:"ignore",body:[e],raw:"(?:"+n+")"}}function o(e){return t(f,e)?f[e]:!1}function s(e){{var n=d();e.body.forEach(function(e){switch(e.type){case"value":if(n.add(e.codePoint),v&&I){var t=o(e.codePoint);t&&n.add(t)}break;case"characterClassRange":var r=e.min.codePoint,a=e.max.codePoint;n.addRange(r,a),v&&I&&n.iuAddRange(r,a);break;case"characterClassEscape":n.add(l(e.value));break;default:throw Error("Unknown term type: "+e.type)}})}return e.negative&&(n=(I?y:_).clone().remove(n)),a(e,n.toString()),e}function i(e){switch(e.type){case"dot":a(e,(I?x:b).toString());break;case"characterClass":e=s(e);break;case"characterClassEscape":a(e,l(e.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":e.body=e.body.map(i);break;case"value":var n=e.codePoint,t=d(n);if(v&&I){var r=o(n);r&&t.add(r)}a(e,t.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+e.type)}return e}var c=e("regjsgen").generate,p=e("regjsparser").parse,d=e("regenerate"),f=e("./data/iu-mappings.json"),h=e("./data/character-class-escape-sets.js"),g={},m=g.hasOwnProperty,y=d().addRange(0,1114111),_=d().addRange(0,65535),x=y.clone().remove(10,13,8232,8233),b=x.clone().intersection(_);d.prototype.iuAddRange=function(e,n){var l=this;do{var t=o(e);t&&l.add(t)}while(++e<=n);return l};var v=!1,I=!1;n.exports=function(e,n){var l=p(e,n);return v=n?n.indexOf("i")>-1:!1,I=n?n.indexOf("u")>-1:!1,r(l,i(l)),c(l)}},{"./data/character-class-escape-sets.js":323,"./data/iu-mappings.json":324,regenerate:325,regjsgen:326,regjsparser:327}],329:[function(e,n){"use strict";var l=e("is-finite");n.exports=function(e,n){if("string"!=typeof e)throw new TypeError("Expected a string as the first argument");if(0>n||!l(n))throw new TypeError("Expected a finite positive number");var t="";do 1&n&&(t+=e),e+=e;while(n>>=1);return t}},{"is-finite":330}],330:[function(e,n,l){arguments[4][190][0].apply(l,arguments)},{dup:190}],331:[function(e,n){"use strict";n.exports=/^#!.*/},{}],332:[function(e,n){"use strict";n.exports=function(e){var n=/^\\\\\?\\/.test(e),l=/[^\x00-\x80]+/.test(e);return n||l?e:e.replace(/\\/g,"/")}},{}],333:[function(e,n,l){l.SourceMapGenerator=e("./source-map/source-map-generator").SourceMapGenerator,l.SourceMapConsumer=e("./source-map/source-map-consumer").SourceMapConsumer,l.SourceNode=e("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":339,"./source-map/source-map-generator":340,"./source-map/source-node":341}],334:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(){this._array=[],this._set={}}var t=e("./util");l.fromArray=function(e,n){for(var t=new l,r=0,a=e.length;a>r;r++)t.add(e[r],n);return t},l.prototype.add=function(e,n){var l=this.has(e),r=this._array.length;(!l||n)&&this._array.push(e),l||(this._set[t.toSetString(e)]=r)},l.prototype.has=function(e){return Object.prototype.hasOwnProperty.call(this._set,t.toSetString(e))},l.prototype.indexOf=function(e){if(this.has(e))return this._set[t.toSetString(e)];throw new Error('"'+e+'" is not in the set.')},l.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},l.prototype.toArray=function(){return this._array.slice()},n.ArraySet=l})},{"./util":342,amdefine:343}],335:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e){return 0>e?(-e<<1)+1:(e<<1)+0}function t(e){var n=1===(1&e),l=e>>1;return n?-l:l}var r=e("./base64"),a=5,u=1<<a,o=u-1,s=u;n.encode=function(e){var n,t="",u=l(e);do n=u&o,u>>>=a,u>0&&(n|=s),t+=r.encode(n);while(u>0);return t},n.decode=function(e,n,l){var u,i,c=e.length,p=0,d=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");i=r.decode(e.charAt(n++)),u=!!(i&s),i&=o,p+=i<<d,d+=a}while(u);l.value=t(p),l.rest=n}})},{"./base64":336,amdefine:343}],336:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){var l={},t={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(e,n){l[e]=n,t[n]=e}),n.encode=function(e){if(e in t)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){if(e in l)return l[e];throw new TypeError("Not a valid base 64 digit: "+e)}})},{amdefine:343}],337:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e,t,r,a,u,o){var s=Math.floor((t-e)/2)+e,i=u(r,a[s],!0);return 0===i?s:i>0?t-s>1?l(s,t,r,a,u,o):o==n.LEAST_UPPER_BOUND?t<a.length?t:-1:s:s-e>1?l(e,s,r,a,u,o):o==n.LEAST_UPPER_BOUND?s:0>e?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,r,a){return 0===t.length?-1:l(-1,t.length,e,t,r,a||n.GREATEST_LOWER_BOUND)}})},{amdefine:343}],338:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e,n){var l=e.generatedLine,t=n.generatedLine,a=e.generatedColumn,u=n.generatedColumn;return t>l||t==l&&u>=a||r.compareByGeneratedPositions(e,n)<=0}function t(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var r=e("./util");t.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},t.prototype.add=function(e){l(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},t.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositions),this._sorted=!0),this._array},n.MappingList=t})},{"./util":342,amdefine:343}],339:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new r(n):new t(n)}function t(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var l=a.getArg(n,"version"),t=a.getArg(n,"sources"),r=a.getArg(n,"names",[]),u=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),i=a.getArg(n,"mappings"),c=a.getArg(n,"file",null);if(l!=this._version)throw new Error("Unsupported version: "+l);t=t.map(a.normalize),this._names=o.fromArray(r,!0),this._sources=o.fromArray(t,!0),this.sourceRoot=u,this.sourcesContent=s,this._mappings=i,this.file=c}function r(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=a.getArg(n,"version"),r=a.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);var u={line:-1,column:0};this._sections=r.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),t=a.getArg(n,"line"),r=a.getArg(n,"column");if(t<u.line||t===u.line&&r<u.column)throw new Error("Section offsets must be ordered and non-overlapping.");return u=n,{generatedOffset:{generatedLine:t+1,generatedColumn:r+1},consumer:new l(a.getArg(e,"map"))}})}var a=e("./util"),u=e("./binary-search"),o=e("./array-set").ArraySet,s=e("./base64-vlq");l.fromSourceMap=function(e){return t.fromSourceMap(e)},l.prototype._version=3,l.prototype.__generatedMappings=null,Object.defineProperty(l.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__generatedMappings}}),l.prototype.__originalMappings=null,Object.defineProperty(l.prototype,"_originalMappings",{get:function(){return this.__originalMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__originalMappings}}),l.prototype._nextCharIsMappingSeparator=function(e,n){var l=e.charAt(n);return";"===l||","===l},l.prototype._parseMappings=function(){throw new Error("Subclasses must implement _parseMappings")},l.GENERATED_ORDER=1,l.ORIGINAL_ORDER=2,l.GREATEST_LOWER_BOUND=1,l.LEAST_UPPER_BOUND=2,l.prototype.eachMapping=function(e,n,t){var r,u=n||null,o=t||l.GENERATED_ORDER;switch(o){case l.GENERATED_ORDER:r=this._generatedMappings;break;case l.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;r.map(function(e){var n=e.source;return null!=n&&null!=s&&(n=a.join(s,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name}}).forEach(e,u)},l.prototype.allGeneratedPositionsFor=function(e){var n={source:a.getArg(e,"source"),originalLine:a.getArg(e,"line"),originalColumn:0};null!=this.sourceRoot&&(n.source=a.relative(this.sourceRoot,n.source));var l=[],t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(t>=0)for(var r=this._originalMappings[t];r&&r.originalLine===n.originalLine;)l.push({line:a.getArg(r,"generatedLine",null),column:a.getArg(r,"generatedColumn",null),lastColumn:a.getArg(r,"lastGeneratedColumn",null)}),r=this._originalMappings[++t];return l},n.SourceMapConsumer=l,t.prototype=Object.create(l.prototype),t.prototype.consumer=l,t.fromSourceMap=function(e){var n=Object.create(t.prototype);return n._names=o.fromArray(e._names.toArray(),!0),n._sources=o.fromArray(e._sources.toArray(),!0),n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n.__generatedMappings=e._mappings.toArray().slice(),n.__originalMappings=e._mappings.toArray().slice().sort(a.compareByOriginalPositions),n},t.prototype._version=3,Object.defineProperty(t.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?a.join(this.sourceRoot,e):e},this)}}),t.prototype._parseMappings=function(e){for(var n,l,t,r,u=1,o=0,i=0,c=0,p=0,d=0,f=e.length,h=0,g={},m={};f>h;)if(";"===e.charAt(h))u++,++h,o=0;else if(","===e.charAt(h))++h;else{for(n={},n.generatedLine=u,r=h;f>r&&!this._nextCharIsMappingSeparator(e,r);++r);if(l=e.slice(h,r),t=g[l])h+=l.length;else{for(t=[];r>h;)s.decode(e,h,m),value=m.value,h=m.rest,t.push(value);g[l]=t}if(n.generatedColumn=o+t[0],o=n.generatedColumn,t.length>1){if(n.source=this._sources.at(p+t[1]),p+=t[1],2===t.length)throw new Error("Found a source, but no line and column");if(n.originalLine=i+t[2],i=n.originalLine,n.originalLine+=1,3===t.length)throw new Error("Found a source and line, but no column");n.originalColumn=c+t[3],c=n.originalColumn,t.length>4&&(n.name=this._names.at(d+t[4]),d+=t[4])}this.__generatedMappings.push(n),"number"==typeof n.originalLine&&this.__originalMappings.push(n)}this.__generatedMappings.sort(a.compareByGeneratedPositions),this.__originalMappings.sort(a.compareByOriginalPositions)},t.prototype._findMapping=function(e,n,l,t,r,a){if(e[l]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[l]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,r,a)},t.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var l=this._generatedMappings[e+1];if(n.generatedLine===l.generatedLine){n.lastGeneratedColumn=l.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},t.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",a.compareByGeneratedPositions,a.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===n.generatedLine){var u=a.getArg(r,"source",null);return null!=u&&null!=this.sourceRoot&&(u=a.join(this.sourceRoot,u)),{source:u,line:a.getArg(r,"originalLine",null),column:a.getArg(r,"originalColumn",null),name:a.getArg(r,"name",null)}}}return{source:null,line:null,column:null,name:null}},t.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var l;if(null!=this.sourceRoot&&(l=a.urlParse(this.sourceRoot))){var t=e.replace(/^file:\/\//,"");if("file"==l.scheme&&this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];if((!l.path||"/"==l.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},t.prototype.generatedPositionFor=function(e){var n={source:a.getArg(e,"source"),originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")};null!=this.sourceRoot&&(n.source=a.relative(this.sourceRoot,n.source));var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(t>=0){var r=this._originalMappings[t];return{line:a.getArg(r,"generatedLine",null),column:a.getArg(r,"generatedColumn",null),lastColumn:a.getArg(r,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=t,r.prototype=Object.create(l.prototype),r.prototype.constructor=l,r.prototype._version=3,Object.defineProperty(r.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var l=0;l<this._sections[n].consumer.sources.length;l++)e.push(this._sections[n].consumer.sources[l]);
return e}}),r.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},l=u.search(n,this._sections,function(e,n){var l=e.generatedLine-n.generatedOffset.generatedLine;return l?l:e.generatedColumn-n.generatedOffset.generatedColumn}),t=this._sections[l];return t?t.consumer.originalPositionFor({line:n.generatedLine-(t.generatedOffset.generatedLine-1),column:n.generatedColumn-(t.generatedOffset.generatedLine===n.generatedLine?t.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},r.prototype.sourceContentFor=function(e,n){for(var l=0;l<this._sections.length;l++){var t=this._sections[l],r=t.consumer.sourceContentFor(e,!0);if(r)return r}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},r.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var l=this._sections[n];if(-1!==l.consumer.sources.indexOf(a.getArg(e,"source"))){var t=l.consumer.generatedPositionFor(e);if(t){var r={line:t.line+(l.generatedOffset.generatedLine-1),column:t.column+(l.generatedOffset.generatedLine===t.line?l.generatedOffset.generatedColumn-1:0)};return r}}}return{line:null,column:null}},r.prototype._parseMappings=function(){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var n=this._sections[e],l=n.consumer._generatedMappings,t=0;t<l.length;t++){var r=l[e],u=r.source,o=n.consumer.sourceRoot;null!=u&&null!=o&&(u=a.join(o,u));var s={source:u,generatedLine:r.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:r.column+(n.generatedOffset.generatedLine===r.generatedLine)?n.generatedOffset.generatedColumn-1:0,originalLine:r.originalLine,originalColumn:r.originalColumn,name:r.name};this.__generatedMappings.push(s),"number"==typeof s.originalLine&&this.__originalMappings.push(s)}this.__generatedMappings.sort(a.compareByGeneratedPositions),this.__originalMappings.sort(a.compareByOriginalPositions)},n.IndexedSourceMapConsumer=r})},{"./array-set":334,"./base64-vlq":335,"./binary-search":337,"./util":342,amdefine:343}],340:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e){e||(e={}),this._file=r.getArg(e,"file",null),this._sourceRoot=r.getArg(e,"sourceRoot",null),this._skipValidation=r.getArg(e,"skipValidation",!1),this._sources=new a,this._names=new a,this._mappings=new u,this._sourcesContents=null}var t=e("./base64-vlq"),r=e("./util"),a=e("./array-set").ArraySet,u=e("./mapping-list").MappingList;l.prototype._version=3,l.fromSourceMap=function(e){var n=e.sourceRoot,t=new l({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var l={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(l.source=e.source,null!=n&&(l.source=r.relative(n,l.source)),l.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(l.name=e.name)),t.addMapping(l)}),e.sources.forEach(function(n){var l=e.sourceContentFor(n);null!=l&&t.setSourceContent(n,l)}),t},l.prototype.addMapping=function(e){var n=r.getArg(e,"generated"),l=r.getArg(e,"original",null),t=r.getArg(e,"source",null),a=r.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,l,t,a),null==t||this._sources.has(t)||this._sources.add(t),null==a||this._names.has(a)||this._names.add(a),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=l&&l.line,originalColumn:null!=l&&l.column,source:t,name:a})},l.prototype.setSourceContent=function(e,n){var l=e;null!=this._sourceRoot&&(l=r.relative(this._sourceRoot,l)),null!=n?(this._sourcesContents||(this._sourcesContents={}),this._sourcesContents[r.toSetString(l)]=n):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(l)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},l.prototype.applySourceMap=function(e,n,l){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var u=this._sourceRoot;null!=u&&(t=r.relative(u,t));var o=new a,s=new a;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var a=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=a.source&&(n.source=a.source,null!=l&&(n.source=r.join(l,n.source)),null!=u&&(n.source=r.relative(u,n.source)),n.originalLine=a.line,n.originalColumn=a.column,null!=a.name&&(n.name=a.name))}var i=n.source;null==i||o.has(i)||o.add(i);var c=n.name;null==c||s.has(c)||s.add(c)},this),this._sources=o,this._names=s,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=l&&(n=r.join(l,n)),null!=u&&(n=r.relative(u,n)),this.setSourceContent(n,t))},this)},l.prototype._validateMapping=function(e,n,l,t){if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!l&&!t||e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&l))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:l,original:n,name:t}))},l.prototype._serializeMappings=function(){for(var e,n=0,l=1,a=0,u=0,o=0,s=0,i="",c=this._mappings.toArray(),p=0,d=c.length;d>p;p++){if(e=c[p],e.generatedLine!==l)for(n=0;e.generatedLine!==l;)i+=";",l++;else if(p>0){if(!r.compareByGeneratedPositions(e,c[p-1]))continue;i+=","}i+=t.encode(e.generatedColumn-n),n=e.generatedColumn,null!=e.source&&(i+=t.encode(this._sources.indexOf(e.source)-s),s=this._sources.indexOf(e.source),i+=t.encode(e.originalLine-1-u),u=e.originalLine-1,i+=t.encode(e.originalColumn-a),a=e.originalColumn,null!=e.name&&(i+=t.encode(this._names.indexOf(e.name)-o),o=this._names.indexOf(e.name)))}return i},l.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=r.relative(n,e));var l=r.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,l)?this._sourcesContents[l]:null},this)},l.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},l.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=l})},{"./array-set":334,"./base64-vlq":335,"./mapping-list":338,"./util":342,amdefine:343}],341:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e,n,l,t,r){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==l?null:l,this.name=null==r?null:r,this[o]=!0,null!=t&&this.add(t)}var t=e("./source-map-generator").SourceMapGenerator,r=e("./util"),a=/(\r?\n)/,u=10,o="$$$isSourceNode$$$";l.fromStringWithSourceMap=function(e,n,t){function u(e,n){if(null===e||void 0===e.source)o.add(n);else{var a=t?r.join(t,e.source):e.source;o.add(new l(e.originalLine,e.originalColumn,a,n,e.name))}}var o=new l,s=e.split(a),i=function(){var e=s.shift(),n=s.shift()||"";return e+n},c=1,p=0,d=null;return n.eachMapping(function(e){if(null!==d){if(!(c<e.generatedLine)){var n=s[0],l=n.substr(0,e.generatedColumn-p);return s[0]=n.substr(e.generatedColumn-p),p=e.generatedColumn,u(d,l),void(d=e)}var l="";u(d,i()),c++,p=0}for(;c<e.generatedLine;)o.add(i()),c++;if(p<e.generatedColumn){var n=s[0];o.add(n.substr(0,e.generatedColumn)),s[0]=n.substr(e.generatedColumn),p=e.generatedColumn}d=e},this),s.length>0&&(d&&u(d,i()),o.add(s.join(""))),n.sources.forEach(function(e){var l=n.sourceContentFor(e);null!=l&&(null!=t&&(e=r.join(t,e)),o.setSourceContent(e,l))}),o},l.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},l.prototype.prepend=function(e){if(Array.isArray(e))for(var n=e.length-1;n>=0;n--)this.prepend(e[n]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},l.prototype.walk=function(e){for(var n,l=0,t=this.children.length;t>l;l++)n=this.children[l],n[o]?n.walk(e):""!==n&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})},l.prototype.join=function(e){var n,l,t=this.children.length;if(t>0){for(n=[],l=0;t-1>l;l++)n.push(this.children[l]),n.push(e);n.push(this.children[l]),this.children=n}return this},l.prototype.replaceRight=function(e,n){var l=this.children[this.children.length-1];return l[o]?l.replaceRight(e,n):"string"==typeof l?this.children[this.children.length-1]=l.replace(e,n):this.children.push("".replace(e,n)),this},l.prototype.setSourceContent=function(e,n){this.sourceContents[r.toSetString(e)]=n},l.prototype.walkSourceContents=function(e){for(var n=0,l=this.children.length;l>n;n++)this.children[n][o]&&this.children[n].walkSourceContents(e);for(var t=Object.keys(this.sourceContents),n=0,l=t.length;l>n;n++)e(r.fromSetString(t[n]),this.sourceContents[t[n]])},l.prototype.toString=function(){var e="";return this.walk(function(n){e+=n}),e},l.prototype.toStringWithSourceMap=function(e){var n={code:"",line:1,column:0},l=new t(e),r=!1,a=null,o=null,s=null,i=null;return this.walk(function(e,t){n.code+=e,null!==t.source&&null!==t.line&&null!==t.column?((a!==t.source||o!==t.line||s!==t.column||i!==t.name)&&l.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name}),a=t.source,o=t.line,s=t.column,i=t.name,r=!0):r&&(l.addMapping({generated:{line:n.line,column:n.column}}),a=null,r=!1);for(var c=0,p=e.length;p>c;c++)e.charCodeAt(c)===u?(n.line++,n.column=0,c+1===p?(a=null,r=!1):r&&l.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name})):n.column++}),this.walkSourceContents(function(e,n){l.setSourceContent(e,n)}),{code:n.code,map:l}},n.SourceNode=l})},{"./source-map-generator":340,"./util":342,amdefine:343}],342:[function(e,n){if("function"!=typeof l)var l=e("amdefine")(n,e);l(function(e,n){function l(e,n,l){if(n in e)return e[n];if(3===arguments.length)return l;throw new Error('"'+n+'" is a required argument.')}function t(e){var n=e.match(f);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function r(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function a(e){var n=e,l=t(e);if(l){if(!l.path)return e;n=l.path}for(var a,u="/"===n.charAt(0),o=n.split(/\/+/),s=0,i=o.length-1;i>=0;i--)a=o[i],"."===a?o.splice(i,1):".."===a?s++:s>0&&(""===a?(o.splice(i+1,s),s=0):(o.splice(i,2),s--));return n=o.join("/"),""===n&&(n=u?"/":"."),l?(l.path=n,r(l)):n}function u(e,n){""===e&&(e="."),""===n&&(n=".");var l=t(n),u=t(e);if(u&&(e=u.path||"/"),l&&!l.scheme)return u&&(l.scheme=u.scheme),r(l);if(l||n.match(h))return n;if(u&&!u.host&&!u.path)return u.host=n,r(u);var o="/"===n.charAt(0)?n:a(e.replace(/\/+$/,"")+"/"+n);return u?(u.path=o,r(u)):o}function o(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");var l=t(e);return"/"==n.charAt(0)&&l&&"/"==l.path?n.slice(1):0===n.indexOf(e+"/")?n.substr(e.length+1):n}function s(e){return"$"+e}function i(e){return e.substr(1)}function c(e,n){var l=e||"",t=n||"";return(l>t)-(t>l)}function p(e,n,l){var t;return(t=c(e.source,n.source))?t:(t=e.originalLine-n.originalLine)?t:(t=e.originalColumn-n.originalColumn,t||l?t:(t=c(e.name,n.name))?t:(t=e.generatedLine-n.generatedLine,t?t:e.generatedColumn-n.generatedColumn))}function d(e,n,l){var t;return(t=e.generatedLine-n.generatedLine)?t:(t=e.generatedColumn-n.generatedColumn,t||l?t:(t=c(e.source,n.source))?t:(t=e.originalLine-n.originalLine)?t:(t=e.originalColumn-n.originalColumn,t?t:c(e.name,n.name)))}n.getArg=l;var f=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,h=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=r,n.normalize=a,n.join=u,n.relative=o,n.toSetString=s,n.fromSetString=i,n.compareByOriginalPositions=p,n.compareByGeneratedPositions=d})},{amdefine:343}],343:[function(e,n){(function(l,t){"use strict";function r(n,r){function a(e){var n,l;for(n=0;e[n];n+=1)if(l=e[n],"."===l)e.splice(n,1),n-=1;else if(".."===l){if(1===n&&(".."===e[2]||".."===e[0]))break;n>0&&(e.splice(n-1,2),n-=2)}}function u(e,n){var l;return e&&"."===e.charAt(0)&&n&&(l=n.split("/"),l=l.slice(0,l.length-1),l=l.concat(e.split("/")),a(l),e=l.join("/")),e}function o(e){return function(n){return u(n,e)}}function s(e){function n(n){h[e]=n}return n.fromText=function(){throw new Error("amdefine does not implement load.fromText")},n}function i(e,l,a){var u,o,s,i;if(e)o=h[e]={},s={id:e,uri:t,exports:o},u=p(r,o,s,e);else{if(g)throw new Error("amdefine with no module ID cannot be called more than once per file.");g=!0,o=n.exports,s=n,u=p(r,o,s,n.id)}l&&(l=l.map(function(e){return u(e)})),i="function"==typeof a?a.apply(s.exports,l):a,void 0!==i&&(s.exports=i,e&&(h[e]=s.exports))}function c(e,n,l){Array.isArray(e)?(l=n,n=e,e=void 0):"string"!=typeof e&&(l=e,e=n=void 0),n&&!Array.isArray(n)&&(l=n,n=void 0),n||(n=["require","exports","module"]),e?f[e]=[e,n,l]:i(e,n,l)}var p,d,f={},h={},g=!1,m=e("path");return p=function(e,n,t,r){function a(a,u){return"string"==typeof a?d(e,n,t,a,r):(a=a.map(function(l){return d(e,n,t,l,r)}),void l.nextTick(function(){u.apply(null,a)}))}return a.toUrl=function(e){return 0===e.indexOf(".")?u(e,m.dirname(t.filename)):e},a},r=r||function(){return n.require.apply(n,arguments)},d=function(e,n,l,t,r){var a,c,g=t.indexOf("!"),m=t;if(-1===g){if(t=u(t,r),"require"===t)return p(e,n,l,r);if("exports"===t)return n;if("module"===t)return l;if(h.hasOwnProperty(t))return h[t];if(f[t])return i.apply(null,f[t]),h[t];if(e)return e(m);throw new Error("No module with ID: "+t)}return a=t.substring(0,g),t=t.substring(g+1,t.length),c=d(e,n,l,a,r),t=c.normalize?c.normalize(t,o(r)):u(t,r),h[t]?h[t]:(c.load(t,p(e,n,l,r),s(t),{}),h[t])},c.require=function(e){return h[e]?h[e]:f[e]?(i.apply(null,f[e]),h[e]):void 0},c.amd={},c}n.exports=r}).call(this,e("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:151,path:150}],344:[function(e,n,l){"use strict";n.exports=function t(e){function n(){}return n.prototype=e,n}},{}],345:[function(e,n){"use strict";n.exports=function(e){return e.replace(/[\s\uFEFF\xA0]+$/g,"")}},{}],346:[function(e,n){n.exports={name:"babel",description:"Turn ES6 code into readable vanilla ES5 with source maps",version:"4.7.0",author:"Sebastian McKenzie <[email protected]>",homepage:"https://babeljs.io/",repository:"babel/babel",preferGlobal:!0,main:"lib/babel/api/node.js",browser:{"./lib/babel/api/register/node.js":"./lib/babel/api/register/browser.js"},bin:{"6to5":"./bin/deprecated/6to5","6to5-node":"./bin/deprecated/6to5-node","6to5-runtime":"./bin/deprecated/6to5-runtime",babel:"./bin/babel/index.js","babel-node":"./bin/babel-node","babel-external-helpers":"./bin/babel-external-helpers"},keywords:["harmony","classes","modules","let","const","var","es6","transpile","transpiler","6to5","babel"],scripts:{bench:"make bench",test:"make test"},dependencies:{"acorn-babel":"0.11.1-37","ast-types":"~0.7.0",chalk:"^1.0.0",chokidar:"^0.12.6",commander:"^2.6.0","convert-source-map":"^0.5.0","core-js":"^0.6.1",debug:"^2.1.1","detect-indent":"^3.0.0",estraverse:"^1.9.1",esutils:"^1.1.6","fs-readdir-recursive":"^0.1.0",globals:"^6.2.0","is-integer":"^1.0.4","js-tokens":"1.0.0",leven:"^1.0.1","line-numbers":"0.2.0",lodash:"^3.2.0","output-file-sync":"^1.1.0","path-is-absolute":"^1.0.0","private":"^0.1.6","regenerator-babel":"0.8.13-2",regexpu:"^1.1.2",repeating:"^1.1.2","shebang-regex":"^1.0.0",slash:"^1.0.0","source-map":"^0.4.0","source-map-support":"^0.2.9","to-fast-properties":"^1.0.0","trim-right":"^1.0.0"},devDependencies:{babel:"4.6.0",browserify:"^9.0.3",chai:"^2.0.0",eslint:"^0.15.1","babel-eslint":"^1.0.1",esvalid:"^1.1.0",istanbul:"^0.3.5",matcha:"^0.6.0",mocha:"^2.1.0",rimraf:"^2.2.8","uglify-js":"^2.4.16"}}},{}],347:[function(e,n){n.exports={"abstract-expression-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"abstract-expression-delete":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceDelete",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"abstract-expression-get":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"abstract-expression-set":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceSet",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"apply-constructor":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"||",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"array-comprehension-container":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"array-from":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"array-push":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STATEMENT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"async-to-generator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},{type:"Literal",start:null,end:null,loc:null,range:null,value:"next",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callThrow",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},{type:"Literal",start:null,end:null,loc:null,range:null,value:"throw",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"FunctionDeclaration",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arg",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"TryStatement",start:null,end:null,loc:null,range:null,block:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arg",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},handler:{type:"CatchClause",start:null,end:null,loc:null,range:null,param:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"error",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},guard:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"error",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},guardedHandlers:[],finalizer:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"then",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callThrow",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},bind:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Function",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},call:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CONTEXT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"class-call-check":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:!0,argument:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"instanceof",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Literal",start:null,end:null,loc:null,range:null,value:"Cannot call a class as a function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"class-super-constructor-call-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"class-super-constructor-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"corejs-is-iterator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CORE_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"$for",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isIterable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"corejs-iterator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CORE_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"$for",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getIterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"create-class":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"FunctionDeclaration",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"props",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"props",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prop",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"props",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prop",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prop",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prop",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"props",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"protoProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"protoProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"protoProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"default-parameter":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"DEFAULT_VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"let",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},defaults:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyNames",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"<",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:!1,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyDescriptor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"define-property":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"exports-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"exports-default-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"exports-module-declaration-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"exports-module-declaration":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Literal",start:null,end:null,loc:null,range:null,value:"__esModule",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"extends":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"assign",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"||",right:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:1,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"<",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:!1,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"for-of-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:null,update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:">=",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:!1,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"for-of":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_COMPLETION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:!1,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"TryStatement",start:null,end:null,loc:null,range:null,block:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:!0,argument:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_COMPLETION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_COMPLETION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},handler:{type:"CatchClause",start:null,end:null,loc:null,range:null,param:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"err",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},guard:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"err",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},guardedHandlers:[],finalizer:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"TryStatement",start:null,end:null,loc:null,range:null,block:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_COMPLETION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"return",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"return",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},handler:null,guardedHandlers:[],finalizer:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_HAD_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_ERROR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},get:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyDescriptor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"value",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},operator:"in",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"has-own":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},inherits:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"Super expression must either be null or a function, not ",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},operator:"+",right:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!1,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__proto__",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"interop-require-wildcard":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Literal",start:null,end:null,loc:null,range:null,value:"default",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"interop-require":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"default",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"let-scoping-return":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"v",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"named-function":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"FunctionDeclaration",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"GET_OUTER_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"object-destructuring-empty":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Literal",start:null,end:null,loc:null,range:null,value:"Cannot destructure undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"object-without-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"indexOf",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:">=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:!0,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"property-method-assignment-wrapper-generator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!0,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"YieldExpression",start:null,end:null,loc:null,range:null,delegate:!0,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"property-method-assignment-wrapper":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"prototype-identifier":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"prototype-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"require-assign-key":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},require:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},rest:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_LEN",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"START",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"<",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:!1,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"self-contained-helpers-head":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"helpers",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Literal",start:null,end:null,loc:null,range:null,value:"default",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"self-global":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"self",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},set:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"set",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyDescriptor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"set",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"value",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},operator:"in",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"set",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"!==",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setter",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},slice:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"slice",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"sliced-to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"in",right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:!0,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Literal",start:null,end:null,loc:null,range:null,value:"Invalid attempt to destructure non-iterable instance",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},system:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"System",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"register",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_DEPENDENCIES",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXPORT_IDENTIFIER",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setters",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SETTERS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"execute",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXECUTE",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"tagged-template-literal-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"tagged-template-literal":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:!1,shorthand:!1,computed:!1,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},value:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},kind:"init",_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"tail-call-body":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"AGAIN_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"LabeledStatement",start:null,end:null,loc:null,range:null,body:{type:"WhileStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"AGAIN_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},body:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"BLOCK",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},label:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"temporal-assert-defined":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"val",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"name",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undef",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"val",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undef",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ReferenceError",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"name",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"+",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:" is not defined - temporal dead zone",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Literal",start:null,end:null,loc:null,range:null,value:!0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"temporal-undefined":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"test-exports":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"test-module":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"to-consumable-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr2",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"<",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:!1,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr2",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!0,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr2",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"typeof":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Literal",start:null,end:null,loc:null,range:null,value:"symbol",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},alternate:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},"umd-runner-body":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:!1,expression:!1,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:!0,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"amd",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},computed:!1,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"AMD_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_TEST",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}],_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},alternate:null,_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,_paths:null,tokens:null,raw:null},_scopeInfo:null,_paths:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_paths:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,_paths:null,tokens:null,raw:null}}
},{}]},{},[1])(1)}); |
ajax/libs/6to5/1.11.15/browser.js | Nadeermalangadan/cdnjs | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.to5=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(root,mod){if(typeof exports=="object"&&typeof module=="object")return mod(exports);if(typeof define=="function"&&define.amd)return define(["exports"],mod);mod(root.acorn||(root.acorn={}))})(this,function(exports){"use strict";exports.version="0.9.1";var options,input,inputLen,sourceFile;exports.parse=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();initParserState();return parseTopLevel(options.program)};var defaultOptions=exports.defaultOptions={ecmaVersion:5,strictSemicolons:false,allowTrailingCommas:true,forbidReserved:false,allowReturnOutsideFunction:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};exports.parseExpressionAt=function(inpt,pos,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState(pos);initParserState();return parseExpression()};var isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};function setOptions(opts){options=opts||{};for(var opt in defaultOptions)if(!has(options,opt))options[opt]=defaultOptions[opt];sourceFile=options.sourceFile||null;if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){tokens.push(token)}}if(isArray(options.onComment)){var comments=options.onComment;options.onComment=function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};if(options.locations){comment.loc=new SourceLocation;comment.loc.start=startLoc;comment.loc.end=endLoc}if(options.ranges)comment.range=[start,end];comments.push(comment)}}if(options.strictMode){strict=true}if(options.ecmaVersion>=7){isKeyword=isEcma7Keyword}else if(options.ecmaVersion===6){isKeyword=isEcma6Keyword}else{isKeyword=isEcma5AndLessKeyword}}var getLineInfo=exports.getLineInfo=function(input,offset){for(var line=1,cur=0;;){lineBreak.lastIndex=cur;var match=lineBreak.exec(input);if(match&&match.index<offset){++line;cur=match.index+match[0].length}else break}return{line:line,column:offset-cur}};function Token(){this.type=tokType;this.value=tokVal;this.start=tokStart;this.end=tokEnd;if(options.locations){this.loc=new SourceLocation;this.loc.end=tokEndLoc;this.startLoc=tokStartLoc;this.endLoc=tokEndLoc}if(options.ranges)this.range=[tokStart,tokEnd]}exports.Token=Token;exports.tokenize=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();function getToken(forceRegexp){lastEnd=tokEnd;readToken(forceRegexp);return new Token}getToken.jumpTo=function(pos,reAllowed){tokPos=pos;if(options.locations){tokCurLine=1;tokLineStart=lineBreak.lastIndex=0;var match;while((match=lineBreak.exec(input))&&match.index<pos){++tokCurLine;tokLineStart=match.index+match[0].length}}tokRegexpAllowed=reAllowed;skipSpace()};return getToken};var tokPos;var tokStart,tokEnd;var tokStartLoc,tokEndLoc;var tokType,tokVal;var tokRegexpAllowed;var tokCurLine,tokLineStart;var lastStart,lastEnd,lastEndLoc;var inFunction,inGenerator,inAsync,labels,strict,inXJSChild,inXJSTag,inXJSChildExpression;var metParenL;var inTemplate;function initParserState(){lastStart=lastEnd=tokPos;if(options.locations)lastEndLoc=new Position;inFunction=inGenerator=inAsync=strict=false;labels=[];readToken()}function raise(pos,message){var loc=getLineInfo(input,pos);message+=" ("+loc.line+":"+loc.column+")";var err=new SyntaxError(message);err.pos=pos;err.loc=loc;err.raisedAt=tokPos;throw err}var empty=[];var _num={type:"num"},_regexp={type:"regexp"},_string={type:"string"};var _name={type:"name"},_eof={type:"eof"};var _xjsName={type:"xjsName"},_xjsText={type:"xjsText"};var _break={keyword:"break"},_case={keyword:"case",beforeExpr:true},_catch={keyword:"catch"};var _continue={keyword:"continue"},_debugger={keyword:"debugger"},_default={keyword:"default"};var _do={keyword:"do",isLoop:true},_else={keyword:"else",beforeExpr:true};var _finally={keyword:"finally"},_for={keyword:"for",isLoop:true},_function={keyword:"function"};var _if={keyword:"if"},_return={keyword:"return",beforeExpr:true},_switch={keyword:"switch"};var _throw={keyword:"throw",beforeExpr:true},_try={keyword:"try"},_var={keyword:"var"};var _let={keyword:"let"},_const={keyword:"const"};var _while={keyword:"while",isLoop:true},_with={keyword:"with"},_new={keyword:"new",beforeExpr:true};var _this={keyword:"this"};var _class={keyword:"class"},_extends={keyword:"extends",beforeExpr:true};var _export={keyword:"export"},_import={keyword:"import"};var _yield={keyword:"yield",beforeExpr:true};var _async={keyword:"async"},_await={keyword:"await",beforeExpr:true};var _null={keyword:"null",atomValue:null},_true={keyword:"true",atomValue:true};var _false={keyword:"false",atomValue:false};var _in={keyword:"in",binop:7,beforeExpr:true};var keywordTypes={"break":_break,"case":_case,"catch":_catch,"continue":_continue,"debugger":_debugger,"default":_default,"do":_do,"else":_else,"finally":_finally,"for":_for,"function":_function,"if":_if,"return":_return,"switch":_switch,"throw":_throw,"try":_try,"var":_var,let:_let,"const":_const,"while":_while,"with":_with,"null":_null,"true":_true,"false":_false,"new":_new,"in":_in,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:true},"this":_this,"typeof":{keyword:"typeof",prefix:true,beforeExpr:true},"void":{keyword:"void",prefix:true,beforeExpr:true},"delete":{keyword:"delete",prefix:true,beforeExpr:true},"class":_class,"extends":_extends,"export":_export,"import":_import,"yield":_yield,await:_await,async:_async};var _bracketL={type:"[",beforeExpr:true},_bracketR={type:"]"},_braceL={type:"{",beforeExpr:true};var _braceR={type:"}"},_parenL={type:"(",beforeExpr:true},_parenR={type:")"};var _comma={type:",",beforeExpr:true},_semi={type:";",beforeExpr:true};var _colon={type:":",beforeExpr:true},_dot={type:"."},_ellipsis={type:"..."},_question={type:"?",beforeExpr:true};var _arrow={type:"=>",beforeExpr:true},_bquote={type:"`"},_dollarBraceL={type:"${",beforeExpr:true};var _ltSlash={type:"</"};var _slash={binop:10,beforeExpr:true},_eq={isAssign:true,beforeExpr:true};var _assign={isAssign:true,beforeExpr:true};var _incDec={postfix:true,prefix:true,isUpdate:true},_prefix={prefix:true,beforeExpr:true};var _logicalOR={binop:1,beforeExpr:true};var _logicalAND={binop:2,beforeExpr:true};var _bitwiseOR={binop:3,beforeExpr:true};var _bitwiseXOR={binop:4,beforeExpr:true};var _bitwiseAND={binop:5,beforeExpr:true};var _equality={binop:6,beforeExpr:true};var _relational={binop:7,beforeExpr:true};var _bitShift={binop:8,beforeExpr:true};var _plusMin={binop:9,prefix:true,beforeExpr:true};var _modulo={binop:10,beforeExpr:true};var _star={binop:10,beforeExpr:true};var _lt={binop:7,beforeExpr:true},_gt={binop:7,beforeExpr:true};exports.tokTypes={bracketL:_bracketL,bracketR:_bracketR,braceL:_braceL,braceR:_braceR,parenL:_parenL,parenR:_parenR,comma:_comma,semi:_semi,colon:_colon,dot:_dot,ellipsis:_ellipsis,question:_question,slash:_slash,eq:_eq,name:_name,eof:_eof,num:_num,regexp:_regexp,string:_string,arrow:_arrow,bquote:_bquote,dollarBraceL:_dollarBraceL,xjsName:_xjsName,xjsText:_xjsText};for(var kw in keywordTypes)exports.tokTypes["_"+kw]=keywordTypes[kw];function makePredicate(words){words=words.split(" ");var f="",cats=[];out:for(var i=0;i<words.length;++i){for(var j=0;j<cats.length;++j)if(cats[j][0].length==words[i].length){cats[j].push(words[i]);continue out}cats.push([words[i]])}function compareTo(arr){if(arr.length==1)return f+="return str === "+JSON.stringify(arr[0])+";";f+="switch(str){";for(var i=0;i<arr.length;++i)f+="case "+JSON.stringify(arr[i])+":";f+="return true}return false;"}if(cats.length>3){cats.sort(function(a,b){return b.length-a.length});f+="switch(str.length){";for(var i=0;i<cats.length;++i){var cat=cats[i];f+="case "+cat[0].length+":";compareTo(cat)}f+="}"}else{compareTo(words)}return new Function("str",f)}var isReservedWord3=makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile");var isReservedWord5=makePredicate("class enum extends super const export import");var isStrictReservedWord=makePredicate("implements interface let package private protected public static yield");var isStrictBadIdWord=makePredicate("eval arguments");var ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var isEcma5AndLessKeyword=makePredicate(ecma5AndLessKeywords);var ecma6AndLessKeywords=ecma5AndLessKeywords+" let const class extends export import yield";var isEcma6Keyword=makePredicate(ecma6AndLessKeywords);var isEcma7Keyword=makePredicate(ecma6AndLessKeywords+" async await");var isKeyword=isEcma5AndLessKeyword;var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var nonASCIIidentifierChars="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]");var nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");var newline=/[\n\r\u2028\u2029]/;var lineBreak=/\r\n|[\n\r\u2028\u2029]/g;var isIdentifierStart=exports.isIdentifierStart=function(code){if(code<65)return code===36;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code))};var isIdentifierChar=exports.isIdentifierChar=function(code){if(code<48)return code===36;if(code<58)return true;if(code<65)return false;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code))};function Position(){this.line=tokCurLine;this.column=tokPos-tokLineStart}function initTokenState(pos){if(pos){tokPos=pos;tokLineStart=Math.max(0,input.lastIndexOf("\n",pos));tokCurLine=input.slice(0,tokLineStart).split(newline).length}else{tokCurLine=1;tokPos=tokLineStart=0}tokRegexpAllowed=true;metParenL=0;inTemplate=inXJSChild=inXJSTag=false;skipSpace()}function finishToken(type,val,shouldSkipSpace){tokEnd=tokPos;if(options.locations)tokEndLoc=new Position;tokType=type;if(shouldSkipSpace!==false&&!(inXJSChild&&tokType!==_braceL)){skipSpace()}tokVal=val;tokRegexpAllowed=type.beforeExpr;if(options.onToken){options.onToken(new Token)}}function skipBlockComment(){var startLoc=options.onComment&&options.locations&&new Position;var start=tokPos,end=input.indexOf("*/",tokPos+=2);if(end===-1)raise(tokPos-2,"Unterminated comment");tokPos=end+2;if(options.locations){lineBreak.lastIndex=start;var match;while((match=lineBreak.exec(input))&&match.index<tokPos){++tokCurLine;tokLineStart=match.index+match[0].length}}if(options.onComment)options.onComment(true,input.slice(start+2,end),start,tokPos,startLoc,options.locations&&new Position)}function skipLineComment(startSkip){var start=tokPos;var startLoc=options.onComment&&options.locations&&new Position;var ch=input.charCodeAt(tokPos+=startSkip);while(tokPos<inputLen&&ch!==10&&ch!==13&&ch!==8232&&ch!==8233){++tokPos;ch=input.charCodeAt(tokPos)}if(options.onComment)options.onComment(false,input.slice(start+startSkip,tokPos),start,tokPos,startLoc,options.locations&&new Position)}function skipSpace(){while(tokPos<inputLen){var ch=input.charCodeAt(tokPos);if(ch===32){++tokPos}else if(ch===13){++tokPos;var next=input.charCodeAt(tokPos);if(next===10){++tokPos}if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch===10||ch===8232||ch===8233){++tokPos;if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch>8&&ch<14){++tokPos}else if(ch===47){var next=input.charCodeAt(tokPos+1);if(next===42){skipBlockComment()}else if(next===47){skipLineComment(2)}else break}else if(ch===160){++tokPos}else if(ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))){++tokPos}else{break}}}function readToken_dot(){var next=input.charCodeAt(tokPos+1);if(next>=48&&next<=57)return readNumber(true);var next2=input.charCodeAt(tokPos+2);if(options.ecmaVersion>=6&&next===46&&next2===46){tokPos+=3;return finishToken(_ellipsis)}else{++tokPos;return finishToken(_dot)}}function readToken_slash(){var next=input.charCodeAt(tokPos+1);if(tokRegexpAllowed){++tokPos;return readRegexp()}if(next===61)return finishOp(_assign,2);return finishOp(_slash,1)}function readToken_mult_modulo(code){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(code===42?_star:_modulo,1)}function readToken_pipe_amp(code){var next=input.charCodeAt(tokPos+1);if(next===code)return finishOp(code===124?_logicalOR:_logicalAND,2);if(next===61)return finishOp(_assign,2);return finishOp(code===124?_bitwiseOR:_bitwiseAND,1)}function readToken_caret(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_bitwiseXOR,1)}function readToken_plus_min(code){var next=input.charCodeAt(tokPos+1);if(next===code){if(next==45&&input.charCodeAt(tokPos+2)==62&&newline.test(input.slice(lastEnd,tokPos))){skipLineComment(3);skipSpace();return readToken()}return finishOp(_incDec,2)}if(next===61)return finishOp(_assign,2);return finishOp(_plusMin,1)}function readToken_lt_gt(code){var next=input.charCodeAt(tokPos+1);var size=1;if(next===code){size=code===62&&input.charCodeAt(tokPos+2)===62?3:2;if(input.charCodeAt(tokPos+size)===61)return finishOp(_assign,size+1);return finishOp(_bitShift,size)}if(next==33&&code==60&&input.charCodeAt(tokPos+2)==45&&input.charCodeAt(tokPos+3)==45){skipLineComment(4);skipSpace();return readToken()}if(next===61){size=input.charCodeAt(tokPos+2)===61?3:2;return finishOp(_relational,size)}if(next===47){size=2;return finishOp(_ltSlash,size)}return code===60?finishOp(_lt,size):finishOp(_gt,size,!inXJSTag)}function readToken_eq_excl(code){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_equality,input.charCodeAt(tokPos+2)===61?3:2);if(code===61&&next===62&&options.ecmaVersion>=6){tokPos+=2;return finishToken(_arrow)}return finishOp(code===61?_eq:_prefix,1)}function getTemplateToken(code){if(tokType===_string){if(code===96){++tokPos;return finishToken(_bquote)}else if(code===36&&input.charCodeAt(tokPos+1)===123){tokPos+=2;return finishToken(_dollarBraceL)}}if(code===125){++tokPos;return finishToken(_braceR,undefined,false)}return readTmplString()}function getTokenFromCode(code){switch(code){case 46:return readToken_dot();case 40:++tokPos;return finishToken(_parenL);case 41:++tokPos;return finishToken(_parenR);case 59:++tokPos;return finishToken(_semi);case 44:++tokPos;return finishToken(_comma);case 91:++tokPos;return finishToken(_bracketL);case 93:++tokPos;return finishToken(_bracketR);case 123:++tokPos;return finishToken(_braceL);case 125:++tokPos;return finishToken(_braceR,undefined,!inXJSChildExpression);case 58:++tokPos;return finishToken(_colon);case 63:++tokPos;return finishToken(_question);case 96:if(options.ecmaVersion>=6){++tokPos;return finishToken(_bquote,undefined,false)}case 48:var next=input.charCodeAt(tokPos+1);if(next===120||next===88)return readRadixNumber(16);if(options.ecmaVersion>=6){if(next===111||next===79)return readRadixNumber(8);if(next===98||next===66)return readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(false);case 34:case 39:return inXJSTag?readXJSStringLiteral():readString(code);case 47:return readToken_slash();case 37:case 42:return readToken_mult_modulo(code);case 124:case 38:return readToken_pipe_amp(code);case 94:return readToken_caret();case 43:case 45:return readToken_plus_min(code);case 60:case 62:return readToken_lt_gt(code);case 61:case 33:return readToken_eq_excl(code);case 126:return finishOp(_prefix,1)}return false}function readToken(forceRegexp){if(!forceRegexp)tokStart=tokPos;else tokPos=tokStart+1;if(options.locations)tokStartLoc=new Position;if(forceRegexp)return readRegexp();if(tokPos>=inputLen)return finishToken(_eof);var code=input.charCodeAt(tokPos);if(inXJSChild&&tokType!==_braceL&&code!==60&&code!==123&&code!==125){return readXJSText(["<","{"])}if(inTemplate)return getTemplateToken(code);if(isIdentifierStart(code)||code===92)return readWord();var tok=getTokenFromCode(code);if(tok===false){var ch=String.fromCharCode(code);if(ch==="\\"||nonASCIIidentifierStart.test(ch))return readWord();raise(tokPos,"Unexpected character '"+ch+"'")}return tok}function finishOp(type,size,shouldSkipSpace){var str=input.slice(tokPos,tokPos+size);tokPos+=size;finishToken(type,str,shouldSkipSpace)}var regexpUnicodeSupport=false;try{new RegExp("","u");regexpUnicodeSupport=true}catch(e){}function readRegexp(){var content="",escaped,inClass,start=tokPos;for(;;){if(tokPos>=inputLen)raise(start,"Unterminated regular expression");var ch=nextChar();if(newline.test(ch))raise(start,"Unterminated regular expression");if(!escaped){if(ch==="[")inClass=true;else if(ch==="]"&&inClass)inClass=false;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}else escaped=false;++tokPos}var content=input.slice(start,tokPos);++tokPos;var mods=readWord1();var tmp=content;if(mods){var validFlags=/^[gmsiy]*$/;if(options.ecmaVersion>=6)validFlags=/^[gmsiyu]*$/;if(!validFlags.test(mods))raise(start,"Invalid regular expression flag");if(mods.indexOf("u")>=0&&!regexpUnicodeSupport){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(tmp)}catch(e){if(e instanceof SyntaxError)raise(start,"Error parsing regular expression: "+e.message);raise(e)}try{var value=new RegExp(content,mods)}catch(err){value=null}return finishToken(_regexp,{pattern:content,flags:mods,value:value})}function readInt(radix,len){var start=tokPos,total=0;for(var i=0,e=len==null?Infinity:len;i<e;++i){var code=input.charCodeAt(tokPos),val;if(code>=97)val=code-97+10;else if(code>=65)val=code-65+10;else if(code>=48&&code<=57)val=code-48;else val=Infinity;if(val>=radix)break;++tokPos;total=total*radix+val}if(tokPos===start||len!=null&&tokPos-start!==len)return null;return total}function readRadixNumber(radix){tokPos+=2;var val=readInt(radix);if(val==null)raise(tokStart+2,"Expected number in radix "+radix);if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");return finishToken(_num,val)}function readNumber(startsWithDot){var start=tokPos,isFloat=false,octal=input.charCodeAt(tokPos)===48;if(!startsWithDot&&readInt(10)===null)raise(start,"Invalid number");if(input.charCodeAt(tokPos)===46){++tokPos;readInt(10);isFloat=true}var next=input.charCodeAt(tokPos);if(next===69||next===101){next=input.charCodeAt(++tokPos);if(next===43||next===45)++tokPos;if(readInt(10)===null)raise(start,"Invalid number");isFloat=true}if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");var str=input.slice(start,tokPos),val;if(isFloat)val=parseFloat(str);else if(!octal||str.length===1)val=parseInt(str,10);else if(/[89]/.test(str)||strict)raise(start,"Invalid number");else val=parseInt(str,8);return finishToken(_num,val)}function readCodePoint(){var ch=input.charCodeAt(tokPos),code;if(ch===123){if(options.ecmaVersion<6)unexpected();++tokPos;code=readHexChar(input.indexOf("}",tokPos)-tokPos);++tokPos;if(code>1114111)unexpected()}else{code=readHexChar(4)}if(code<=65535){return String.fromCharCode(code)}var cu1=(code-65536>>10)+55296;var cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function readString(quote){++tokPos;var out="";for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated string constant");var ch=input.charCodeAt(tokPos);if(ch===quote){++tokPos;return finishToken(_string,out)}if(ch===92){out+=readEscapedChar()}else{++tokPos;if(newline.test(String.fromCharCode(ch))){raise(tokStart,"Unterminated string constant")}out+=String.fromCharCode(ch)}}}function readTmplString(){var out="";for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated string constant");var ch=input.charCodeAt(tokPos);if(ch===96||ch===36&&input.charCodeAt(tokPos+1)===123)return finishToken(_string,out);if(ch===92){out+=readEscapedChar()}else{++tokPos;if(newline.test(String.fromCharCode(ch))){if(ch===13&&input.charCodeAt(tokPos)===10){++tokPos;ch=10}if(options.locations){++tokCurLine;tokLineStart=tokPos}}out+=String.fromCharCode(ch)}}}function readEscapedChar(){var ch=input.charCodeAt(++tokPos);var octal=/^[0-7]+/.exec(input.slice(tokPos,tokPos+3));if(octal)octal=octal[0];while(octal&&parseInt(octal,8)>255)octal=octal.slice(0,-1);if(octal==="0")octal=null;++tokPos;if(octal){if(strict)raise(tokPos-2,"Octal literal in strict mode");tokPos+=octal.length-1;return String.fromCharCode(parseInt(octal,8))}else{switch(ch){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(readHexChar(2));case 117:return readCodePoint();case 116:return" ";case 98:return"\b";case 118:return"";case 102:return"\f";case 48:return"\x00";case 13:if(input.charCodeAt(tokPos)===10)++tokPos;case 10:if(options.locations){tokLineStart=tokPos;++tokCurLine}return"";default:return String.fromCharCode(ch)}}}var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function readXJSEntity(){var str="",count=0,entity;var ch=nextChar();if(ch!=="&")raise(tokPos,"Entity must start with an ampersand");tokPos++;while(tokPos<inputLen&&count++<10){ch=nextChar();tokPos++;if(ch===";"){break}str+=ch}if(str[0]==="#"&&str[1]==="x"){entity=String.fromCharCode(parseInt(str.substr(2),16))}else if(str[0]==="#"){entity=String.fromCharCode(parseInt(str.substr(1),10))}else{entity=XHTMLEntities[str]}return entity}function readXJSText(stopChars){var str="";while(tokPos<inputLen){var ch=nextChar();if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=readXJSEntity()}else{++tokPos;if(ch==="\r"&&nextChar()==="\n"){str+=ch;++tokPos;ch="\n"}if(ch==="\n"&&options.locations){tokLineStart=tokPos;++tokCurLine}str+=ch}}return finishToken(_xjsText,str)}function readXJSStringLiteral(){var quote=input.charCodeAt(tokPos);if(quote!==34&"e!==39){raise("String literal must starts with a quote")}++tokPos;readXJSText([String.fromCharCode(quote)]);if(quote!==input.charCodeAt(tokPos)){unexpected()}++tokPos;return finishToken(tokType,tokVal)}function readHexChar(len){var n=readInt(16,len);if(n===null)raise(tokStart,"Bad character escape sequence");return n}var containsEsc;function readWord1(){containsEsc=false;var word,first=true,start=tokPos;for(;;){var ch=input.charCodeAt(tokPos);if(isIdentifierChar(ch)||inXJSTag&&ch===45){if(containsEsc)word+=nextChar();++tokPos}else if(ch===92&&!inXJSTag){if(!containsEsc)word=input.slice(start,tokPos);containsEsc=true;if(input.charCodeAt(++tokPos)!=117)raise(tokPos,"Expecting Unicode escape sequence \\uXXXX");++tokPos;var esc=readHexChar(4);var escStr=String.fromCharCode(esc);if(!escStr)raise(tokPos-1,"Invalid Unicode escape");if(!(first?isIdentifierStart(esc):isIdentifierChar(esc)))raise(tokPos-4,"Invalid Unicode escape");word+=escStr}else{break}first=false}return containsEsc?word:input.slice(start,tokPos)}function readWord(){var word=readWord1();var type=inXJSTag?_xjsName:_name;if(!containsEsc&&isKeyword(word))type=keywordTypes[word];return finishToken(type,word)}function next(){lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;readToken()}function setStrict(strct){strict=strct;tokPos=tokStart;if(options.locations){while(tokPos<tokLineStart){tokLineStart=input.lastIndexOf("\n",tokLineStart-2)+1;--tokCurLine}}skipSpace();readToken()}function Node(){this.type=null;this.start=tokStart;this.end=null}exports.Node=Node;function SourceLocation(){this.start=tokStartLoc;this.end=null;if(sourceFile!==null)this.source=sourceFile}function startNode(){var node=new Node;if(options.locations)node.loc=new SourceLocation;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[tokStart,0];return node}function storeCurrentPos(){return options.locations?[tokStart,tokStartLoc]:tokStart}function startNodeAt(pos){var node=new Node,start=pos;if(options.locations){node.loc=new SourceLocation;node.loc.start=start[1];start=pos[0]}node.start=start;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[start,0];return node}function finishNode(node,type){node.type=type;node.end=lastEnd;if(options.locations)node.loc.end=lastEndLoc;if(options.ranges)node.range[1]=lastEnd;return node}function isUseStrict(stmt){return options.ecmaVersion>=5&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="Literal"&&stmt.expression.value==="use strict"}function eat(type){if(tokType===type){next();return true}else{return false}}function canInsertSemicolon(){return!options.strictSemicolons&&(tokType===_eof||tokType===_braceR||newline.test(input.slice(lastEnd,tokStart)))}function semicolon(){if(!eat(_semi)&&!canInsertSemicolon())unexpected()}function expect(type){eat(type)||unexpected()}function nextChar(){return input.charAt(tokPos)}function unexpected(pos){raise(pos!=null?pos:tokStart,"Unexpected token")}function has(obj,propName){return Object.prototype.hasOwnProperty.call(obj,propName)}function toAssignable(node,allowSpread,checkType){if(options.ecmaVersion>=6&&node){switch(node.type){case"Identifier":case"MemberExpression":break;case"ObjectExpression":node.type="ObjectPattern";for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];if(prop.kind!=="init")unexpected(prop.key.start);toAssignable(prop.value,false,checkType)}break;case"ArrayExpression":node.type="ArrayPattern";for(var i=0,lastI=node.elements.length-1;i<=lastI;i++){toAssignable(node.elements[i],i===lastI,checkType)}break;case"SpreadElement":if(allowSpread){toAssignable(node.argument,false,checkType);checkSpreadAssign(node.argument)}else{unexpected(node.start)}break;default:if(checkType)unexpected(node.start)}}return node}function checkSpreadAssign(node){if(node.type!=="Identifier"&&node.type!=="ArrayPattern")unexpected(node.start)}function checkFunctionParam(param,nameHash){switch(param.type){case"Identifier":if(isStrictReservedWord(param.name)||isStrictBadIdWord(param.name))raise(param.start,"Defining '"+param.name+"' in strict mode");if(has(nameHash,param.name))raise(param.start,"Argument name clash in strict mode");nameHash[param.name]=true;break;case"ObjectPattern":for(var i=0;i<param.properties.length;i++)checkFunctionParam(param.properties[i].value,nameHash);break;case"ArrayPattern":for(var i=0;i<param.elements.length;i++){var elem=param.elements[i];if(elem)checkFunctionParam(elem,nameHash)}break}}function checkPropClash(prop,propHash){if(options.ecmaVersion>=6)return;var key=prop.key,name;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind||"init",other;if(has(propHash,name)){other=propHash[name];var isGetSet=kind!=="init";if((strict||isGetSet)&&other[kind]||!(isGetSet^other.init))raise(key.start,"Redefinition of property")}else{other=propHash[name]={init:false,get:false,set:false}}other[kind]=true}function checkLVal(expr,isBinding){switch(expr.type){case"Identifier":if(strict&&(isStrictBadIdWord(expr.name)||isStrictReservedWord(expr.name)))raise(expr.start,isBinding?"Binding "+expr.name+" in strict mode":"Assigning to "+expr.name+" in strict mode");break;case"MemberExpression":if(!isBinding)break;
case"ObjectPattern":for(var i=0;i<expr.properties.length;i++)checkLVal(expr.properties[i].value,isBinding);break;case"ArrayPattern":for(var i=0;i<expr.elements.length;i++){var elem=expr.elements[i];if(elem)checkLVal(elem,isBinding)}break;case"SpreadElement":break;default:raise(expr.start,"Assigning to rvalue")}}function parseTopLevel(program){var node=program||startNode(),first=true;if(!program)node.body=[];while(tokType!==_eof){var stmt=parseStatement();node.body.push(stmt);if(first&&isUseStrict(stmt))setStrict(true);first=false}return finishNode(node,"Program")}var loopLabel={kind:"loop"},switchLabel={kind:"switch"};function parseStatement(){if(tokType===_slash||tokType===_assign&&tokVal=="/=")readToken(true);var starttype=tokType,node=startNode();switch(starttype){case _break:case _continue:return parseBreakContinueStatement(node,starttype.keyword);case _debugger:return parseDebuggerStatement(node);case _do:return parseDoStatement(node);case _for:return parseForStatement(node);case _async:return parseAsync(node,true);case _function:return parseFunctionStatement(node);case _class:return parseClass(node,true);case _if:return parseIfStatement(node);case _return:return parseReturnStatement(node);case _switch:return parseSwitchStatement(node);case _throw:return parseThrowStatement(node);case _try:return parseTryStatement(node);case _var:case _let:case _const:return parseVarStatement(node,starttype.keyword);case _while:return parseWhileStatement(node);case _with:return parseWithStatement(node);case _braceL:return parseBlock();case _semi:return parseEmptyStatement(node);case _export:return parseExport(node);case _import:return parseImport(node);default:var maybeName=tokVal,expr=parseExpression();if(starttype===_name&&expr.type==="Identifier"&&eat(_colon))return parseLabeledStatement(node,maybeName,expr);else return parseExpressionStatement(node,expr)}}function parseBreakContinueStatement(node,keyword){var isBreak=keyword=="break";next();if(eat(_semi)||canInsertSemicolon())node.label=null;else if(tokType!==_name)unexpected();else{node.label=parseIdent();semicolon()}for(var i=0;i<labels.length;++i){var lab=labels[i];if(node.label==null||lab.name===node.label.name){if(lab.kind!=null&&(isBreak||lab.kind==="loop"))break;if(node.label&&isBreak)break}}if(i===labels.length)raise(node.start,"Unsyntactic "+keyword);return finishNode(node,isBreak?"BreakStatement":"ContinueStatement")}function parseDebuggerStatement(node){next();semicolon();return finishNode(node,"DebuggerStatement")}function parseDoStatement(node){next();labels.push(loopLabel);node.body=parseStatement();labels.pop();expect(_while);node.test=parseParenExpression();semicolon();return finishNode(node,"DoWhileStatement")}function parseForStatement(node){next();labels.push(loopLabel);expect(_parenL);if(tokType===_semi)return parseFor(node,null);if(tokType===_var||tokType===_let){var init=startNode(),varKind=tokType.keyword,isLet=tokType===_let;next();parseVar(init,true,varKind);finishNode(init,"VariableDeclaration");if((tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of")&&init.declarations.length===1&&!(isLet&&init.declarations[0].init))return parseForIn(node,init);return parseFor(node,init)}var init=parseExpression(false,true);if(tokType===_in||options.ecmaVersion>=6&&tokType===_name&&tokVal==="of"){checkLVal(init);return parseForIn(node,init)}return parseFor(node,init)}function parseFunctionStatement(node){next();return parseFunction(node,true,false)}function parseAsync(node,isStatement){if(options.ecmaVersion<7){unexpected()}next();switch(tokType){case _function:next();return parseFunction(node,isStatement,true);if(!isStatement)unexpected();case _name:var id=parseIdent(tokType!==_name);if(eat(_arrow)){return parseArrowExpression(node,[id],true)}case _parenL:var oldParenL=++metParenL;var exprList=[];next();if(tokType!==_parenR){var val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){return parseArrowExpression(node,exprList,true)}default:unexpected()}}function parseIfStatement(node){next();node.test=parseParenExpression();node.consequent=parseStatement();node.alternate=eat(_else)?parseStatement():null;return finishNode(node,"IfStatement")}function parseReturnStatement(node){if(!inFunction&&!options.allowReturnOutsideFunction)raise(tokStart,"'return' outside of function");next();if(eat(_semi)||canInsertSemicolon())node.argument=null;else{node.argument=parseExpression();semicolon()}return finishNode(node,"ReturnStatement")}function parseSwitchStatement(node){next();node.discriminant=parseParenExpression();node.cases=[];expect(_braceL);labels.push(switchLabel);for(var cur,sawDefault;tokType!=_braceR;){if(tokType===_case||tokType===_default){var isCase=tokType===_case;if(cur)finishNode(cur,"SwitchCase");node.cases.push(cur=startNode());cur.consequent=[];next();if(isCase)cur.test=parseExpression();else{if(sawDefault)raise(lastStart,"Multiple default clauses");sawDefault=true;cur.test=null}expect(_colon)}else{if(!cur)unexpected();cur.consequent.push(parseStatement())}}if(cur)finishNode(cur,"SwitchCase");next();labels.pop();return finishNode(node,"SwitchStatement")}function parseThrowStatement(node){next();if(newline.test(input.slice(lastEnd,tokStart)))raise(lastEnd,"Illegal newline after throw");node.argument=parseExpression();semicolon();return finishNode(node,"ThrowStatement")}function parseTryStatement(node){next();node.block=parseBlock();node.handler=null;if(tokType===_catch){var clause=startNode();next();expect(_parenL);clause.param=parseIdent();if(strict&&isStrictBadIdWord(clause.param.name))raise(clause.param.start,"Binding "+clause.param.name+" in strict mode");expect(_parenR);clause.guard=null;clause.body=parseBlock();node.handler=finishNode(clause,"CatchClause")}node.guardedHandlers=empty;node.finalizer=eat(_finally)?parseBlock():null;if(!node.handler&&!node.finalizer)raise(node.start,"Missing catch or finally clause");return finishNode(node,"TryStatement")}function parseVarStatement(node,kind){next();parseVar(node,false,kind);semicolon();return finishNode(node,"VariableDeclaration")}function parseWhileStatement(node){next();node.test=parseParenExpression();labels.push(loopLabel);node.body=parseStatement();labels.pop();return finishNode(node,"WhileStatement")}function parseWithStatement(node){if(strict)raise(tokStart,"'with' in strict mode");next();node.object=parseParenExpression();node.body=parseStatement();return finishNode(node,"WithStatement")}function parseEmptyStatement(node){next();return finishNode(node,"EmptyStatement")}function parseLabeledStatement(node,maybeName,expr){for(var i=0;i<labels.length;++i)if(labels[i].name===maybeName)raise(expr.start,"Label '"+maybeName+"' is already declared");var kind=tokType.isLoop?"loop":tokType===_switch?"switch":null;labels.push({name:maybeName,kind:kind});node.body=parseStatement();labels.pop();node.label=expr;return finishNode(node,"LabeledStatement")}function parseExpressionStatement(node,expr){node.expression=expr;semicolon();return finishNode(node,"ExpressionStatement")}function parseParenExpression(){expect(_parenL);var val=parseExpression();expect(_parenR);return val}function parseBlock(allowStrict){var node=startNode(),first=true,oldStrict;node.body=[];expect(_braceL);while(!eat(_braceR)){var stmt=parseStatement();node.body.push(stmt);if(first&&allowStrict&&isUseStrict(stmt)){oldStrict=strict;setStrict(strict=true)}first=false}if(oldStrict===false)setStrict(false);return finishNode(node,"BlockStatement")}function parseFor(node,init){node.init=init;expect(_semi);node.test=tokType===_semi?null:parseExpression();expect(_semi);node.update=tokType===_parenR?null:parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,"ForStatement")}function parseForIn(node,init){var type=tokType===_in?"ForInStatement":"ForOfStatement";next();node.left=init;node.right=parseExpression();expect(_parenR);node.body=parseStatement();labels.pop();return finishNode(node,type)}function parseVar(node,noIn,kind){node.declarations=[];node.kind=kind;for(;;){var decl=startNode();decl.id=options.ecmaVersion>=6?toAssignable(parseExprAtom()):parseIdent();checkLVal(decl.id,true);decl.init=eat(_eq)?parseExpression(true,noIn):kind===_const.keyword?unexpected():null;node.declarations.push(finishNode(decl,"VariableDeclarator"));if(!eat(_comma))break}return node}function parseExpression(noComma,noIn){var start=storeCurrentPos();var expr=parseMaybeAssign(noIn);if(!noComma&&tokType===_comma){var node=startNodeAt(start);node.expressions=[expr];while(eat(_comma))node.expressions.push(parseMaybeAssign(noIn));return finishNode(node,"SequenceExpression")}return expr}function parseMaybeAssign(noIn){var start=storeCurrentPos();var left=parseMaybeConditional(noIn);if(tokType.isAssign){var node=startNodeAt(start);node.operator=tokVal;node.left=tokType===_eq?toAssignable(left):left;checkLVal(left);next();node.right=parseMaybeAssign(noIn);return finishNode(node,"AssignmentExpression")}return left}function parseMaybeConditional(noIn){var start=storeCurrentPos();var expr=parseExprOps(noIn);if(eat(_question)){var node=startNodeAt(start);node.test=expr;node.consequent=parseExpression(true);expect(_colon);node.alternate=parseExpression(true,noIn);return finishNode(node,"ConditionalExpression")}return expr}function parseExprOps(noIn){var start=storeCurrentPos();return parseExprOp(parseMaybeUnary(),start,-1,noIn)}function parseExprOp(left,leftStart,minPrec,noIn){var prec=tokType.binop;if(prec!=null&&(!noIn||tokType!==_in)){if(prec>minPrec){var node=startNodeAt(leftStart);node.left=left;node.operator=tokVal;var op=tokType;next();var start=storeCurrentPos();node.right=parseExprOp(parseMaybeUnary(),start,prec,noIn);finishNode(node,op===_logicalOR||op===_logicalAND?"LogicalExpression":"BinaryExpression");return parseExprOp(node,leftStart,minPrec,noIn)}}return left}function parseMaybeUnary(){if(tokType.prefix){var node=startNode(),update=tokType.isUpdate;node.operator=tokVal;node.prefix=true;tokRegexpAllowed=true;next();node.argument=parseMaybeUnary();if(update)checkLVal(node.argument);else if(strict&&node.operator==="delete"&&node.argument.type==="Identifier")raise(node.start,"Deleting local variable in strict mode");return finishNode(node,update?"UpdateExpression":"UnaryExpression")}var start=storeCurrentPos();var expr=parseExprSubscripts();while(tokType.postfix&&!canInsertSemicolon()){var node=startNodeAt(start);node.operator=tokVal;node.prefix=false;node.argument=expr;checkLVal(expr);next();expr=finishNode(node,"UpdateExpression")}return expr}function parseExprSubscripts(){var start=storeCurrentPos();return parseSubscripts(parseExprAtom(),start)}function parseSubscripts(base,start,noCalls){if(eat(_dot)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);node.computed=false;return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(eat(_bracketL)){var node=startNodeAt(start);node.object=base;node.property=parseExpression();node.computed=true;expect(_bracketR);return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(!noCalls&&eat(_parenL)){var node=startNodeAt(start);node.callee=base;node.arguments=parseExprList(_parenR,false);return parseSubscripts(finishNode(node,"CallExpression"),start,noCalls)}else if(tokType===_bquote){var node=startNodeAt(start);node.tag=base;node.quasi=parseTemplate();return parseSubscripts(finishNode(node,"TaggedTemplateExpression"),start,noCalls)}return base}function parseExprAtom(){switch(tokType){case _this:var node=startNode();next();return finishNode(node,"ThisExpression");case _yield:if(inGenerator)return parseYield();case _await:if(inAsync)return parseAwait();case _name:var start=storeCurrentPos();var id=parseIdent(tokType!==_name);if(eat(_arrow)){return parseArrowExpression(startNodeAt(start),[id])}return id;case _regexp:var node=startNode();node.regex={pattern:tokVal.pattern,flags:tokVal.flags};node.value=tokVal.value;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _num:case _string:case _xjsText:var node=startNode();node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _null:case _true:case _false:var node=startNode();node.value=tokType.atomValue;node.raw=tokType.keyword;next();return finishNode(node,"Literal");case _parenL:var start=storeCurrentPos();var tokStartLoc1=tokStartLoc,tokStart1=tokStart,val,exprList;next();if(options.ecmaVersion>=7&&tokType===_for){val=parseComprehension(startNodeAt(start),true)}else{var oldParenL=++metParenL;if(tokType!==_parenR){val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(metParenL===oldParenL&&eat(_arrow)){val=parseArrowExpression(startNodeAt(start),exprList)}else{if(!val)unexpected(lastStart);if(options.ecmaVersion>=6){for(var i=0;i<exprList.length;i++){if(exprList[i].type==="SpreadElement")unexpected()}}if(options.preserveParens){var par=startNodeAt(start);par.expression=val;val=finishNode(par,"ParenthesizedExpression")}}}return val;case _bracketL:var node=startNode();next();if(options.ecmaVersion>=7&&tokType===_for){return parseComprehension(node,false)}node.elements=parseExprList(_bracketR,true,true);return finishNode(node,"ArrayExpression");case _braceL:return parseObj();case _async:return parseAsync(startNode(),false);case _function:var node=startNode();next();return parseFunction(node,false,false);case _class:return parseClass(startNode(),false);case _new:return parseNew();case _ellipsis:return parseSpread();case _bquote:return parseTemplate();case _lt:return parseXJSElement();default:unexpected()}}function parseNew(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL))node.arguments=parseExprList(_parenR,false);else node.arguments=empty;return finishNode(node,"NewExpression")}function parseSpread(){var node=startNode();next();node.argument=parseExpression(true);return finishNode(node,"SpreadElement")}function parseTemplate(){var node=startNode();node.expressions=[];node.quasis=[];inTemplate=true;next();for(;;){var elem=startNode();elem.value={cooked:tokVal,raw:input.slice(tokStart,tokEnd)};elem.tail=false;next();node.quasis.push(finishNode(elem,"TemplateElement"));if(tokType===_bquote){elem.tail=true;break}inTemplate=false;expect(_dollarBraceL);node.expressions.push(parseExpression());inTemplate=true;tokPos=tokEnd;expect(_braceR)}inTemplate=false;next();return finishNode(node,"TemplateLiteral")}function parseObj(){var node=startNode(),first=true,propHash={};node.properties=[];next();while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var prop=startNode(),isGenerator,isAsync;if(options.ecmaVersion>=7){isAsync=eat(_async);if(isAsync&&tokType===_star)unexpected()}if(options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;isGenerator=eat(_star)}parsePropertyName(prop);if(eat(_colon)){prop.value=parseExpression(true);prop.kind="init"}else if(options.ecmaVersion>=6&&tokType===_parenL){prop.kind="init";prop.method=true;prop.value=parseMethod(isGenerator,isAsync)}else if(options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set")){if(isGenerator||isAsync)unexpected();prop.kind=prop.key.name;parsePropertyName(prop);prop.value=parseMethod(false,false)}else if(options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){prop.kind="init";prop.value=prop.key;prop.shorthand=true}else unexpected();checkPropClash(prop,propHash);node.properties.push(finishNode(prop,"Property"))}return finishNode(node,"ObjectExpression")}function parsePropertyName(prop){if(options.ecmaVersion>=6){if(eat(_bracketL)){prop.computed=true;prop.key=parseExpression();expect(_bracketR);return}else{prop.computed=false}}prop.key=tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function initFunction(node,isAsync){node.id=null;node.params=[];if(options.ecmaVersion>=6){node.defaults=[];node.rest=null;node.generator=false}if(options.ecmaVersion>=7){node.async=isAsync}}function parseFunction(node,isStatement,isAsync,allowExpressionBody){initFunction(node,isAsync);if(options.ecmaVersion>=6){if(isAsync&&tokType===_star)unexpected();node.generator=eat(_star)}if(isStatement||tokType===_name){node.id=parseIdent()}parseFunctionParams(node);parseFunctionBody(node,allowExpressionBody);return finishNode(node,isStatement?"FunctionDeclaration":"FunctionExpression")}function parseMethod(isGenerator,isAsync){var node=startNode();initFunction(node,isAsync);parseFunctionParams(node);var allowExpressionBody;if(options.ecmaVersion>=6){node.generator=isGenerator;allowExpressionBody=true}else{allowExpressionBody=false}parseFunctionBody(node,allowExpressionBody);return finishNode(node,"FunctionExpression")}function parseArrowExpression(node,params,isAsync){initFunction(node,isAsync);var defaults=node.defaults,hasDefaults=false;for(var i=0,lastI=params.length-1;i<=lastI;i++){var param=params[i];if(param.type==="AssignmentExpression"&¶m.operator==="="){hasDefaults=true;params[i]=param.left;defaults.push(param.right)}else{toAssignable(param,i===lastI,true);defaults.push(null);if(param.type==="SpreadElement"){params.length--;node.rest=param.argument;break}}}node.params=params;if(!hasDefaults)node.defaults=[];parseFunctionBody(node,true);return finishNode(node,"ArrowFunctionExpression")}function parseFunctionParams(node){var defaults=[],hasDefaults=false;expect(_parenL);for(;;){if(eat(_parenR)){break}else if(options.ecmaVersion>=6&&eat(_ellipsis)){node.rest=toAssignable(parseExprAtom(),false,true);checkSpreadAssign(node.rest);expect(_parenR);defaults.push(null);break}else{node.params.push(options.ecmaVersion>=6?toAssignable(parseExprAtom(),false,true):parseIdent());if(options.ecmaVersion>=6){if(eat(_eq)){hasDefaults=true;defaults.push(parseExpression(true))}else{defaults.push(null)}}if(!eat(_comma)){expect(_parenR);break}}}if(hasDefaults)node.defaults=defaults}function parseFunctionBody(node,allowExpression){var isExpression=allowExpression&&tokType!==_braceL;var oldInAsync=inAsync;inAsync=node.async;if(isExpression){node.body=parseExpression(true);node.expression=true}else{var oldInFunc=inFunction,oldInGen=inGenerator,oldLabels=labels;inFunction=true;inGenerator=node.generator;labels=[];node.body=parseBlock(true);node.expression=false;inFunction=oldInFunc;inGenerator=oldInGen;labels=oldLabels}inAsync=oldInAsync;if(strict||!isExpression&&node.body.body.length&&isUseStrict(node.body.body[0])){var nameHash={};if(node.id)checkFunctionParam(node.id,{});for(var i=0;i<node.params.length;i++)checkFunctionParam(node.params[i],nameHash);if(node.rest)checkFunctionParam(node.rest,nameHash)}}function parseClass(node,isStatement){next();node.id=tokType===_name?parseIdent():isStatement?unexpected():null;node.superClass=eat(_extends)?parseExpression():null;var classBody=startNode();classBody.body=[];expect(_braceL);while(!eat(_braceR)){var method=startNode();if(tokType===_name&&tokVal==="static"){next();method["static"]=true}else{method["static"]=false}var isAsync=false;if(options.ecmaVersion>=7){isAsync=eat(_async);if(isAsync&&tokType===_star)unexpected()}var isGenerator=eat(_star);parsePropertyName(method);if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&(method.key.name==="get"||method.key.name==="set")){if(isGenerator||isAsync)unexpected();method.kind=method.key.name;parsePropertyName(method)}else{method.kind=""}method.value=parseMethod(isGenerator,isAsync);classBody.body.push(finishNode(method,"MethodDefinition"));eat(_semi)}node.body=finishNode(classBody,"ClassBody");return finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")}function parseExprList(close,allowTrailingComma,allowEmpty){var elts=[],first=true;while(!eat(close)){if(!first){expect(_comma);if(allowTrailingComma&&options.allowTrailingCommas&&eat(close))break}else first=false;if(allowEmpty&&tokType===_comma)elts.push(null);else elts.push(parseExpression(true))}return elts}function parseIdent(liberal){var node=startNode();if(liberal&&options.forbidReserved=="everywhere")liberal=false;if(tokType===_name){if(!liberal&&(options.forbidReserved&&(options.ecmaVersion===3?isReservedWord3:isReservedWord5)(tokVal)||strict&&isStrictReservedWord(tokVal))&&input.slice(tokStart,tokEnd).indexOf("\\")==-1)raise(tokStart,"The keyword '"+tokVal+"' is reserved");node.name=tokVal}else if(liberal&&tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"Identifier")}function parseExport(node){next();if(tokType===_var||tokType===_const||tokType===_let||tokType===_function||tokType===_class){node.declaration=parseStatement();node["default"]=false;node.specifiers=null;node.source=null}else if(eat(_default)){node.declaration=parseExpression(true);node["default"]=true;node.specifiers=null;node.source=null;semicolon()}else{var isBatch=tokType===_star;node.declaration=null;node["default"]=false;node.specifiers=parseExportSpecifiers();if(tokType===_name&&tokVal==="from"){next();node.source=tokType===_string?parseExprAtom():unexpected()}else{if(isBatch)unexpected();node.source=null}semicolon()}return finishNode(node,"ExportDeclaration")}function parseExportSpecifiers(){var nodes=[],first=true;if(tokType===_star){var node=startNode();next();nodes.push(finishNode(node,"ExportBatchSpecifier"))}else{expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent();if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent(true)}else{node.name=null}nodes.push(finishNode(node,"ExportSpecifier"))}}return nodes}function parseImport(node){next();if(tokType===_string){node.specifiers=[];node.source=parseExprAtom();node.kind=""}else{node.specifiers=parseImportSpecifiers();if(tokType!==_name||tokVal!=="from")unexpected();next();node.source=tokType===_string?parseExprAtom():unexpected();node.kind=node.specifiers[0]["default"]?"default":"named"}semicolon();return finishNode(node,"ImportDeclaration")}function parseImportSpecifiers(){var nodes=[],first=true;if(tokType===_star){var node=startNode();next();if(tokType!==_name||tokVal!=="as")unexpected();next();node.name=parseIdent();checkLVal(node.name,true);nodes.push(finishNode(node,"ImportBatchSpecifier"));return nodes}if(tokType===_name){var node=startNode();node.id=parseIdent();checkLVal(node.id,true);node.name=null;node["default"]=true;nodes.push(finishNode(node,"ImportSpecifier"));if(!eat(_comma))return nodes}expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(true);if(tokType===_name&&tokVal==="as"){next();node.name=parseIdent()}else{node.name=null}checkLVal(node.name||node.id,true);node["default"]=false;nodes.push(finishNode(node,"ImportSpecifier"))}return nodes}function parseYield(){var node=startNode();next();if(eat(_semi)||canInsertSemicolon()){node.delegate=false;node.argument=null}else{node.delegate=eat(_star);node.argument=parseExpression(true)}return finishNode(node,"YieldExpression")}function parseAwait(){var node=startNode();next();if(eat(_semi)||canInsertSemicolon()){unexpected()}node.delegate=eat(_star);node.argument=parseExpression(true);return finishNode(node,"AwaitExpression")}function parseComprehension(node,isGenerator){node.blocks=[];while(tokType===_for){var block=startNode();next();expect(_parenL);block.left=toAssignable(parseExprAtom());checkLVal(block.left,true);if(tokType!==_name||tokVal!=="of")unexpected();next();block.of=true;block.right=parseExpression();expect(_parenR);node.blocks.push(finishNode(block,"ComprehensionBlock"))}node.filter=eat(_if)?parseParenExpression():null;node.body=parseExpression();expect(isGenerator?_parenR:_bracketR);node.generator=isGenerator;return finishNode(node,"ComprehensionExpression")}function getQualifiedXJSName(object){if(object.type==="XJSIdentifier"){return object.name}if(object.type==="XJSNamespacedName"){return object.namespace.name+":"+object.name.name}if(object.type==="XJSMemberExpression"){return getQualifiedXJSName(object.object)+"."+getQualifiedXJSName(object.property)}}function parseXJSIdentifier(){var node=startNode();if(tokType===_xjsName){node.name=tokVal}else if(tokType.keyword){node.name=tokType.keyword}else{unexpected()}tokRegexpAllowed=false;next();return finishNode(node,"XJSIdentifier")}function parseXJSNamespacedName(){var node=startNode();node.namespace=parseXJSIdentifier();expect(_colon);node.name=parseXJSIdentifier();return finishNode(node,"XJSNamespacedName")}function parseXJSMemberExpression(){var start=storeCurrentPos();var node=parseXJSIdentifier();while(eat(_dot)){var newNode=startNodeAt(start);newNode.object=node;newNode.property=parseXJSIdentifier();node=finishNode(newNode,"XJSMemberExpression")}return node}function parseXJSElementName(){switch(nextChar()){case":":return parseXJSNamespacedName();case".":return parseXJSMemberExpression();default:return parseXJSIdentifier()}}function parseXJSAttributeName(){if(nextChar()===":"){return parseXJSNamespacedName()}return parseXJSIdentifier()}function parseXJSAttributeValue(){switch(tokType){case _braceL:var node=parseXJSExpressionContainer();if(node.expression.type==="XJSEmptyExpression"){raise(node.start,"XJS attributes must only be assigned a non-empty "+"expression")}return node;case _lt:return parseXJSElement();case _xjsText:return parseExprAtom();default:raise(tokStart,"XJS value should be either an expression or a quoted XJS text")}}function parseXJSEmptyExpression(){if(tokType!==_braceR){unexpected()}var tmp;tmp=tokStart;tokStart=lastEnd;lastEnd=tmp;tmp=tokStartLoc;tokStartLoc=lastEndLoc;lastEndLoc=tmp;return finishNode(startNode(),"XJSEmptyExpression")}function parseXJSExpressionContainer(){var node=startNode();var origInXJSTag=inXJSTag,origInXJSChild=inXJSChild;inXJSTag=false;inXJSChild=false;inXJSChildExpression=origInXJSChild;next();node.expression=tokType===_braceR?parseXJSEmptyExpression():parseExpression();inXJSTag=origInXJSTag;inXJSChild=origInXJSChild;inXJSChildExpression=false;expect(_braceR);return finishNode(node,"XJSExpressionContainer")}function parseXJSAttribute(){if(tokType===_braceL){var tokStart1=tokStart,tokStartLoc1=tokStartLoc;var origInXJSTag=inXJSTag;inXJSTag=false;next();var node=parseSpread();inXJSTag=origInXJSTag;expect(_braceR);node.type="XJSSpreadAttribute";node.start=tokStart1;node.end=lastEnd;if(options.locations){node.loc.start=tokStartLoc1;node.loc.end=lastEndLoc}if(options.ranges){node.range=[tokStart1,lastEnd]}return node}var node=startNode();node.name=parseXJSAttributeName();if(tokType===_eq){next();node.value=parseXJSAttributeValue()}else{node.value=null}return finishNode(node,"XJSAttribute")}function parseXJSChild(){switch(tokType){case _braceL:return parseXJSExpressionContainer();case _xjsText:return parseExprAtom();default:return parseXJSElement()}}function parseXJSOpeningElement(){var node=startNode(),attributes=node.attributes=[];var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;next();node.name=parseXJSElementName();while(tokType!==_eof&&tokType!==_slash&&tokType!==_gt){attributes.push(parseXJSAttribute())}inXJSTag=false;if(node.selfClosing=!!eat(_slash)){inXJSTag=origInXJSTag;inXJSChild=origInXJSChild}else{inXJSChild=true}expect(_gt);return finishNode(node,"XJSOpeningElement")}function parseXJSClosingElement(){var node=startNode();var origInXJSChild=inXJSChild;var origInXJSTag=inXJSTag;inXJSChild=false;inXJSTag=true;tokRegexpAllowed=false;expect(_ltSlash);node.name=parseXJSElementName();skipSpace();inXJSChild=origInXJSChild;inXJSTag=origInXJSTag;tokRegexpAllowed=false;expect(_gt);return finishNode(node,"XJSClosingElement")}function parseXJSElement(){var node=startNode();var children=[];var origInXJSChild=inXJSChild;var openingElement=parseXJSOpeningElement();var closingElement=null;if(!openingElement.selfClosing){while(tokType!==_eof&&tokType!==_ltSlash){inXJSChild=true;children.push(parseXJSChild())}inXJSChild=origInXJSChild;closingElement=parseXJSClosingElement();if(getQualifiedXJSName(closingElement.name)!==getQualifiedXJSName(openingElement.name)){raise(closingElement.start,"Expected corresponding XJS closing tag for '"+getQualifiedXJSName(openingElement.name)+"'")}}if(!origInXJSChild&&tokType===_lt){raise(tokStart,"Adjacent XJS elements must be wrapped in an enclosing tag")}node.openingElement=openingElement;node.closingElement=closingElement;node.children=children;return finishNode(node,"XJSElement")}})},{}],2:[function(require,module,exports){var transform=module.exports=require("./transformation/transform");transform.transform=transform;transform.eval=function(code,opts){opts=opts||{};opts.filename=opts.filename||"eval";opts.sourceMap="inline";return eval(transform(code,opts).code)};transform.run=function(code,opts){opts=opts||{};opts.sourceMap="inline";return new Function(transform(code,opts).code)()};transform.load=function(url,callback,opts,hold){opts=opts||{};opts.filename=opts.filename||url;var xhr=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest;xhr.open("GET",url,true);if("overrideMimeType"in xhr)xhr.overrideMimeType("text/plain");xhr.onreadystatechange=function(){if(xhr.readyState!==4)return;var status=xhr.status;if(status===0||status===200){var param=[xhr.responseText,opts];if(!hold)transform.run.apply(transform,param);if(callback)callback(param)}else{throw new Error("Could not load "+url)}};xhr.send(null)};var runScripts=function(){var scripts=[];var types=["text/ecmascript-6","text/6to5"];var index=0;var exec=function(){var param=scripts[index];if(param instanceof Array){transform.run.apply(transform,param);index++;exec()}};var run=function(script,i){var opts={};if(script.src){transform.load(script.src,function(param){scripts[i]=param;exec()},opts,true)}else{opts.filename="embedded";scripts[i]=[script.innerHTML,opts]}};var _scripts=window.document.getElementsByTagName("script");for(var i in _scripts){var _script=_scripts[i];if(types.indexOf(_script.type)>=0)scripts.push(_script)}for(i in scripts){run(scripts[i],i)}exec()};if(window.addEventListener){window.addEventListener("DOMContentLoaded",runScripts,false)}else{window.attachEvent("onload",runScripts)}},{"./transformation/transform":24}],3:[function(require,module,exports){module.exports=File;var SHEBANG_REGEX=/^\#\!.*/;var transform=require("./transformation/transform");var generate=require("./generation/generator");var Scope=require("./traverse/scope");var util=require("./util");var t=require("./types");var _=require("lodash");function File(opts){this.opts=File.normaliseOptions(opts);this.moduleFormatter=this.getModuleFormatter(this.opts.modules);this.declarations={};this.uids={};this.ast={}}File.declarations=["extends","class-props","slice"];File.normaliseOptions=function(opts){opts=_.cloneDeep(opts||{});_.defaults(opts,{whitespace:true,blacklist:[],whitelist:[],sourceMap:false,filename:"unknown",modules:"common",runtime:false});opts.filename=opts.filename.replace(/\\/g,"/");_.defaults(opts,{sourceFileName:opts.filename,sourceMapName:opts.filename});if(opts.runtime===true){opts.runtime="to5Runtime"}transform._ensureTransformerNames("blacklist",opts.blacklist);transform._ensureTransformerNames("whitelist",opts.whitelist);return opts};File.prototype.getModuleFormatter=function(type){var ModuleFormatter=transform.moduleFormatters[type];if(!ModuleFormatter){var loc=util.resolve(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("unknown module formatter type "+type)}return new ModuleFormatter(this)};File.prototype.parseShebang=function(code){var shebangMatch=code.match(SHEBANG_REGEX);if(shebangMatch){this.shebang=shebangMatch[0];
code=code.replace(SHEBANG_REGEX,"")}return code};File.prototype.addDeclaration=function(name){if(!_.contains(File.declarations,name)){throw new ReferenceError("unknown declaration "+name)}var declar=this.declarations[name];if(declar)return declar.uid;var ref;var runtimeNamespace=this.opts.runtime;if(runtimeNamespace){name=t.identifier(t.toIdentifier(name));return t.memberExpression(t.identifier(runtimeNamespace),name)}else{ref=util.template(name)}var uid=t.identifier(this.generateUid(name));this.declarations[name]={uid:uid,node:ref};return uid};File.prototype.errorWithNode=function(node,msg,Error){Error=Error||SyntaxError;var loc=node.loc.start;var err=new Error("Line "+loc.line+": "+msg);err.loc=loc;return err};File.prototype.parse=function(code){code=(code||"")+"";var self=this;this.code=code;code=this.parseShebang(code);return util.parse(this.opts,code,function(tree){self.transform(tree);return self.generate()})};File.prototype.transform=function(ast){this.ast=ast;this.scope=new Scope(null,ast.program);var self=this;_.each(transform.transformers,function(transformer){transformer.transform(self)})};File.prototype.generate=function(){var opts=this.opts;var ast=this.ast;var result=generate(ast,opts,this.code);if(this.shebang){result.code=this.shebang+"\n"+result.code}if(opts.sourceMap==="inline"){result.code+="\n"+util.sourceMapToComment(result.map)}return result};File.prototype.generateUid=function(name,scope){name=t.toIdentifier(name);scope=scope||this.scope;var uid;do{uid=this._generateUid(name)}while(scope.has(uid));return uid};File.prototype._generateUid=function(name){var uids=this.uids;var i=uids[name]||1;var id=name;if(i>1)id+=i;uids[name]=i+1;return"_"+id}},{"./generation/generator":4,"./transformation/transform":24,"./traverse/scope":53,"./types":56,"./util":58,lodash:104}],4:[function(require,module,exports){module.exports=function(ast,opts,code){var gen=new CodeGenerator(ast,opts,code);return gen.generate()};module.exports.CodeGenerator=CodeGenerator;var Whitespace=require("./whitespace");var SourceMap=require("./source-map");var Position=require("./position");var util=require("../util");var n=require("./node");var t=require("../types");var _=require("lodash");function CodeGenerator(ast,opts,code){opts=opts||{};this.comments=ast.comments||[];this.tokens=ast.tokens||[];this.opts=opts;this.ast=ast;this.buf="";this.format=CodeGenerator.normaliseOptions(opts);this._indent=this.format.indent.base;this.whitespace=new Whitespace(this.tokens,this.comments);this.position=new Position;this.map=new SourceMap(this.position,opts,code)}CodeGenerator.normaliseOptions=function(opts){opts=opts.format||{};opts=_.merge({parentheses:true,semicolons:true,comments:true,compact:false,indent:{adjustMultilineComment:true,style:" ",base:0}},opts);return opts};CodeGenerator.generators={arrayComprehensions:require("./generators/array-comprehensions"),templateLiterals:require("./generators/template-literals"),expressions:require("./generators/expressions"),statements:require("./generators/statements"),classes:require("./generators/classes"),methods:require("./generators/methods"),modules:require("./generators/modules"),types:require("./generators/types"),base:require("./generators/base"),jsx:require("./generators/jsx")};_.each(CodeGenerator.generators,function(generator){_.extend(CodeGenerator.prototype,generator)});CodeGenerator.prototype.newline=function(i,removeLast){if(!this.buf)return;if(this.format.compact)return;if(this.endsWith("{\n"))return;if(_.isBoolean(i)){removeLast=i;i=null}if(_.isNumber(i)){var self=this;_.times(i,function(){self.newline(null,removeLast)});return}if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this.buf=this.buf.replace(/\n(\s+)$/,"\n");this._push("\n")};CodeGenerator.prototype.removeLast=function(cha){if(!this.isLast(cha))return;this.buf=this.buf.slice(0,-1);this.position.unshift(cha)};CodeGenerator.prototype.semicolon=function(){if(this.format.semicolons)this.push(";")};CodeGenerator.prototype.ensureSemicolon=function(){if(!this.isLast(";"))this.semicolon()};CodeGenerator.prototype.rightBrace=function(){this.newline(true);this.push("}")};CodeGenerator.prototype.keyword=function(name){this.push(name);this.push(" ")};CodeGenerator.prototype.space=function(){if(this.buf&&!this.isLast([" ","\n"])){this.push(" ")}};CodeGenerator.prototype.push=function(str,noIndent){if(this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))str=indent+str}this._push(str)};CodeGenerator.prototype._push=function(str){this.position.push(str);this.buf+=str};CodeGenerator.prototype.endsWith=function(str){return this.buf.slice(-str.length)===str};CodeGenerator.prototype.isLast=function(cha,trimRight){var buf=this.buf;if(trimRight)buf=buf.trimRight();var chars=[].concat(cha);return _.contains(chars,_.last(buf))};CodeGenerator.prototype.getIndent=function(){if(this.format.compact){return""}else{return util.repeat(this._indent,this.format.indent.style)}};CodeGenerator.prototype.indentSize=function(){return this.getIndent().length};CodeGenerator.prototype.indent=function(){this._indent++};CodeGenerator.prototype.dedent=function(){this._indent--};CodeGenerator.prototype.generate=function(){var ast=this.ast;this.print(ast);this.buf=this.buf.trimRight();return{map:this.map.get(),ast:ast,code:this.buf}};CodeGenerator.prototype.buildPrint=function(parent){var self=this;var print=function(node,opts){return self.print(node,parent,opts)};print.sequence=function(nodes,opts){opts=opts||{};opts.statement=true;return self.printJoin(print,nodes,opts)};print.join=function(nodes,opts){return self.printJoin(print,nodes,opts)};print.block=function(node){return self.printBlock(print,node)};print.indentOnComments=function(node){return self.printAndIndentOnComments(print,node)};return print};CodeGenerator.prototype.print=function(node,parent,opts){if(!node)return"";var self=this;opts=opts||{};var newline=function(leading){var ignoreDuplicates=false;if(!opts.statement&&!n.isUserWhitespacable(node,parent)){return}var lines=0;if(node.start!=null){if(leading){lines=self.whitespace.getNewlinesBefore(node)}else{lines=self.whitespace.getNewlinesAfter(node)}}else{if(!leading)lines++;var needs=n.needsWhitespaceAfter;if(leading)needs=n.needsWhitespaceBefore;lines+=needs(node,parent)}self.newline(lines,ignoreDuplicates)};if(this[node.type]){this.printLeadingComments(node,parent);newline(true);if(opts.before)opts.before();this.map.mark(node,"start");var needsParens=parent!==node._parent&&n.needsParens(node,parent);if(needsParens)this.push("(");this[node.type](node,this.buildPrint(node),parent);if(needsParens)this.push(")");this.map.mark(node,"end");if(opts.after)opts.after();newline(false);this.printTrailingComments(node,parent)}else{throw new ReferenceError("unknown node "+node.type+" "+JSON.stringify(node))}};CodeGenerator.prototype.printJoin=function(print,nodes,opts){opts=opts||{};var self=this;var len=nodes.length;if(opts.indent)self.indent();_.each(nodes,function(node,i){print(node,{statement:opts.statement,after:function(){if(opts.iterator){opts.iterator(node,i)}if(opts.separator&&i<len-1){self.push(opts.separator)}}})});if(opts.indent)self.dedent()};CodeGenerator.prototype.printAndIndentOnComments=function(print,node){var indent=!!node.leadingComments;if(indent)this.indent();print(node);if(indent)this.dedent()};CodeGenerator.prototype.printBlock=function(print,node){if(t.isEmptyStatement(node)){this.semicolon()}else{this.push(" ");print(node)}};CodeGenerator.prototype.generateComment=function(comment){var val=comment.value;if(comment.type==="Line"){val="//"+val}else{val="/*"+val+"*/"}return val};CodeGenerator.prototype.printTrailingComments=function(node,parent){this._printComments(this.getComments("trailingComments",node,parent))};CodeGenerator.prototype.printLeadingComments=function(node,parent){this._printComments(this.getComments("leadingComments",node,parent))};CodeGenerator.prototype.getComments=function(key,node,parent){if(t.isExpressionStatement(parent)){return[]}var comments=[];var nodes=[node];var self=this;if(t.isExpressionStatement(node)){nodes.push(node.argument)}_.each(nodes,function(node){comments=comments.concat(self._getComments(key,node))});return comments};CodeGenerator.prototype._getComments=function(key,node){return node&&node[key]||[]};CodeGenerator.prototype._printComments=function(comments){if(this.format.compact)return;if(!this.format.comments)return;if(!comments||!comments.length)return;var self=this;_.each(comments,function(comment){self.newline(self.whitespace.getNewlinesBefore(comment));var column=self.position.column;var val=self.generateComment(comment);if(column&&!self.isLast(["\n"," ","[","{"])){self._push(" ");column++}if(comment.type==="Block"&&self.format.indent.adjustMultilineComment){var offset=comment.loc.start.column;if(offset){var newlineRegex=new RegExp("\\n\\s{1,"+offset+"}","g");val=val.replace(newlineRegex,"\n")}var indent=Math.max(self.indentSize(),column);val=val.replace(/\n/g,"\n"+util.repeat(indent))}if(column===0){val=self.getIndent()+val}self._push(val);self.newline(self.whitespace.getNewlinesAfter(comment))})}},{"../types":56,"../util":58,"./generators/array-comprehensions":5,"./generators/base":6,"./generators/classes":7,"./generators/expressions":8,"./generators/jsx":9,"./generators/methods":10,"./generators/modules":11,"./generators/statements":12,"./generators/template-literals":13,"./generators/types":14,"./node":15,"./position":16,"./source-map":17,"./whitespace":18,lodash:104}],5:[function(require,module,exports){exports.ComprehensionBlock=function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" of ");print(node.right);this.push(")")};exports.ComprehensionExpression=function(node,print){this.push("[");print.join(node.blocks,{separator:" "});this.space();if(node.filter){this.keyword("if");this.push("(");print(node.filter);this.push(")");this.space()}print(node.body);this.push("]")}},{}],6:[function(require,module,exports){exports.File=function(node,print){print(node.program)};exports.Program=function(node,print){print.sequence(node.body)};exports.BlockStatement=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();print.sequence(node.body,{indent:true});this.removeLast("\n");this.rightBrace()}}},{}],7:[function(require,module,exports){exports.ClassExpression=exports.ClassDeclaration=function(node,print){this.push("class");if(node.id){this.space();print(node.id)}if(node.superClass){this.push(" extends ");print(node.superClass)}this.space();print(node.body)};exports.ClassBody=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();print.sequence(node.body);this.dedent();this.rightBrace()}}},{}],8:[function(require,module,exports){var t=require("../../types");exports.UnaryExpression=function(node,print){var hasSpace=/[a-z]$/.test(node.operator);var arg=node.argument;if(t.isUpdateExpression(arg)||t.isUnaryExpression(arg)){hasSpace=true}if(t.isUnaryExpression(arg)&&arg.operator==="!"){hasSpace=false}this.push(node.operator);if(hasSpace)this.space();print(node.argument)};exports.ParenthesizedExpression=function(node,print){this.push("(");print(node.expression);this.push(")")};exports.UpdateExpression=function(node,print){if(node.prefix){this.push(node.operator);print(node.argument)}else{print(node.argument);this.push(node.operator)}};exports.ConditionalExpression=function(node,print){print(node.test);this.push(" ? ");print(node.consequent);this.push(" : ");print(node.alternate)};exports.NewExpression=function(node,print){this.push("new ");print(node.callee);if(node.arguments.length||this.format.parentheses){this.push("(");print.join(node.arguments,{separator:", "});this.push(")")}};exports.SequenceExpression=function(node,print){print.join(node.expressions,{separator:", "})};exports.ThisExpression=function(){this.push("this")};exports.CallExpression=function(node,print){print(node.callee);this.push("(");print.join(node.arguments,{separator:", "});this.push(")")};var buildYieldAwait=function(keyword){return function(node,print){this.push(keyword);if(node.delegate)this.push("*");if(node.argument){this.space();print(node.argument)}}};exports.YieldExpression=buildYieldAwait("yield");exports.AwaitExpression=buildYieldAwait("await");exports.EmptyStatement=function(){this.semicolon()};exports.ExpressionStatement=function(node,print){print(node.expression);this.semicolon()};exports.BinaryExpression=exports.LogicalExpression=exports.AssignmentExpression=function(node,print){print(node.left);this.push(" "+node.operator+" ");print(node.right)};exports.MemberExpression=function(node,print){print(node.object);if(node.computed){this.push("[");print(node.property);this.push("]")}else{this.push(".");print(node.property)}}},{"../../types":56}],9:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.XJSAttribute=function(node,print){print(node.name);if(node.value){this.push("=");print(node.value)}};exports.XJSIdentifier=function(node){this.push(node.name)};exports.XJSNamespacedName=function(node,print){print(node.namespace);this.push(":");print(node.name)};exports.XJSMemberExpression=function(node,print){print(node.object);this.push(".");print(node.property)};exports.XJSSpreadAttribute=function(node,print){this.push("{...");print(node.argument);this.push("}")};exports.XJSExpressionContainer=function(node,print){this.push("{");print(node.expression);this.push("}")};exports.XJSElement=function(node,print){var self=this;var open=node.openingElement;print(open);if(open.selfClosing)return;this.indent();_.each(node.children,function(child){if(t.isLiteral(child)){self.push(child.value)}else{print(child)}});this.dedent();print(node.closingElement)};exports.XJSOpeningElement=function(node,print){this.push("<");print(node.name);if(node.attributes.length>0){this.space();print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")};exports.XJSClosingElement=function(node,print){this.push("</");print(node.name);this.push(">")};exports.XJSEmptyExpression=function(){this.push("null")}},{"../../types":56,lodash:104}],10:[function(require,module,exports){var t=require("../../types");exports._params=function(node,print){var self=this;this.push("(");print.join(node.params,{separator:", ",iterator:function(param,i){var def=node.defaults&&node.defaults[i];if(def){self.push(" = ");print(def)}}});if(node.rest){if(node.params.length){this.push(", ")}this.push("...");print(node.rest)}this.push(")")};exports._method=function(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(!kind||kind==="init"){if(value.generator){this.push("*")}}else{this.push(kind+" ")}if(node.computed){this.push("[");print(key);this.push("]")}else{print(key)}this._params(value,print);this.space();print(value.body)};exports.MethodDefinition=function(node,print){if(node.static){this.push("static ")}this._method(node,print)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,print){this.push("function");if(node.generator)this.push("*");this.space();if(node.id)print(node.id);this._params(node,print);this.space();print(node.body)};exports.ArrowFunctionExpression=function(node,print){if(node.params.length===1&&!node.defaults.length&&!node.rest&&t.isIdentifier(node.params[0])){print(node.params[0])}else{this._params(node,print)}this.push(" => ");print(node.body)}},{"../../types":56}],11:[function(require,module,exports){var t=require("../../types");var _=require("lodash");exports.ImportSpecifier=exports.ExportSpecifier=function(node,print){print(node.id);if(node.name){this.push(" as ");print(node.name)}};exports.ExportBatchSpecifier=function(){this.push("*")};exports.ExportDeclaration=function(node,print){this.push("export ");var specifiers=node.specifiers;if(node.default){this.push("default ")}if(node.declaration){print(node.declaration)}else{if(specifiers.length===1&&t.isExportBatchSpecifier(specifiers[0])){this.push("*")}else{this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print(node.source)}}this.ensureSemicolon()};exports.ImportDeclaration=function(node,print){var self=this;this.push("import ");var specfiers=node.specifiers;if(specfiers&&specfiers.length){var foundImportSpecifier=false;_.each(node.specifiers,function(spec,i){if(+i>0){self.push(", ")}if(!spec.default&&spec.type!=="ImportBatchSpecifier"&&!foundImportSpecifier){foundImportSpecifier=true;self.push("{ ")}print(spec)});if(foundImportSpecifier){this.push(" }")}this.push(" from ")}print(node.source);this.semicolon()};exports.ImportBatchSpecifier=function(node,print){this.push("* as ");print(node.name)}},{"../../types":56,lodash:104}],12:[function(require,module,exports){var t=require("../../types");exports.WithStatement=function(node,print){this.keyword("with");this.push("(");print(node.object);print.block(node.body)};exports.IfStatement=function(node,print){this.keyword("if");this.push("(");print(node.test);this.push(") ");print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.space();this.keyword("else");print.indentOnComments(node.alternate)}};exports.ForStatement=function(node,print){this.keyword("for");this.push("(");print(node.init);this.push(";");if(node.test){this.space();print(node.test)}this.push(";");if(node.update){this.space();print(node.update)}this.push(")");print.block(node.body)};exports.WhileStatement=function(node,print){this.keyword("while");this.push("(");print(node.test);this.push(")");print.block(node.body)};var buildForXStatement=function(op){return function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" "+op+" ");print(node.right);this.push(")");print.block(node.body)}};exports.ForInStatement=buildForXStatement("in");exports.ForOfStatement=buildForXStatement("of");exports.DoWhileStatement=function(node,print){this.keyword("do");print(node.body);this.space();this.keyword("while");this.push("(");print(node.test);this.push(");")};var buildLabelStatement=function(prefix,key){return function(node,print){this.push(prefix);var label=node[key||"label"];if(label){this.space();print(label)}this.semicolon()}};exports.ContinueStatement=buildLabelStatement("continue");exports.ReturnStatement=buildLabelStatement("return","argument");exports.BreakStatement=buildLabelStatement("break");exports.LabeledStatement=function(node,print){print(node.label);this.push(": ");print(node.body)};exports.TryStatement=function(node,print){this.keyword("try");print(node.block);this.space();print(node.handler);if(node.finalizer){this.space();this.push("finally ");print(node.finalizer)}};exports.CatchClause=function(node,print){this.keyword("catch");this.push("(");print(node.param);this.push(") ");print(node.body)};exports.ThrowStatement=function(node,print){this.push("throw ");print(node.argument);this.semicolon()};exports.SwitchStatement=function(node,print){this.keyword("switch");this.push("(");print(node.discriminant);this.push(") {");print.sequence(node.cases,{indent:true});this.push("}")};exports.SwitchCase=function(node,print){if(node.test){this.push("case ");print(node.test);this.push(":")}else{this.push("default:")}if(node.consequent.length===1){this.space();print(node.consequent[0])}else if(node.consequent.length>1){this.newline();print.sequence(node.consequent,{indent:true})}};exports.DebuggerStatement=function(){this.push("debugger;")};exports.VariableDeclaration=function(node,print,parent){this.push(node.kind+" ");print.join(node.declarations,{separator:", "});if(!t.isFor(parent)){this.semicolon()}};exports.VariableDeclarator=function(node,print){if(node.init){print(node.id);this.push(" = ");print(node.init)}else{print(node.id)}}},{"../../types":56}],13:[function(require,module,exports){var _=require("lodash");exports.TaggedTemplateExpression=function(node,print){print(node.tag);print(node.quasi)};exports.TemplateElement=function(node){this._push(node.value.raw)};exports.TemplateLiteral=function(node,print){this.push("`");var quasis=node.quasis;var self=this;var len=quasis.length;_.each(quasis,function(quasi,i){print(quasi);if(i+1<len){self.push("${ ");print(node.expressions[i]);self.push(" }")}});this._push("`")}},{lodash:104}],14:[function(require,module,exports){var _=require("lodash");exports.Identifier=function(node){this.push(node.name)};exports.SpreadElement=function(node,print){this.push("...");print(node.argument)};exports.ObjectExpression=exports.ObjectPattern=function(node,print){var props=node.properties;if(props.length){this.push("{");this.space();print.join(props,{separator:", ",indent:true});this.space();this.push("}")}else{this.push("{}")}};exports.Property=function(node,print){if(node.method||node.kind==="get"||node.kind==="set"){this._method(node,print)}else{if(node.computed){this.push("[");print(node.key);this.push("]")}else{print(node.key);if(node.shorthand)return}this.push(": ");print(node.value)}};exports.ArrayExpression=exports.ArrayPattern=function(node,print){var elems=node.elements;var self=this;var len=elems.length;this.push("[");_.each(elems,function(elem,i){if(!elem){self.push(",")}else{if(i>0)self.push(" ");print(elem);if(i<len-1)self.push(",")}});this.push("]")};exports.Literal=function(node){var val=node.value;var type=typeof val;if(type==="boolean"||type==="number"||type==="string"){this.push(JSON.stringify(val))}else if(node.regex){this.push("/"+node.regex.pattern+"/"+node.regex.flags)}else if(val===null){this.push("null")}else if(node.raw){this.push(node.raw)}}},{lodash:104}],15:[function(require,module,exports){module.exports=Node;var t=require("../types");var _=require("lodash");function Node(node,parent){this.parent=parent;this.node=node}Node.whitespace={FunctionExpression:1,FunctionStatement:1,ClassExpression:1,ClassStatement:1,ForOfStatement:1,ForInStatement:1,ForStatement:1,SwitchStatement:1,IfStatement:{before:1},Literal:{after:1}};_.each(Node.whitespace,function(amounts,type){if(_.isNumber(amounts))amounts={after:amounts,before:amounts};Node.whitespace[type]=amounts});Node.PRECEDENCE={};_.each([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]],function(tier,i){_.each(tier,function(op){Node.PRECEDENCE[op]=i})});Node.prototype.isUserWhitespacable=function(){var node=this.node;if(t.isUserWhitespacable(node)){return true}return false};Node.prototype.needsWhitespace=function(type){var parent=this.parent;var node=this.node;if(!node)return 0;if(t.isExpressionStatement(node)){node=node.expression}if(type==="before"){if(t.isProperty(node)&&parent.properties[0]===node){return 1}if(t.isSwitchCase(node)&&parent.cases[0]===node){return 1}}if(type==="after"){if(t.isCallExpression(node)){return 1}var exprs=[];if(t.isVariableDeclaration(node)){exprs=_.map(node.declarations,"init")}if(t.isArrayExpression(node)){exprs=node.elements}if(t.isObjectExpression(node)){exprs=node.properties}var lines=0;_.each(exprs,function(expr){lines=Node.needsWhitespace(expr,node,type);if(lines)return false});if(lines)return lines}if(t.isCallExpression(node)&&t.isFunction(node.callee)){return 1}var opts=Node.whitespace[node.type];return opts&&opts[type]||0};Node.prototype.needsWhitespaceBefore=function(){return this.needsWhitespace("before")};Node.prototype.needsWhitespaceAfter=function(){return this.needsWhitespace("after")};Node.prototype.needsParens=function(){var parent=this.parent;var node=this.node;if(!parent)return false;if(t.isUnaryLike(node)){return t.isMemberExpression(parent)&&parent.object===node}if(t.isBinary(node)){if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=Node.PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=Node.PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}}if(t.isBinaryExpression(node)&&node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}if(t.isClassExpression(node)&&t.isExpressionStatement(parent)){return true}if(t.isSequenceExpression(node)){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true}if(t.isYieldExpression(node)){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)}if(t.isNewExpression(parent)&&parent.callee===node){return t.isCallExpression(node)||_.some(node,function(val){return t.isCallExpression(val)})}if(t.isLiteral(node)&&_.isNumber(node.value)&&t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isAssignmentExpression(node)||t.isConditionalExpression(node)){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}}if(t.isFunctionExpression(node)){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}}if(t.isObjectPattern(node)&&t.isAssignmentExpression(parent)&&parent.left==node){return true}return false};_.each(Node.prototype,function(fn,key){Node[key]=function(node,parent){var n=new Node(node,parent);var args=_.toArray(arguments).slice(2);return n[key].apply(n,args)}})},{"../types":56,lodash:104}],16:[function(require,module,exports){module.exports=Position;var _=require("lodash");function Position(){this.line=1;this.column=0}Position.prototype.push=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line++;self.column=0}else{self.column++}})};Position.prototype.unshift=function(str){var self=this;_.each(str,function(cha){if(cha==="\n"){self.line--}else{self.column--}})}},{lodash:104}],17:[function(require,module,exports){module.exports=SourceMap;var sourceMap=require("source-map");var t=require("../types");function SourceMap(position,opts,code){this.position=position;this.opts=opts;if(opts.sourceMap){this.map=new sourceMap.SourceMapGenerator({file:opts.sourceMapName});this.map.setSourceContent(opts.sourceFileName,code)}else{this.map=null}}SourceMap.prototype.get=function(){var map=this.map;if(map){return map.toJSON()}else{return map}};SourceMap.prototype.mark=function(node,type){var loc=node.loc;if(!loc)return;var map=this.map;if(!map)return;if(t.isProgram(node)||t.isFile(node))return;var position=this.position;var generated={line:position.line,column:position.column};var original=loc[type];if(generated.line===original.line&&generated.column===original.column)return;map.addMapping({source:this.opts.sourceFileName,generated:generated,original:original})}},{"../types":56,"source-map":127}],18:[function(require,module,exports){module.exports=Whitespace;var _=require("lodash");function Whitespace(tokens,comments){this.tokens=_.sortBy(tokens.concat(comments),"start");this.used=[]}Whitespace.prototype.getNewlinesBefore=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.start===token.start){startToken=tokens[i-1];endToken=token;return false}});return this.getNewlinesBetween(startToken,endToken)};Whitespace.prototype.getNewlinesAfter=function(node){var startToken;var endToken;var tokens=this.tokens;_.each(tokens,function(token,i){if(node.end===token.end){startToken=token;endToken=tokens[i+1];return false}});return this.getNewlinesBetween(startToken,endToken)};Whitespace.prototype.getNewlinesBetween=function(startToken,endToken){var start=startToken?startToken.loc.end.line:1;var end=endToken.loc.start.line;var lines=0;for(var line=start;line<end;line++){if(!_.contains(this.used,line)){this.used.push(line);lines++}}return lines}},{lodash:104}],19:[function(require,module,exports){var t=require("./types");var _=require("lodash");var types=require("ast-types");var def=types.Type.def;def("File").bases("Node").build("program").field("program",def("Program"));def("ParenthesizedExpression").bases("Expression").build("expression").field("expression",def("Expression"));def("ImportBatchSpecifier").bases("Specifier").build("name").field("name",def("Identifier"));types.finalize();var estraverse=require("estraverse");_.extend(estraverse.VisitorKeys,t.VISITOR_KEYS)},{"./types":56,"ast-types":72,estraverse:99,lodash:104}],20:[function(require,module,exports){module.exports=AMDFormatter;var CommonJSFormatter=require("./common");var util=require("../../util");var t=require("../../types");var _=require("lodash");function AMDFormatter(file){this.file=file;this.ids={}}util.inherits(AMDFormatter,CommonJSFormatter);AMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[t.literal("exports")];_.each(this.ids,function(id,name){names.push(t.literal(name))});names=t.arrayExpression(names);var params=_.values(this.ids);params.unshift(t.identifier("exports"));var container=t.functionExpression(null,params,t.blockStatement(body));var call=t.callExpression(t.identifier("define"),[names,container]);program.body=[t.expressionStatement(call)]};AMDFormatter.prototype._push=function(node){var id=node.source.value;var ids=this.ids;if(ids[id]){return ids[id]}else{return this.ids[id]=t.identifier(this.file.generateUid(id))}};AMDFormatter.prototype.import=function(node){this._push(node)};AMDFormatter.prototype.importSpecifier=function(specifier,node,nodes){var key=t.getSpecifierName(specifier);var id=specifier.id;if(specifier.default){id=t.identifier("default")}var ref;if(t.isImportBatchSpecifier(specifier)){ref=this._push(node)}else{ref=t.memberExpression(this._push(node),id,false)}nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,ref)]))};AMDFormatter.prototype.exportSpecifier=function(specifier,node,nodes){var self=this;return this._exportSpecifier(function(){return self._push(node)},specifier,node,nodes)}},{"../../types":56,"../../util":58,"./common":21,lodash:104}],21:[function(require,module,exports){module.exports=CommonJSFormatter;var util=require("../../util");var t=require("../../types");function CommonJSFormatter(file){this.file=file}CommonJSFormatter.prototype.import=function(node,nodes){nodes.push(util.template("require",{MODULE_NAME:node.source.raw},true))};CommonJSFormatter.prototype.importSpecifier=function(specifier,node,nodes){var variableName=t.getSpecifierName(specifier);if(specifier.default){specifier.id=t.identifier("default")}var templateName="require-assign";if(specifier.type!=="ImportBatchSpecifier")templateName+="-key";nodes.push(util.template(templateName,{VARIABLE_NAME:variableName,MODULE_NAME:node.source.raw,KEY:specifier.id}))};CommonJSFormatter.prototype.export=function(node,nodes){var declar=node.declaration;if(node.default){var ref=declar;if(t.isClass(ref)||t.isFunction(ref)){if(ref.id){nodes.push(t.toStatement(ref));ref=ref.id}}nodes.push(util.template("exports-default",{VALUE:ref},true))}else{var assign;if(t.isVariableDeclaration(declar)){var decl=declar.declarations[0];if(decl.init){decl.init=util.template("exports-assign",{VALUE:decl.init,KEY:decl.id})}nodes.push(declar)}else{assign=util.template("exports-assign",{VALUE:declar.id,KEY:declar.id},true);nodes.push(t.toStatement(declar));nodes.push(assign);if(t.isFunctionDeclaration(declar)){assign._blockHoist=true}}}};CommonJSFormatter.prototype._exportSpecifier=function(getRef,specifier,node,nodes){var variableName=t.getSpecifierName(specifier);var inherits=false;if(node.specifiers.length===1)inherits=node;if(node.source){if(t.isExportBatchSpecifier(specifier)){nodes.push(util.template("exports-wildcard",{OBJECT:getRef()},true))
}else{nodes.push(util.template("exports-assign-key",{VARIABLE_NAME:variableName.name,OBJECT:getRef(),KEY:specifier.id},true))}}else{nodes.push(util.template("exports-assign",{VALUE:specifier.id,KEY:variableName},true))}};CommonJSFormatter.prototype.exportSpecifier=function(specifier,node,nodes){return this._exportSpecifier(function(){return t.callExpression(t.identifier("require"),[node.source])},specifier,node,nodes)}},{"../../types":56,"../../util":58}],22:[function(require,module,exports){module.exports=IgnoreFormatter;var t=require("../../types");function IgnoreFormatter(){}IgnoreFormatter.prototype.import=function(){};IgnoreFormatter.prototype.importSpecifier=function(){};IgnoreFormatter.prototype.export=function(node,nodes){var declar=t.toStatement(node.declaration,true);if(declar)nodes.push(t.inherits(declar,node))};IgnoreFormatter.prototype.exportSpecifier=function(){}},{"../../types":56}],23:[function(require,module,exports){module.exports=UMDFormatter;var AMDFormatter=require("./amd");var util=require("../../util");var t=require("../../types");var _=require("lodash");function UMDFormatter(file){this.file=file;this.ids={}}util.inherits(UMDFormatter,AMDFormatter);UMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[];_.each(this.ids,function(id,name){names.push(t.literal(name))});var ids=_.values(this.ids);var args=[t.identifier("exports")].concat(ids);var factory=t.functionExpression(null,args,t.blockStatement(body));var runner=util.template("umd-runner-body",{AMD_ARGUMENTS:t.arrayExpression([t.literal("exports")].concat(names)),COMMON_ARGUMENTS:names.map(function(name){return t.callExpression(t.identifier("require"),[name])})});var call=t.callExpression(runner,[factory]);program.body=[t.expressionStatement(call)]}},{"../../types":56,"../../util":58,"./amd":20,lodash:104}],24:[function(require,module,exports){module.exports=transform;var Transformer=require("./transformer");var File=require("../file");var _=require("lodash");function transform(code,opts){var file=new File(opts);return file.parse(code)}transform._ensureTransformerNames=function(type,keys){_.each(keys,function(key){if(!_.has(transform.transformers,key)){throw new ReferenceError("unknown transformer "+key+" specified in "+type)}})};transform.transformers={};transform.moduleFormatters={common:require("./modules/common"),ignore:require("./modules/ignore"),amd:require("./modules/amd"),umd:require("./modules/umd")};_.each({modules:require("./transformers/modules"),propertyNameShorthand:require("./transformers/property-name-shorthand"),constants:require("./transformers/constants"),arrayComprehension:require("./transformers/array-comprehension"),arrowFunctions:require("./transformers/arrow-functions"),classes:require("./transformers/classes"),_propertyLiterals:require("./transformers/_property-literals"),computedPropertyNames:require("./transformers/computed-property-names"),spread:require("./transformers/spread"),templateLiterals:require("./transformers/template-literals"),propertyMethodAssignment:require("./transformers/property-method-assignment"),defaultParameters:require("./transformers/default-parameters"),restParameters:require("./transformers/rest-parameters"),destructuring:require("./transformers/destructuring"),letScoping:require("./transformers/let-scoping"),forOf:require("./transformers/for-of"),unicodeRegex:require("./transformers/unicode-regex"),numericLiterals:require("./transformers/numeric-literals"),react:require("./transformers/react"),jsx:require("./transformers/jsx"),_aliasFunctions:require("./transformers/_alias-functions"),_blockHoist:require("./transformers/_block-hoist"),_declarations:require("./transformers/_declarations"),generators:require("./transformers/generators"),useStrict:require("./transformers/use-strict"),_moduleFormatter:require("./transformers/_module-formatter")},function(transformer,key){transform.transformers[key]=new Transformer(key,transformer)})},{"../file":3,"./modules/amd":20,"./modules/common":21,"./modules/ignore":22,"./modules/umd":23,"./transformer":25,"./transformers/_alias-functions":26,"./transformers/_block-hoist":27,"./transformers/_declarations":28,"./transformers/_module-formatter":29,"./transformers/_property-literals":30,"./transformers/array-comprehension":31,"./transformers/arrow-functions":32,"./transformers/classes":33,"./transformers/computed-property-names":34,"./transformers/constants":35,"./transformers/default-parameters":36,"./transformers/destructuring":37,"./transformers/for-of":38,"./transformers/generators":39,"./transformers/jsx":40,"./transformers/let-scoping":41,"./transformers/modules":42,"./transformers/numeric-literals":43,"./transformers/property-method-assignment":44,"./transformers/property-name-shorthand":45,"./transformers/react":46,"./transformers/rest-parameters":47,"./transformers/spread":48,"./transformers/template-literals":49,"./transformers/unicode-regex":50,"./transformers/use-strict":51,lodash:104}],25:[function(require,module,exports){module.exports=Transformer;var traverse=require("../traverse");var t=require("../types");var _=require("lodash");function Transformer(key,transformer){this.transformer=Transformer.normalise(transformer);this.key=key}Transformer.normalise=function(transformer){if(_.isFunction(transformer)){transformer={ast:transformer}}_.each(transformer,function(fns,type){if(_.isFunction(fns))fns={enter:fns};transformer[type]=fns});return transformer};Transformer.prototype.transform=function(file){if(!this.canRun(file))return;var transformer=this.transformer;var ast=file.ast;var astRun=function(key){if(transformer.ast&&transformer.ast[key]){transformer.ast[key](ast,file)}};astRun("enter");var build=function(exit){return function(node,parent,scope){var types=[node.type].concat(t.ALIAS_KEYS[node.type]||[]);var fns=transformer.all;_.each(types,function(type){fns=transformer[type]||fns});if(!fns)return;var fn=fns.enter;if(exit)fn=fns.exit;if(!fn)return;return fn(node,parent,file,scope)}};traverse(ast,{enter:build(),exit:build(true)});astRun("exit")};Transformer.prototype.canRun=function(file){var opts=file.opts;var key=this.key;var blacklist=opts.blacklist;if(blacklist.length&&_.contains(blacklist,key))return false;if(key[0]!=="_"){var whitelist=opts.whitelist;if(whitelist.length&&!_.contains(whitelist,key))return false}return true}},{"../traverse":52,"../types":56,lodash:104}],26:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var go=function(getBody,node,file,scope){var argumentsId;var thisId;var getArgumentsId=function(){return argumentsId=argumentsId||t.identifier(file.generateUid("arguments",scope))};var getThisId=function(){return thisId=thisId||t.identifier(file.generateUid("this",scope))};traverse(node,function(node){var _aliasFunction=node._aliasFunction;if(!_aliasFunction){if(t.isFunction(node)){return false}else{return}}traverse(node,function(node,parent){if(_aliasFunction==="arrows"){if(t.isFunction(node)&&node._aliasFunction!=="arrows"){return false}}if(node._ignoreAliasFunctions)return;var getId;if(t.isIdentifier(node)&&node.name==="arguments"){getId=getArgumentsId}else if(t.isThisExpression(node)){getId=getThisId}else{return}if(t.isReferenced(node,parent))return getId()});return false});var body;var pushDeclaration=function(id,init){body=body||getBody();body.unshift(t.variableDeclaration("var",[t.variableDeclarator(id,init)]))};if(argumentsId){pushDeclaration(argumentsId,t.identifier("arguments"))}if(thisId){pushDeclaration(thisId,t.identifier("this"))}};exports.Program=function(node,parent,file,scope){go(function(){return node.body},node,file,scope)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,parent,file,scope){go(function(){t.ensureBlock(node);return node.body.body},node,file,scope)}},{"../../traverse":52,"../../types":56}],27:[function(require,module,exports){exports.BlockStatement=exports.Program={exit:function(node){var unshift=[];node.body=node.body.filter(function(bodyNode){if(bodyNode._blockHoist){unshift.push(bodyNode);return false}else{return true}});node.body=unshift.concat(node.body)}}},{}],28:[function(require,module,exports){var t=require("../../types");var _=require("lodash");module.exports=function(ast,file){var body=ast.program.body;_.each(file.declarations,function(declar){body.unshift(t.variableDeclaration("var",[t.variableDeclarator(declar.uid,declar.node)]))})}},{"../../types":56,lodash:104}],29:[function(require,module,exports){var transform=require("../transform");exports.ast={exit:function(ast,file){if(!transform.transformers.modules.canRun(file))return;if(file.moduleFormatter.transform){file.moduleFormatter.transform(ast)}}}},{"../transform":24}],30:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");var _=require("lodash");exports.Property=function(node){var key=node.key;if(t.isLiteral(key)&&_.isString(key.value)&&esutils.keyword.isIdentifierName(key.value)){key.type="Identifier";key.name=key.value;delete key.value;node.computed=false}}},{"../../types":56,esutils:103,lodash:104}],31:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var singleArrayExpression=function(node){var block=node.blocks[0];var templateName="array-expression-comprehension-map";if(node.filter)templateName="array-expression-comprehension-filter";var result=util.template(templateName,{STATEMENT:node.body,FILTER:node.filter,ARRAY:block.right,KEY:block.left});result._aliasFunction=true;return result};var multiple=function(node,file){var uid=file.generateUid("arr");var container=util.template("array-comprehension-container",{KEY:uid});container._aliasFunction=true;var block=container.callee.expression.body;var body=block.body;var returnStatement=body.pop();var build=function(){var self=node.blocks.shift();if(!self)return;var child=build();if(!child){child=util.template("array-push",{STATEMENT:node.body,KEY:uid},true);if(node.filter){child=t.ifStatement(node.filter,t.blockStatement([child]))}}return t.forOfStatement(t.variableDeclaration("var",[t.variableDeclarator(self.left)]),self.right,t.blockStatement([child]))};body.push(build());body.push(returnStatement);return container};exports.ComprehensionExpression=function(node,parent,file){if(node.blocks.length===1&&t.isArrayExpression(node.blocks[0].right)){return singleArrayExpression(node)}else{return multiple(node,file)}}},{"../../types":56,"../../util":58}],32:[function(require,module,exports){var t=require("../../types");exports.ArrowFunctionExpression=function(node){t.ensureBlock(node);node._aliasFunction="arrows";node.expression=false;node.type="FunctionExpression";return node}},{"../../types":56}],33:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.ClassDeclaration=function(node,parent,file,scope){return t.variableDeclaration("var",[t.variableDeclarator(node.id,buildClass(node,file,scope))])};exports.ClassExpression=function(node,parent,file,scope){return buildClass(node,file,scope)};var getMemberExpressionObject=function(node){while(t.isMemberExpression(node)){node=node.object}return node};var buildClass=function(node,file,scope){var superName=node.superClass;var className=node.id||t.identifier(file.generateUid("class",scope));var superClassArgument=node.superClass;var superClassCallee=node.superClass;if(superName){if(t.isMemberExpression(superName)){superClassArgument=superClassCallee=getMemberExpressionObject(superName)}else if(!t.isIdentifier(superName)){superClassArgument=superName;superClassCallee=superName=t.identifier(file.generateUid("ref",scope))}}var container=util.template("class",{CLASS_NAME:className});var block=container.callee.expression.body;var body=block.body;var constructor=body[0].declarations[0].init;if(node.id)constructor.id=className;var returnStatement=body.pop();if(superName){body.push(t.expressionStatement(t.callExpression(file.addDeclaration("extends"),[className,superName])));container.arguments.push(superClassArgument);container.callee.expression.params.push(superClassCallee)}buildClassBody({file:file,body:body,node:node,className:className,superName:superName,constructor:constructor});if(body.length===1){return constructor}else{body.push(returnStatement);return container}};var buildClassBody=function(opts){var file=opts.file;var body=opts.body;var node=opts.node;var constructor=opts.constructor;var className=opts.className;var superName=opts.superName;var instanceMutatorMap={};var staticMutatorMap={};var hasConstructor=false;var classBody=node.body.body;_.each(classBody,function(node){var methodName=node.key;var method=node.value;replaceInstanceSuperReferences(superName,node);if(node.key.name==="constructor"){if(node.kind===""){hasConstructor=true;addConstructor(constructor,method)}else{throw file.errorWithNode(node,"illegal kind for constructor method")}}else{var mutatorMap=instanceMutatorMap;if(node.static)mutatorMap=staticMutatorMap;var kind=node.kind;if(kind===""){kind="value";util.pushMutatorMap(mutatorMap,methodName,"writable",t.identifier("true"))}util.pushMutatorMap(mutatorMap,methodName,kind,node)}});if(!hasConstructor&&superName){constructor.body.body.push(util.template("class-super-constructor-call",{SUPER_NAME:superName},true))}var instanceProps;var staticProps;if(!_.isEmpty(instanceMutatorMap)){var protoId=util.template("prototype-identifier",{CLASS_NAME:className});instanceProps=util.buildDefineProperties(instanceMutatorMap,protoId)}if(!_.isEmpty(staticMutatorMap)){staticProps=util.buildDefineProperties(staticMutatorMap,className)}if(instanceProps||staticProps){staticProps=staticProps||t.literal(null);var args=[className,staticProps];if(instanceProps)args.push(instanceProps);body.push(t.expressionStatement(t.callExpression(file.addDeclaration("class-props"),args)))}};var superIdentifier=function(superName,methodNode,node,parent){var methodName=methodNode.key;if(parent.property===node){return}else if(t.isCallExpression(parent,{callee:node})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){return t.memberExpression(superName,t.identifier("call"))}else{node=superName;if(!methodNode.static){node=t.memberExpression(node,t.identifier("prototype"))}node=t.memberExpression(node,methodName,methodNode.computed);return t.memberExpression(node,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode.static){return t.memberExpression(superName,t.identifier("prototype"))}else{return superName}};var replaceInstanceSuperReferences=function(superName,methodNode){var method=methodNode.value;superName=superName||t.identifier("Function");traverse(method,function(node,parent){if(t.isIdentifier(node,{name:"super"})){return superIdentifier(superName,methodNode,node,parent)}else if(t.isCallExpression(node)){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(callee.object.name!=="super")return;callee.property.name=callee.property.name+".call";node.arguments.unshift(t.thisExpression())}})};var addConstructor=function(construct,method){construct.defaults=method.defaults;construct.params=method.params;construct.body=method.body;construct.rest=method.rest;t.inherits(construct,method)}},{"../../traverse":52,"../../types":56,"../../util":58,lodash:104}],34:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.ObjectExpression=function(node,parent,file){var hasComputed=false;var computed=[];node.properties=node.properties.filter(function(prop){if(prop.computed){hasComputed=true;computed.unshift(prop);return false}else{return true}});if(!hasComputed)return;var objId=util.getUid(parent,file);var container=util.template("function-return-obj",{KEY:objId,OBJECT:node});var containerCallee=container.callee.expression;var containerBody=containerCallee.body.body;containerCallee._aliasFunction="arrows";_.each(computed,function(prop){containerBody.unshift(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(objId,prop.key,true),prop.value)))});return container}},{"../../types":56,"../../util":58,lodash:104}],35:[function(require,module,exports){var traverse=require("../../traverse");var t=require("../../types");var _=require("lodash");exports.Program=exports.BlockStatement=exports.ForInStatement=exports.ForOfStatement=exports.ForStatement=function(node,parent,file){var constants=[];var check=function(node,names){_.each(names,function(name){if(constants.indexOf(name)>=0){throw file.errorWithNode(node,name+" is read-only")}})};var getIds=function(node){return t.getIds(node,false,["MemberExpression"])};_.each(node.body,function(child){if(child&&t.isVariableDeclaration(child,{kind:"const"})){_.each(child.declarations,function(declar){_.each(getIds(declar),function(name){check(declar,[name]);constants.push(name)});declar._ignoreConstant=true});child._ignoreConstant=true;child.kind="let"}});if(!constants.length)return;traverse(node,function(child){if(child._ignoreConstant)return;if(t.isVariableDeclarator(child)||t.isDeclaration(child)||t.isAssignmentExpression(child)){check(child,getIds(child))}})}},{"../../traverse":52,"../../types":56,lodash:104}],36:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.Function=function(node){if(!node.defaults.length)return;t.ensureBlock(node);_.each(node.defaults,function(def,i){if(!def)return;var param=node.params[i];node.body.body.unshift(util.template("if-undefined-set-to",{VARIABLE:param,DEFAULT:def},true))});node.defaults=[]}},{"../../types":56,"../../util":58,lodash:104}],37:[function(require,module,exports){var t=require("../../types");var _=require("lodash");var buildVariableAssign=function(kind,id,init){if(kind===false){return t.expressionStatement(t.assignmentExpression("=",id,init))}else{return t.variableDeclaration(kind,[t.variableDeclarator(id,init)])}};var push=function(kind,nodes,elem,parentId){if(t.isObjectPattern(elem)){pushObjectPattern(kind,nodes,elem,parentId)}else if(t.isArrayPattern(elem)){pushArrayPattern(kind,nodes,elem,parentId)}else if(t.isMemberExpression(elem)){nodes.push(buildVariableAssign(false,elem,parentId))}else{nodes.push(buildVariableAssign(kind,elem,parentId))}};var pushObjectPattern=function(kind,nodes,pattern,parentId){_.each(pattern.properties,function(prop){var pattern2=prop.value;var patternId2=t.memberExpression(parentId,prop.key);if(t.isPattern(pattern2)){push(kind,nodes,pattern2,patternId2)}else{nodes.push(buildVariableAssign(kind,pattern2,patternId2))}})};var pushArrayPattern=function(kind,nodes,pattern,parentId){_.each(pattern.elements,function(elem,i){if(!elem)return;var newPatternId;if(t.isSpreadElement(elem)){newPatternId=t.callExpression(t.memberExpression(parentId,t.identifier("slice")),[t.literal(i)]);elem=elem.argument}else{newPatternId=t.memberExpression(parentId,t.literal(i),true)}push(kind,nodes,elem,newPatternId)})};var pushPattern=function(opts){var kind=opts.kind;var nodes=opts.nodes;var pattern=opts.pattern;var parentId=opts.id;var file=opts.file;var scope=opts.scope;if(!t.isMemberExpression(parentId)&&!t.isIdentifier(parentId)){var key=t.identifier(file.generateUid("ref",scope));nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,parentId)]));parentId=key}push(kind,nodes,pattern,parentId)};exports.ForInStatement=exports.ForOfStatement=function(node,parent,file,scope){var declar=node.left;if(!t.isVariableDeclaration(declar))return;var pattern=declar.declarations[0].id;if(!t.isPattern(pattern))return;var key=t.identifier(file.generateUid("ref",scope));node.left=t.variableDeclaration(declar.kind,[t.variableDeclarator(key,null)]);var nodes=[];push(declar.kind,nodes,pattern,key);t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.Function=function(node,parent,file,scope){var nodes=[];var hasDestructuring=false;node.params=node.params.map(function(pattern){if(!t.isPattern(pattern))return pattern;hasDestructuring=true;var parentId=t.identifier(file.generateUid("ref",scope));pushPattern({kind:"var",nodes:nodes,pattern:pattern,id:parentId,file:file,scope:scope});return parentId});if(!hasDestructuring)return;t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.ExpressionStatement=function(node,parent,file,scope){var expr=node.expression;if(expr.type!=="AssignmentExpression")return;if(!t.isPattern(expr.left))return;var nodes=[];var ref=t.identifier(file.generateUid("ref",scope));nodes.push(t.variableDeclaration("var",[t.variableDeclarator(ref,expr.right)]));push(false,nodes,expr.left,ref);return nodes};exports.VariableDeclaration=function(node,parent,file,scope){if(t.isForInStatement(parent)||t.isForOfStatement(parent))return;var nodes=[];var hasPattern=false;_.each(node.declarations,function(declar){if(t.isPattern(declar.id)){hasPattern=true;return false}});if(!hasPattern)return;_.each(node.declarations,function(declar){var patternId=declar.init;var pattern=declar.id;if(t.isPattern(pattern)&&patternId){pushPattern({kind:node.kind,nodes:nodes,pattern:pattern,id:patternId,file:file,scope:scope})}else{nodes.push(buildVariableAssign(node.kind,declar.id,declar.init))}});if(!t.isProgram(parent)&&!t.isBlockStatement(parent)){var declar;_.each(nodes,function(node){declar=declar||t.variableDeclaration(node.kind,[]);if(!t.isVariableDeclaration(node)&&declar.kind!==node.kind){throw file.errorWithNode(node,"Cannot use this node within the current parent")}declar.declarations=declar.declarations.concat(node.declarations)});return declar}return nodes}},{"../../types":56,lodash:104}],38:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.ForOfStatement=function(node,parent,file,scope){var left=node.left;var declar;var stepKey=t.identifier(file.generateUid("step",scope));var stepValueId=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)){declar=t.expressionStatement(t.assignmentExpression("=",left,stepValueId))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValueId)])}else{return}var node2=util.template("for-of",{ITERATOR_KEY:file.generateUid("iterator",scope),STEP_KEY:stepKey,OBJECT:node.right});t.ensureBlock(node);var block=node2.body;block.body.push(declar);block.body=block.body.concat(node.body.body);return node2}},{"../../types":56,"../../util":58}],39:[function(require,module,exports){var regenerator=require("regenerator-6to5");module.exports=regenerator.transform},{"regenerator-6to5":111}],40:[function(require,module,exports){var esutils=require("esutils");var t=require("../../types");var _=require("lodash");var JSX_ANNOTATION_REGEX=/^\*\s*@jsx\s+([^\s]+)/;exports.Program=function(node,parent,file){var jsx="React.DOM";_.each(node.leadingComments,function(comment){var matches=JSX_ANNOTATION_REGEX.exec(comment.value);if(matches)jsx=matches[1]});file.jsx=jsx.split(".").map(t.identifier).reduce(function(object,property){return t.memberExpression(object,property)})};exports.XJSIdentifier=function(node){if(esutils.keyword.isIdentifierName(node.name)){node.type="Identifier"}else{return t.literal(node.name)}};exports.XJSNamespacedName=function(){throw new Error("Namespace tags are not supported. ReactJSX is not XML.")};exports.XJSMemberExpression={exit:function(node){node.computed=t.isLiteral(node.property);node.type="MemberExpression"}};exports.XJSExpressionContainer=function(node){return node.expression};exports.XJSAttribute={exit:function(node){var value=node.value||t.literal(true);return t.property("init",node.name,value)}};exports.XJSOpeningElement={exit:function(node,parent,file){var tagExpr=node.name;if(t.isIdentifier(tagExpr)){var tagName=tagExpr.name;if(/[a-z]/.exec(tagName[0])||_.contains(tagName,"-")){tagExpr=t.memberExpression(file.jsx,tagExpr)}}var props=node.attributes;if(props.length){props=t.objectExpression(props)}else{props=t.literal(null)}return t.callExpression(tagExpr,[props])}};exports.XJSElement={exit:function(node){var callExpr=node.openingElement;var children=node.children;_.each(children,function(child,i){var val=child.value;if(t.isLiteral(child)&&_.isString(val)){val=val.replace(/\n(\s+)/g," ");i=+i;if(i===0)val=val.trimLeft();if(i===children.length-1)val=val.trimRight();if(!val)return;child.value=val}callExpr.arguments.push(child)});return t.inherits(callExpr,node)}}},{"../../types":56,esutils:103,lodash:104}],41:[function(require,module,exports){var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");var isLet=function(node){if(!t.isVariableDeclaration(node))return false;if(node._let)return true;if(node.kind!=="let")return false;node._let=true;node.kind="var";return true};var isVar=function(node){return t.isVariableDeclaration(node,{kind:"var"})&&!isLet(node)};exports.VariableDeclaration=function(node){isLet(node)};exports.For=function(node,parent,file,scope){var init=node.left||node.init;if(isLet(init)){t.ensureBlock(node);node.body._letDeclars=[init]}if(t.isLabeledStatement(parent)){node.label=parent.label}run(node,node.body,parent,file,scope);if(node.label&&!t.isLabeledStatement(parent)){return t.labeledStatement(node.label,node)}};exports.BlockStatement=function(block,parent,file,scope){if(!t.isFor(parent)){run(false,block,parent,file,scope)}};var noClosure=function(letDeclars,block,replacements){standardiseLets(letDeclars);if(_.isEmpty(replacements))return;traverse(block,function(node,parent){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;node.name=replacements[node.name]||node.name})};var standardiseLets=function(declars){_.each(declars,function(declar){delete declar._let})};var getInfo=function(block,file,scope){var opts={outsideKeys:[],declarators:block._letDeclars||[],duplicates:{},keys:[]};_.each(opts.declarators,function(declar){opts.declarators.push(declar);var keys=t.getIds(declar);opts.outsideKeys=opts.outsideKeys.concat(keys);opts.keys=opts.keys.concat(keys)});_.each(block.body,function(declar){if(!isLet(declar))return;_.each(t.getIds(declar,true),function(id,key){var has=scope.parentGet(key);if(has&&has!==id){opts.duplicates[key]=id.name=file.generateUid(key,scope)}opts.keys.push(key)})});return opts};var checkFor=function(forParent,block){var has={hasContinue:false,hasReturn:false,hasBreak:false};if(forParent){traverse(block,function(node){var replace;if(t.isFunction(node)||t.isFor(node)){return false}else if(t.isBreakStatement(node)&&!node.label){has.hasBreak=true;replace=t.returnStatement(t.literal("break"))}else if(t.isContinueStatement(node)&&!node.label){has.hasContinue=true;replace=t.returnStatement(t.literal("continue"))}else if(t.isReturnStatement(node)){has.hasReturn=true;replace=t.returnStatement(t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))]))}if(replace)return t.inherits(replace,node)})}return has};var hoistVarDeclarations=function(block,pushDeclar){traverse(block,function(node){if(t.isForStatement(node)){if(isVar(node.init)){node.init=t.sequenceExpression(pushDeclar(node.init))}}else if(t.isFor(node)){if(isVar(node.left)){node.left=node.left.declarations[0].id}}else if(isVar(node)){return pushDeclar(node).map(t.expressionStatement)}else if(t.isFunction(node)){return false}})};var getParams=function(info,letReferences){var params=_.cloneDeep(letReferences);_.each(params,function(param){param.name=info.duplicates[param.name]||param.name});return params};var getLetReferences=function(block,info,letReferences){var closurify=false;traverse(block,function(node,parent,scope){if(t.isFunction(node)){traverse(node,function(node,parent){if(!t.isIdentifier(node))return;if(!t.isReferenced(node,parent))return;if(scope.hasOwn(node.name))return;closurify=true;if(!_.contains(info.outsideKeys,node.name))return;letReferences[node.name]=node});return false}else if(t.isFor(node)){return false}});return closurify};var buildPushDeclar=function(body){return function(node){body.push(t.variableDeclaration(node.kind,node.declarations.map(function(declar){return t.variableDeclarator(declar.id)})));var replace=[];_.each(node.declarations,function(declar){if(!declar.init)return;var expr=t.assignmentExpression("=",declar.id,declar.init);replace.push(t.inherits(expr,declar))});return replace}};var run=function(forParent,block,parent,file,scope){if(block._letDone)return;block._letDone=true;var info=getInfo(block,file,scope);var declarators=info.declarators;var letKeys=info.keys;if(t.isFunction(parent))return;if(!letKeys.length)return noClosure(declarators,block,info.duplicates);var letReferences={};var closurify=getLetReferences(block,info,letReferences);letReferences=_.values(letReferences);if(!closurify)return noClosure(declarators,block,info.duplicates);var has=checkFor(forParent,block);var body=[];var pushDeclar=buildPushDeclar(body);hoistVarDeclarations(block,pushDeclar);standardiseLets(declarators);var fn=t.functionExpression(null,letReferences,t.blockStatement(block.body));fn._aliasFunction=true;block.body=body;var params=getParams(info,letReferences);var call=t.callExpression(fn,params);var ret=t.identifier(file.generateUid("ret",scope));if(has.hasReturn||has.hasBreak||has.hasContinue){body.push(t.variableDeclaration("var",[t.variableDeclarator(ret,call)]));var retCheck;var cases=[];if(has.hasReturn){retCheck=util.template("let-scoping-return",{RETURN:ret})}if(has.hasBreak||has.hasContinue){var label=forParent.label=forParent.label||t.identifier(file.generateUid("loop",scope));if(has.hasBreak){cases.push(t.switchCase(t.literal("break"),[t.breakStatement(label)]))}if(has.hasContinue){cases.push(t.switchCase(t.literal("continue"),[t.continueStatement(label)]))}if(has.hasReturn){cases.push(t.switchCase(null,[retCheck]))}if(cases.length===1){var single=cases[0];body.push(t.ifStatement(t.binaryExpression("===",ret,single.test),single.consequent[0]))}else{body.push(t.switchStatement(ret,cases))}}else{if(has.hasReturn)body.push(retCheck)}}else{body.push(t.expressionStatement(call))}}},{"../../traverse":52,"../../types":56,"../../util":58,lodash:104}],42:[function(require,module,exports){var _=require("lodash");exports.ImportDeclaration=function(node,parent,file){var nodes=[];if(node.specifiers.length){_.each(node.specifiers,function(specifier){file.moduleFormatter.importSpecifier(specifier,node,nodes)})}else{file.moduleFormatter.import(node,nodes)}return nodes};exports.ExportDeclaration=function(node,parent,file){var nodes=[];if(node.declaration){file.moduleFormatter.export(node,nodes)}else{_.each(node.specifiers,function(specifier){file.moduleFormatter.exportSpecifier(specifier,node,nodes)})}return nodes}},{lodash:104}],43:[function(require,module,exports){var _=require("lodash");exports.Literal=function(node){if(_.isNumber(node.value))delete node.raw}},{lodash:104}],44:[function(require,module,exports){var util=require("../../util");var _=require("lodash");exports.Property=function(node){if(node.method)node.method=false};exports.ObjectExpression=function(node,parent,file){var mutatorMap={};node.properties=node.properties.filter(function(prop){if(prop.kind==="get"||prop.kind==="set"){util.pushMutatorMap(mutatorMap,prop.key,prop.kind,prop.value);return false}else{return true}});if(_.isEmpty(mutatorMap))return;var objId=util.getUid(parent,file);return util.template("object-define-properties-closure",{KEY:objId,OBJECT:node,CONTENT:util.template("object-define-properties",{OBJECT:objId,PROPS:util.buildDefineProperties(mutatorMap)})})}},{"../../util":58,lodash:104}],45:[function(require,module,exports){exports.Property=function(node){if(node.shorthand)node.shorthand=false}},{}],46:[function(require,module,exports){var t=require("../../types");var _=require("lodash");var addDisplayName=function(id,call){if(!call||!t.isCallExpression(call))return;
var callee=call.callee;if(!t.isMemberExpression(callee))return;var obj=callee.object;if(!t.isIdentifier(obj,{name:"React"}))return;var prop=callee.property;if(!t.isIdentifier(prop,{name:"createClass"}))return;var args=call.arguments;if(args.length!==1)return;var first=args[0];if(!t.isObjectExpression(first))return;var props=first.properties;var safe=true;_.each(props,function(prop){if(t.isIdentifier(prop.key,{name:"displayName"})){return safe=false}});if(safe){props.unshift(t.property("init",t.identifier("displayName"),t.literal(id)))}};exports.AssignmentExpression=exports.Property=exports.VariableDeclarator=function(node){var left,right;if(t.isAssignmentExpression(node)){left=node.left;right=node.right}else if(t.isProperty(node)){left=node.key;right=node.value}else if(t.isVariableDeclarator(node)){left=node.id;right=node.init}if(t.isMemberExpression(left)){left=left.property}if(t.isIdentifier(left)){addDisplayName(left.name,right)}}},{"../../types":56,lodash:104}],47:[function(require,module,exports){var util=require("../../util");var t=require("../../types");exports.Function=function(node,parent,file){if(!node.rest)return;var rest=node.rest;delete node.rest;var templateName="arguments-slice-assign";if(node.params.length)templateName+="-arg";t.ensureBlock(node);var template=util.template(templateName,{SLICE_KEY:file.addDeclaration("slice"),VARIABLE_NAME:rest,SLICE_ARG:t.literal(node.params.length)});template.declarations[0].init.arguments[0]._ignoreAliasFunctions=true;node.body.body.unshift(template)}},{"../../types":56,"../../util":58}],48:[function(require,module,exports){var util=require("../../util");var t=require("../../types");var _=require("lodash");var getSpreadLiteral=function(spread,file){var literal=spread.argument;if(!t.isArrayExpression(literal)){literal=util.template("call",{OBJECT:file.addDeclaration("slice"),CONTEXT:literal})}return literal};var hasSpread=function(nodes){var has=false;_.each(nodes,function(node){if(t.isSpreadElement(node)){has=true;return false}});return has};var build=function(props,file){var nodes=[];var _props=[];var push=function(){if(!_props.length)return;nodes.push(t.arrayExpression(_props));_props=[]};_.each(props,function(prop){if(t.isSpreadElement(prop)){push();nodes.push(getSpreadLiteral(prop,file))}else{_props.push(prop)}});push();return nodes};exports.ArrayExpression=function(node,parent,file){var elements=node.elements;if(!hasSpread(elements))return;var nodes=build(elements,file);var first=nodes.shift();if(!nodes.length)return first;return t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)};exports.CallExpression=function(node,parent,file){var args=node.arguments;if(!hasSpread(args))return;var contextLiteral=t.literal(null);node.arguments=[];var nodes=build(args,file);var first=nodes.shift();if(nodes.length){node.arguments.push(t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes))}else{node.arguments.push(first)}var callee=node.callee;if(t.isMemberExpression(callee)){contextLiteral=callee.object;if(callee.computed){callee.object=t.memberExpression(callee.object,callee.property,true);callee.property=t.identifier("apply");callee.computed=false}else{callee.property=t.memberExpression(callee.property,t.identifier("apply"))}}else{node.callee=t.memberExpression(node.callee,t.identifier("apply"))}node.arguments.unshift(contextLiteral)}},{"../../types":56,"../../util":58,lodash:104}],49:[function(require,module,exports){var t=require("../../types");var _=require("lodash");var buildBinaryExpression=function(left,right){return t.binaryExpression("+",left,right)};exports.TaggedTemplateExpression=function(node){var args=[];var quasi=node.quasi;var strings=quasi.quasis.map(function(elem){return t.literal(elem.value.raw)});args.push(t.arrayExpression(strings));_.each(quasi.expressions,function(expr){args.push(expr)});return t.callExpression(node.tag,args)};exports.TemplateLiteral=function(node){var nodes=[];_.each(node.quasis,function(elem){nodes.push(t.literal(elem.value.raw));var expr=node.expressions.shift();if(expr){if(t.isBinary(expr))expr=t.parenthesizedExpression(expr);nodes.push(expr)}});if(nodes.length>1){var last=_.last(nodes);if(t.isLiteral(last,{value:""}))nodes.pop();var root=buildBinaryExpression(nodes.shift(),nodes.shift());_.each(nodes,function(node){root=buildBinaryExpression(root,node)});return root}else{return nodes[0]}}},{"../../types":56,lodash:104}],50:[function(require,module,exports){var rewritePattern=require("regexpu/rewrite-pattern");var _=require("lodash");exports.Literal=function(node){var regex=node.regex;if(!regex)return;var flags=regex.flags.split("");if(!_.contains(regex.flags,"u"))return;_.pull(flags,"u");regex.pattern=rewritePattern(regex.pattern,regex.flags);regex.flags=flags.join("")}},{lodash:104,"regexpu/rewrite-pattern":126}],51:[function(require,module,exports){var t=require("../../types");module.exports=function(ast){var body=ast.program.body;var first=body[0];var noStrict=!first||!t.isExpressionStatement(first)||!t.isLiteral(first.expression)||first.expression.value!=="use strict";if(noStrict){body.unshift(t.expressionStatement(t.literal("use strict")))}}},{"../../types":56}],52:[function(require,module,exports){module.exports=traverse;var Scope=require("./scope");var t=require("../types");var _=require("lodash");function traverse(parent,callbacks,opts){if(!parent)return;if(_.isArray(parent)){_.each(parent,function(node){traverse(node,callbacks,opts)});return}var keys=t.VISITOR_KEYS[parent.type];if(!keys)return;opts=opts||{};if(_.isArray(opts))opts={blacklist:opts};var blacklistTypes=opts.blacklist||[];if(_.isFunction(callbacks))callbacks={enter:callbacks};_.each(keys,function(key){var nodes=parent[key];if(!nodes)return;var handle=function(obj,key){var node=obj[key];if(!node)return;if(_.contains(blacklistTypes,node.type))return;var maybeReplace=function(result){if(result===false)return;if(result!=null)node=obj[key]=result};var opts2=_.clone(opts);if(t.isScope(node))opts2.scope=new Scope(opts.scope,node);if(callbacks.enter){var result=callbacks.enter(node,parent,opts2.scope);maybeReplace(result);if(result===false)return}traverse(node,callbacks,opts2);if(callbacks.exit){maybeReplace(callbacks.exit(node,parent,opts2.scope))}};if(_.isArray(nodes)){_.each(nodes,function(node,i){handle(nodes,i)});parent[key]=_.flatten(parent[key])}else{handle(parent,key)}})}traverse.removeProperties=function(tree){var clear=function(node){delete node.extendedRange;delete node._scopeIds;delete node._parent;delete node.tokens;delete node.range;delete node.start;delete node.end;delete node.loc;delete node.raw;clearComments(node.trailingComments);clearComments(node.leadingComments)};var clearComments=function(comments){_.each(comments,clear)};clear(tree);traverse(tree,clear);return tree};traverse.hasType=function(tree,type,blacklistTypes){blacklistTypes=[].concat(blacklistTypes||[]);var has=false;if(_.contains(blacklistTypes,tree.type))return false;if(tree.type===type)return true;traverse(tree,function(node){if(node.type===type){has=true;return false}},{blacklist:blacklistTypes});return has}},{"../types":56,"./scope":53,lodash:104}],53:[function(require,module,exports){module.exports=Scope;var traverse=require("./index");var t=require("../types");var _=require("lodash");function Scope(parent,block){this.parent=parent;this.block=block;this.ids=this.getIds();this.getIds()}Scope.prototype.getIds=function(){var block=this.block;if(block._scopeIds)return block._scopeIds;var self=this;var ids=block._scopeIds={};if(t.isBlockStatement(block)){_.each(block.body,function(node){if(t.isVariableDeclaration(node)&&node.kind!=="var"){self.add(node,ids)}})}else if(t.isProgram(block)||t.isFunction(block)){traverse(block,function(node,parent){if(parent!==block&&t.isVariableDeclaration(node)&&node.kind!=="var"){return}if(t.isDeclaration(node)){self.add(node,ids)}else if(t.isFunction(node)){return false}})}else if(t.isCatchClause(block)){self.add(block.param,ids)}if(t.isFunction(block)){_.each(block.params,function(param){self.add(param,ids)})}return ids};Scope.prototype.add=function(node,ids){_.merge(ids||this.ids,t.getIds(node,true))};Scope.prototype.get=function(id){return id&&(this.getOwn(id)||this.parentGet(id))};Scope.prototype.getOwn=function(id){return _.has(this.ids,id)&&this.ids[id]};Scope.prototype.parentGet=function(id){return this.parent&&this.parent.get(id)};Scope.prototype.has=function(id){return id&&(this.hasOwn(id)||this.parentHas(id))};Scope.prototype.hasOwn=function(id){return!!this.getOwn(id)};Scope.prototype.parentHas=function(id){return this.parent&&this.parent.has(id)}},{"../types":56,"./index":52,lodash:104}],54:[function(require,module,exports){module.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration"],ImportDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scope","Function"],FunctionDeclaration:["Statement","Declaration","Scope","Function"],FunctionExpression:["Scope","Function"],BlockStatement:["Statement","Scope"],Program:["Scope"],CatchClause:["Scope"],LogicalExpression:["Binary"],BinaryExpression:["Binary"],UnaryExpression:["UnaryLike"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class"],ForOfStatement:["Statement","For"],ForInStatement:["Statement","For"],ForStatement:["Statement","For"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],Property:["UserWhitespacable"]}},{}],55:[function(require,module,exports){module.exports={ArrayExpression:["elements"],AssignmentExpression:["operator","left","right"],BinaryExpression:["operator","left","right"],BlockStatement:["body"],CallExpression:["callee","arguments"],ConditionalExpression:["test","consequent","alternate"],ExpressionStatement:["expression"],File:["program","comments","tokens"],FunctionExpression:["id","params","body"],Identifier:["name"],IfStatement:["test","consequent","alternate"],Literal:["value"],MemberExpression:["object","property","computed"],ObjectExpression:["properties"],ParenthesizedExpression:["expression"],Program:["body"],Property:["kind","key","value","computed"],ReturnStatement:["argument"],SequenceExpression:["expressions"],UnaryExpression:["operator","argument","prefix"],VariableDeclaration:["kind","declarations"],VariableDeclarator:["id","init"]}},{}],56:[function(require,module,exports){var _=require("lodash");var t=exports;t.VISITOR_KEYS=require("./visitor-keys");_.each(t.VISITOR_KEYS,function(keys,type){t["is"+type]=function(node,opts){return node&&node.type===type&&t.shallowEqual(node,opts)}});t.BUILDER_KEYS=_.defaults(require("./builder-keys"),t.VISITOR_KEYS);_.each(t.BUILDER_KEYS,function(keys,type){t[type[0].toLowerCase()+type.slice(1)]=function(){var args=arguments;var node={type:type};_.each(keys,function(key,i){node[key]=args[i]});return node}});t.ALIAS_KEYS=require("./alias-keys");var _aliases={};_.each(t.ALIAS_KEYS,function(aliases,type){_.each(aliases,function(alias){var types=_aliases[alias]=_aliases[alias]||[];types.push(type)})});_.each(_aliases,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;t["is"+type]=function(node,opts){return node&&_.contains(types,node.type)&&t.shallowEqual(node,opts)}});t.shallowEqual=function(actual,expected){var same=true;if(expected){_.each(expected,function(val,key){if(actual[key]!==val){return same=false}})}return same};t.isReferenced=function(node,parent){if(t.isProperty(parent)&&parent.key===node)return false;var isMemberExpression=t.isMemberExpression(parent);var isComputedProperty=isMemberExpression&&parent.property===node&&parent.computed;var isObject=isMemberExpression&&parent.object===node;if(!isMemberExpression||isComputedProperty||isObject)return true;return false};t.toIdentifier=function(name){if(t.isIdentifier(name))return name.name;name=name.replace(/[^a-zA-Z0-9]/g,"-");name=name.replace(/^[-0-9]+/,"");name=name.replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():""});return name};t.ensureBlock=function(node){node.body=t.toBlock(node.body,node)};t.toStatement=function(node,ignore){var mustHaveId=false;var newType;if(t.isClass(node)){mustHaveId=true;newType="ClassDeclaration"}else if(t.isFunction(node)){mustHaveId=true;newType="FunctionDeclaration"}else if(t.isStatement(node)){newType=node.type}if(mustHaveId&&!node.id){newType=false}if(!newType){if(ignore){return false}else{throw new Error("cannot turn "+node.type+" to a statement")}}node.type=newType;return node};t.toBlock=function(node,parent){if(t.isBlockStatement(node)){return node}if(!_.isArray(node)){if(!t.isStatement(node)){if(t.isFunction(parent)){node=t.returnStatement(node)}else{node=t.expressionStatement(node)}}node=[node]}return t.blockStatement(node)};t.getIds=function(node,map,ignoreTypes){ignoreTypes=ignoreTypes||[];var search=[node];var ids={};while(search.length){var id=search.shift();if(!id)continue;if(_.contains(ignoreTypes,id.type))continue;var nodeKey=t.getIds.nodes[id.type];var arrKey=t.getIds.arrays[id.type];if(t.isIdentifier(id)){ids[id.name]=id}else if(nodeKey){if(id[nodeKey])search.push(id[nodeKey])}else if(arrKey){search=search.concat(id[arrKey]||[])}}if(!map)ids=_.keys(ids);return ids};t.getIds.nodes={AssignmentExpression:"left",ImportSpecifier:"id",ExportSpecifier:"id",VariableDeclarator:"id",FunctionDeclaration:"id",ClassDeclaration:"id",ParenthesizedExpression:"expression",MemeberExpression:"object",SpreadElement:"argument",Property:"value"};t.getIds.arrays={ExportDeclaration:"specifiers",ImportDeclaration:"specifiers",VariableDeclaration:"declarations",ArrayPattern:"elements",ObjectPattern:"properties"};t.inherits=function(child,parent){child.loc=parent.loc;child.end=parent.end;child.range=parent.range;child.start=parent.start;return child};t.getSpecifierName=function(specifier){return specifier.name||specifier.id}},{"./alias-keys":54,"./builder-keys":55,"./visitor-keys":57,lodash:104}],57:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AssignmentExpression:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],ParenthesizedExpression:["expression"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],XJSAttribute:["name","value"],XJSClosingElement:["name"],XJSElement:["openingElement","closingElement","children"],XJSEmptyExpression:[],XJSExpressionContainer:["expression"],XJSIdentifier:[],XJSMemberExpression:["object","property"],XJSNamespacedName:["namespace","name"],XJSOpeningElement:["name","attributes"],XJSSpreadAttribute:[],YieldExpression:["argument"]}},{}],58:[function(require,module,exports){(function(Buffer,__dirname){require("./patch");var estraverse=require("estraverse");var traverse=require("./traverse");var acorn=require("acorn-6to5");var path=require("path");var util=require("util");var fs=require("fs");var t=require("./types");var _=require("lodash");exports.inherits=util.inherits;exports.canCompile=function(filename,altExts){var exts=altExts||[".js",".jsx",".es6"];var ext=path.extname(filename);return _.contains(exts,ext)};exports.resolve=function(loc){try{return require.resolve(loc)}catch(err){return null}};exports.list=function(val){return val?val.split(","):[]};exports.getUid=function(parent,file){var node;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}var id="ref";if(t.isIdentifier(node))id=node.name;return t.identifier(file.generateUid(id))};exports.isAbsolute=function(loc){if(!loc)return false;if(loc[0]==="/")return true;if(loc[1]===":"&&loc[2]==="\\")return true;return false};exports.sourceMapToComment=function(map){var json=JSON.stringify(map);var base64=new Buffer(json).toString("base64");return"//# sourceMappingURL=data:application/json;base64,"+base64};exports.pushMutatorMap=function(mutatorMap,key,kind,method){var alias;if(t.isIdentifier(key)){alias=key.name;if(method.computed)alias="computed:"+alias}else if(t.isLiteral(key)){alias=String(key.value)}else{alias=JSON.stringify(traverse.removeProperties(_.cloneDeep(key)))}var map;if(_.has(mutatorMap,alias)){map=mutatorMap[alias]}else{map={}}mutatorMap[alias]=map;map._key=key;if(method.computed){map._computed=true}map[kind]=method};exports.buildDefineProperties=function(mutatorMap){var objExpr=t.objectExpression([]);_.each(mutatorMap,function(map){var mapNode=t.objectExpression([]);var propNode=t.property("init",map._key,mapNode,map._computed);_.each(map,function(node,key){if(key[0]==="_")return;node=_.clone(node);if(t.isMethodDefinition(node))node=node.value;mapNode.properties.push(t.property("init",t.identifier(key),node))});objExpr.properties.push(propNode)});return objExpr};exports.template=function(name,nodes,keepExpression){var template=exports.templates[name];if(!template)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}template=_.cloneDeep(template);var inherits=false;if(nodes){inherits=nodes.inherits;delete nodes.inherits;if(!_.isEmpty(nodes)){traverse(template,function(node){if(t.isIdentifier(node)&&_.has(nodes,node.name)){var newNode=nodes[node.name];if(_.isString(newNode)){node.name=newNode}else{return newNode}}})}}var node=template.body[0];if(!keepExpression&&t.isExpressionStatement(node)){node=node.expression;if(t.isParenthesizedExpression(node))node=node.expression}if(inherits){node=t.inherits(node,inherits)}return node};exports.codeFrame=function(lines,lineNumber,colNumber){colNumber=Math.max(colNumber,0);lines=lines.split("\n");var start=Math.max(lineNumber-3,0);var end=Math.min(lines.length,lineNumber+3);var width=(end+"").length;if(!lineNumber&&!colNumber){start=0;end=lines.length}return"\n"+lines.slice(start,end).map(function(line,i){var curr=i+start+1;var gutter=curr===lineNumber?"> ":" ";var sep=curr+exports.repeat(width+1);gutter+=sep+"| ";var str=gutter+line;if(colNumber&&curr===lineNumber){str+="\n";str+=exports.repeat(gutter.length-2);str+="|"+exports.repeat(colNumber)+"^"}return str}).join("\n")};exports.repeat=function(width,cha){cha=cha||" ";return new Array(width+1).join(cha)};exports.parse=function(opts,code,callback){try{var comments=[];var tokens=[];var ast=acorn.parse(code,{allowReturnOutsideFunction:true,preserveParens:true,ecmaVersion:Infinity,strictMode:true,onComment:comments,locations:true,onToken:tokens,ranges:true});estraverse.attachComments(ast,comments,tokens);ast=t.file(ast,comments,tokens);traverse(ast,function(node,parent){node._parent=parent});if(callback){return callback(ast)}else{return ast}}catch(err){if(!err._6to5){err._6to5=true;var message=opts.filename+": "+err.message;var loc=err.loc;if(loc){var frame=exports.codeFrame(code,loc.line,loc.column);message+=frame}if(err.stack)err.stack=err.stack.replace(err.message,message);err.message=message}throw err}};exports.parseNoProperties=function(loc,code){var ast=exports.parse({filename:loc},code).program;return traverse.removeProperties(ast)};var loadTemplates=function(){var templates={};var templatesLoc=__dirname+"/templates";if(!fs.existsSync(templatesLoc)){throw new Error("no templates directory - this is most likely the "+"result of a broken `npm publish`. Please report to "+"https://githut.com/6to5/6to5/issues")}_.each(fs.readdirSync(templatesLoc),function(name){if(name[0]===".")return;var key=path.basename(name,path.extname(name));var loc=templatesLoc+"/"+name;var code=fs.readFileSync(loc,"utf8");templates[key]=exports.parseNoProperties(loc,code)});return templates};try{exports.templates=require("../../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;Object.defineProperty(exports,"templates",{get:function(){return exports.templates=loadTemplates()}})}}).call(this,require("buffer").Buffer,"/lib/6to5")},{"../../templates.json":137,"./patch":19,"./traverse":52,"./types":56,"acorn-6to5":1,buffer:75,estraverse:99,fs:73,lodash:104,path:82,util:98}],59:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var def=Type.def;var or=Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isNumber=builtin.number;var isBoolean=builtin.boolean;var isRegExp=builtin.RegExp;var shared=require("../lib/shared");var defaults=shared.defaults;var geq=shared.geq;def("Node").field("type",isString).field("loc",or(def("SourceLocation"),null),defaults["null"],true);def("SourceLocation").build("start","end","source").field("start",def("Position")).field("end",def("Position")).field("source",or(isString,null),defaults["null"]);def("Position").build("line","column").field("line",geq(1)).field("column",geq(0));def("Program").bases("Node").build("body").field("body",[def("Statement")]);def("Function").bases("Node").field("id",or(def("Identifier"),null),defaults["null"]).field("params",[def("Pattern")]).field("body",or(def("BlockStatement"),def("Expression")));def("Statement").bases("Node");def("EmptyStatement").bases("Statement").build();def("BlockStatement").bases("Statement").build("body").field("body",[def("Statement")]);def("ExpressionStatement").bases("Statement").build("expression").field("expression",def("Expression"));def("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Statement")).field("alternate",or(def("Statement"),null),defaults["null"]);def("LabeledStatement").bases("Statement").build("label","body").field("label",def("Identifier")).field("body",def("Statement"));def("BreakStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("ContinueStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("WithStatement").bases("Statement").build("object","body").field("object",def("Expression")).field("body",def("Statement"));def("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",def("Expression")).field("cases",[def("SwitchCase")]).field("lexical",isBoolean,defaults["false"]);def("ReturnStatement").bases("Statement").build("argument").field("argument",or(def("Expression"),null));def("ThrowStatement").bases("Statement").build("argument").field("argument",def("Expression"));def("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",def("BlockStatement")).field("handler",or(def("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[def("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[def("CatchClause")],defaults.emptyArray).field("finalizer",or(def("BlockStatement"),null),defaults["null"]);def("CatchClause").bases("Node").build("param","guard","body").field("param",def("Pattern")).field("guard",or(def("Expression"),null),defaults["null"]).field("body",def("BlockStatement"));def("WhileStatement").bases("Statement").build("test","body").field("test",def("Expression")).field("body",def("Statement"));def("DoWhileStatement").bases("Statement").build("body","test").field("body",def("Statement")).field("test",def("Expression"));def("ForStatement").bases("Statement").build("init","test","update","body").field("init",or(def("VariableDeclaration"),def("Expression"),null)).field("test",or(def("Expression"),null)).field("update",or(def("Expression"),null)).field("body",def("Statement"));def("ForInStatement").bases("Statement").build("left","right","body","each").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement")).field("each",isBoolean);def("DebuggerStatement").bases("Statement").build();def("Declaration").bases("Statement");def("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",def("Identifier"));def("FunctionExpression").bases("Function","Expression").build("id","params","body");def("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",or("var","let","const")).field("declarations",[or(def("VariableDeclarator"),def("Identifier"))]);def("VariableDeclarator").bases("Node").build("id","init").field("id",def("Pattern")).field("init",or(def("Expression"),null));def("Expression").bases("Node","Pattern");def("ThisExpression").bases("Expression").build();def("ArrayExpression").bases("Expression").build("elements").field("elements",[or(def("Expression"),null)]);def("ObjectExpression").bases("Expression").build("properties").field("properties",[def("Property")]);def("Property").bases("Node").build("kind","key","value").field("kind",or("init","get","set")).field("key",or(def("Literal"),def("Identifier"))).field("value",def("Expression"));def("SequenceExpression").bases("Expression").build("expressions").field("expressions",[def("Expression")]);var UnaryOperator=or("-","+","!","~","typeof","void","delete");def("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",UnaryOperator).field("argument",def("Expression")).field("prefix",isBoolean,defaults["true"]);var BinaryOperator=or("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");def("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",BinaryOperator).field("left",def("Expression")).field("right",def("Expression"));var AssignmentOperator=or("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");def("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",AssignmentOperator).field("left",def("Pattern")).field("right",def("Expression"));var UpdateOperator=or("++","--");def("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",UpdateOperator).field("argument",def("Expression")).field("prefix",isBoolean);var LogicalOperator=or("||","&&");def("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",LogicalOperator).field("left",def("Expression")).field("right",def("Expression"));def("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Expression")).field("alternate",def("Expression"));def("NewExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("CallExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("MemberExpression").bases("Expression").build("object","property","computed").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("Pattern").bases("Node");def("ObjectPattern").bases("Pattern").build("properties").field("properties",[def("PropertyPattern")]);def("PropertyPattern").bases("Pattern").build("key","pattern").field("key",or(def("Literal"),def("Identifier"))).field("pattern",def("Pattern"));def("ArrayPattern").bases("Pattern").build("elements").field("elements",[or(def("Pattern"),null)]);def("SwitchCase").bases("Node").build("test","consequent").field("test",or(def("Expression"),null)).field("consequent",[def("Statement")]);def("Identifier").bases("Node","Expression","Pattern").build("name").field("name",isString);def("Literal").bases("Node","Expression").build("value").field("value",or(isString,isBoolean,null,isNumber,isRegExp))},{"../lib/shared":70,"../lib/types":71}],60:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;def("XMLDefaultDeclaration").bases("Declaration").field("namespace",def("Expression"));def("XMLAnyName").bases("Expression");def("XMLQualifiedIdentifier").bases("Expression").field("left",or(def("Identifier"),def("XMLAnyName"))).field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLAttributeSelector").bases("Expression").field("attribute",def("Expression"));def("XMLFilterExpression").bases("Expression").field("left",def("Expression")).field("right",def("Expression"));def("XMLElement").bases("XML","Expression").field("contents",[def("XML")]);def("XMLList").bases("XML","Expression").field("contents",[def("XML")]);def("XML").bases("Node");def("XMLEscape").bases("XML").field("expression",def("Expression"));def("XMLText").bases("XML").field("text",isString);def("XMLStartTag").bases("XML").field("contents",[def("XML")]);def("XMLEndTag").bases("XML").field("contents",[def("XML")]);def("XMLPointTag").bases("XML").field("contents",[def("XML")]);def("XMLName").bases("XML").field("contents",or(isString,[def("XML")]));def("XMLAttribute").bases("XML").field("value",isString);def("XMLCdata").bases("XML").field("contents",isString);def("XMLComment").bases("XML").field("contents",isString);def("XMLProcessingInstruction").bases("XML").field("target",isString).field("contents",or(isString,null))},{"../lib/types":71,"./core":59}],61:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var isObject=builtin.object;var isString=builtin.string;var defaults=require("../lib/shared").defaults;def("Function").field("generator",isBoolean,defaults["false"]).field("expression",isBoolean,defaults["false"]).field("defaults",[or(def("Expression"),null)],defaults.emptyArray).field("rest",or(def("Identifier"),null),defaults["null"]);
def("FunctionDeclaration").build("id","params","body","generator","expression");def("FunctionExpression").build("id","params","body","generator","expression");def("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,defaults["null"]).field("generator",false);def("YieldExpression").bases("Expression").build("argument","delegate").field("argument",or(def("Expression"),null)).field("delegate",isBoolean,defaults["false"]);def("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionBlock").bases("Node").build("left","right","each").field("left",def("Pattern")).field("right",def("Expression")).field("each",isBoolean);def("ModuleSpecifier").bases("Literal").build("value").field("value",isString);def("Property").field("method",isBoolean,defaults["false"]).field("shorthand",isBoolean,defaults["false"]).field("computed",isBoolean,defaults["false"]);def("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",or("init","get","set","")).field("key",or(def("Literal"),def("Identifier"))).field("value",def("Function"));def("SpreadElement").bases("Node").build("argument").field("argument",def("Expression"));def("ArrayExpression").field("elements",[or(def("Expression"),def("SpreadElement"),null)]);def("NewExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("CallExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("SpreadElementPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));var ClassBodyElement=or(def("MethodDefinition"),def("VariableDeclarator"),def("ClassPropertyDefinition"),def("ClassProperty"));def("ClassProperty").bases("Declaration").build("id").field("id",def("Identifier"));def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",ClassBodyElement);def("ClassBody").bases("Declaration").build("body").field("body",[ClassBodyElement]);def("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",def("Identifier")).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("ClassExpression").bases("Expression").build("id","body","superClass").field("id",or(def("Identifier"),null),defaults["null"]).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("Specifier").bases("Node");def("NamedSpecifier").bases("Specifier").field("id",def("Identifier")).field("name",or(def("Identifier"),null),defaults["null"]);def("ExportSpecifier").bases("NamedSpecifier").build("id","name");def("ExportBatchSpecifier").bases("Specifier").build();def("ImportSpecifier").bases("NamedSpecifier").build("id","name");def("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",isBoolean).field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"),def("ExportBatchSpecifier"))],defaults.emptyArray).field("source",or(def("ModuleSpecifier"),null),defaults["null"]);def("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[or(def("ImportSpecifier"),def("ImportNamespaceSpecifier"),def("ImportDefaultSpecifier"))],defaults.emptyArray).field("source",def("ModuleSpecifier"));def("TaggedTemplateExpression").bases("Expression").field("tag",def("Expression")).field("quasi",def("TemplateLiteral"));def("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[def("TemplateElement")]).field("expressions",[def("Expression")]);def("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:isString,raw:isString}).field("tail",isBoolean)},{"../lib/shared":70,"../lib/types":71,"./core":59}],62:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("Function").field("async",isBoolean,defaults["false"]);def("SpreadProperty").bases("Node").build("argument").field("argument",def("Expression"));def("ObjectExpression").field("properties",[or(def("Property"),def("SpreadProperty"))]);def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ObjectPattern").field("properties",[or(def("PropertyPattern"),def("SpreadPropertyPattern"))]);def("AwaitExpression").bases("Expression").build("argument","all").field("argument",or(def("Expression"),null)).field("all",isBoolean,defaults["false"])},{"../lib/shared":70,"../lib/types":71,"./core":59}],63:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("XJSAttribute").bases("Node").build("name","value").field("name",or(def("XJSIdentifier"),def("XJSNamespacedName"))).field("value",or(def("Literal"),def("XJSExpressionContainer"),null),defaults["null"]);def("XJSIdentifier").bases("Node").build("name").field("name",isString);def("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",def("XJSIdentifier")).field("name",def("XJSIdentifier"));def("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",or(def("XJSIdentifier"),def("XJSMemberExpression"))).field("property",def("XJSIdentifier")).field("computed",isBoolean,defaults.false);var XJSElementName=or(def("XJSIdentifier"),def("XJSNamespacedName"),def("XJSMemberExpression"));def("XJSSpreadAttribute").bases("Node").build("argument").field("argument",def("Expression"));var XJSAttributes=[or(def("XJSAttribute"),def("XJSSpreadAttribute"))];def("XJSExpressionContainer").bases("Expression").build("expression").field("expression",def("Expression"));def("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",def("XJSOpeningElement")).field("closingElement",or(def("XJSClosingElement"),null),defaults["null"]).field("children",[or(def("XJSElement"),def("XJSExpressionContainer"),def("XJSText"),def("Literal"))],defaults.emptyArray).field("name",XJSElementName,function(){return this.openingElement.name}).field("selfClosing",isBoolean,function(){return this.openingElement.selfClosing}).field("attributes",XJSAttributes,function(){return this.openingElement.attributes});def("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",XJSElementName).field("attributes",XJSAttributes,defaults.emptyArray).field("selfClosing",isBoolean,defaults["false"]);def("XJSClosingElement").bases("Node").build("name").field("name",XJSElementName);def("XJSText").bases("Literal").build("value").field("value",isString);def("XJSEmptyExpression").bases("Expression").build();def("TypeAnnotatedIdentifier").bases("Pattern").build("annotation","identifier").field("annotation",def("TypeAnnotation")).field("identifier",def("Identifier"));def("TypeAnnotation").bases("Pattern").build("annotatedType","templateTypes","paramTypes","returnType","unionType","nullable").field("annotatedType",def("Identifier")).field("templateTypes",or([def("TypeAnnotation")],null)).field("paramTypes",or([def("TypeAnnotation")],null)).field("returnType",or(def("TypeAnnotation"),null)).field("unionType",or(def("TypeAnnotation"),null)).field("nullable",isBoolean);def("Identifier").field("annotation",or(def("TypeAnnotation"),null),defaults["null"]);def("Function").field("returnType",or(def("TypeAnnotation"),null),defaults["null"]);def("ClassProperty").field("id",or(def("Identifier"),def("TypeAnnotatedIdentifier")))},{"../lib/shared":70,"../lib/types":71,"./core":59}],64:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var geq=require("../lib/shared").geq;def("ForOfStatement").bases("Statement").build("left","right","body").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement"));def("LetStatement").bases("Statement").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Statement"));def("LetExpression").bases("Expression").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Expression"));def("GraphExpression").bases("Expression").build("index","expression").field("index",geq(0)).field("expression",def("Literal"));def("GraphIndexExpression").bases("Expression").build("index").field("index",geq(0))},{"../lib/shared":70,"../lib/types":71,"./core":59}],65:[function(require,module,exports){var assert=require("assert");var types=require("../main");var getFieldNames=types.getFieldNames;var getFieldValue=types.getFieldValue;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isDate=types.builtInTypes.Date;var isRegExp=types.builtInTypes.RegExp;var hasOwn=Object.prototype.hasOwnProperty;function astNodesAreEquivalent(a,b,problemPath){if(isArray.check(problemPath)){problemPath.length=0}else{problemPath=null}return areEquivalent(a,b,problemPath)}astNodesAreEquivalent.assert=function(a,b){var problemPath=[];if(!astNodesAreEquivalent(a,b,problemPath)){if(problemPath.length===0){assert.strictEqual(a,b)}else{assert.ok(false,"Nodes differ in the following path: "+problemPath.map(subscriptForProperty).join(""))}}};function subscriptForProperty(property){if(/[_$a-z][_$a-z0-9]*/i.test(property)){return"."+property}return"["+JSON.stringify(property)+"]"}function areEquivalent(a,b,problemPath){if(a===b){return true}if(isArray.check(a)){return arraysAreEquivalent(a,b,problemPath)}if(isObject.check(a)){return objectsAreEquivalent(a,b,problemPath)}if(isDate.check(a)){return isDate.check(b)&&+a===+b}if(isRegExp.check(a)){return isRegExp.check(b)&&(a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.ignoreCase===b.ignoreCase)}return a==b}function arraysAreEquivalent(a,b,problemPath){isArray.assert(a);var aLength=a.length;if(!isArray.check(b)||b.length!==aLength){if(problemPath){problemPath.push("length")}return false}for(var i=0;i<aLength;++i){if(problemPath){problemPath.push(i)}if(i in a!==i in b){return false}if(!areEquivalent(a[i],b[i],problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),i)}}return true}function objectsAreEquivalent(a,b,problemPath){isObject.assert(a);if(!isObject.check(b)){return false}if(a.type!==b.type){if(problemPath){problemPath.push("type")}return false}var aNames=getFieldNames(a);var aNameCount=aNames.length;var bNames=getFieldNames(b);var bNameCount=bNames.length;if(aNameCount===bNameCount){for(var i=0;i<aNameCount;++i){var name=aNames[i];var aChild=getFieldValue(a,name);var bChild=getFieldValue(b,name);if(problemPath){problemPath.push(name)}if(!areEquivalent(aChild,bChild,problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),name)}}return true}if(!problemPath){return false}var seenNames=Object.create(null);for(i=0;i<aNameCount;++i){seenNames[aNames[i]]=true}for(i=0;i<bNameCount;++i){name=bNames[i];if(!hasOwn.call(seenNames,name)){problemPath.push(name);return false}delete seenNames[name]}for(name in seenNames){problemPath.push(name);break}return false}module.exports=astNodesAreEquivalent},{"../main":72,assert:74}],66:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var isNumber=types.builtInTypes.number;var isArray=types.builtInTypes.array;var Path=require("./path");var Scope=require("./scope");function NodePath(value,parentPath,name){assert.ok(this instanceof NodePath);Path.call(this,value,parentPath,name)}require("util").inherits(NodePath,Path);var NPp=NodePath.prototype;Object.defineProperties(NPp,{node:{get:function(){Object.defineProperty(this,"node",{configurable:true,value:this._computeNode()});return this.node}},parent:{get:function(){Object.defineProperty(this,"parent",{configurable:true,value:this._computeParent()});return this.parent}},scope:{get:function(){Object.defineProperty(this,"scope",{configurable:true,value:this._computeScope()});return this.scope}}});NPp.replace=function(){delete this.node;delete this.parent;delete this.scope;return Path.prototype.replace.apply(this,arguments)};NPp.prune=function(){var remainingNodePath=this.parent;this.replace();if(n.VariableDeclaration.check(remainingNodePath.node)){var declarations=remainingNodePath.get("declarations").value;if(!declarations||declarations.length===0){return remainingNodePath.prune()}}else if(n.ExpressionStatement.check(remainingNodePath.node)){if(!remainingNodePath.get("expression").value){return remainingNodePath.prune()}}return remainingNodePath};NPp._computeNode=function(){var value=this.value;if(n.Node.check(value)){return value}var pp=this.parentPath;return pp&&pp.node||null};NPp._computeParent=function(){var value=this.value;var pp=this.parentPath;if(!n.Node.check(value)){while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}if(pp){pp=pp.parentPath}}while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}return pp||null};NPp._computeScope=function(){var value=this.value;var pp=this.parentPath;var scope=pp&&pp.scope;if(n.Node.check(value)&&Scope.isEstablishedBy(value)){scope=new Scope(this,scope)}return scope||null};NPp.getValueProperty=function(name){return types.getFieldValue(this.value,name)};NPp.needsParens=function(assumeExpressionContext){if(!this.parent)return false;var node=this.node;if(node!==this.value)return false;var parent=this.parent.node;assert.notStrictEqual(node,parent);if(!n.Expression.check(node))return false;if(isUnaryLike(node))return n.MemberExpression.check(parent)&&this.name==="object"&&parent.object===node;if(isBinary(node)){if(n.CallExpression.check(parent)&&this.name==="callee"){assert.strictEqual(parent.callee,node);return true}if(isUnaryLike(parent))return true;if(n.MemberExpression.check(parent)&&this.name==="object"){assert.strictEqual(parent.object,node);return true}if(isBinary(parent)){var po=parent.operator;var pp=PRECEDENCE[po];var no=node.operator;var np=PRECEDENCE[no];if(pp>np){return true}if(pp===np&&this.name==="right"){assert.strictEqual(parent.right,node);return true}}}if(n.SequenceExpression.check(node)){if(n.ForStatement.check(parent)){return false}if(n.ExpressionStatement.check(parent)&&this.name==="expression"){return false}return true}if(n.YieldExpression.check(node))return isBinary(parent)||n.CallExpression.check(parent)||n.MemberExpression.check(parent)||n.NewExpression.check(parent)||n.ConditionalExpression.check(parent)||isUnaryLike(parent)||n.YieldExpression.check(parent);if(n.NewExpression.check(parent)&&this.name==="callee"){assert.strictEqual(parent.callee,node);return containsCallExpression(node)}if(n.Literal.check(node)&&isNumber.check(node.value)&&n.MemberExpression.check(parent)&&this.name==="object"){assert.strictEqual(parent.object,node);return true}if(n.AssignmentExpression.check(node)||n.ConditionalExpression.check(node)){if(isUnaryLike(parent))return true;if(isBinary(parent))return true;if(n.CallExpression.check(parent)&&this.name==="callee"){assert.strictEqual(parent.callee,node);return true}if(n.ConditionalExpression.check(parent)&&this.name==="test"){assert.strictEqual(parent.test,node);return true}if(n.MemberExpression.check(parent)&&this.name==="object"){assert.strictEqual(parent.object,node);return true}}if(assumeExpressionContext!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function isBinary(node){return n.BinaryExpression.check(node)||n.LogicalExpression.check(node)}function isUnaryLike(node){return n.UnaryExpression.check(node)||n.SpreadElement&&n.SpreadElement.check(node)||n.SpreadProperty&&n.SpreadProperty.check(node)}var PRECEDENCE={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(tier,i){tier.forEach(function(op){PRECEDENCE[op]=i})});function containsCallExpression(node){if(n.CallExpression.check(node)){return true}if(isArray.check(node)){return node.some(containsCallExpression)}if(n.Node.check(node)){return types.someField(node,function(name,child){return containsCallExpression(child)})}return false}NPp.canBeFirstInStatement=function(){var node=this.node;return!n.FunctionExpression.check(node)&&!n.ObjectExpression.check(node)};NPp.firstInStatement=function(){return firstInStatement(this)};function firstInStatement(path){for(var node,parent;path.parent;path=path.parent){node=path.node;parent=path.parent.node;if(n.BlockStatement.check(parent)&&path.parent.name==="body"&&path.name===0){assert.strictEqual(parent.body[0],node);return true}if(n.ExpressionStatement.check(parent)&&path.name==="expression"){assert.strictEqual(parent.expression,node);return true}if(n.SequenceExpression.check(parent)&&path.parent.name==="expressions"&&path.name===0){assert.strictEqual(parent.expressions[0],node);continue}if(n.CallExpression.check(parent)&&path.name==="callee"){assert.strictEqual(parent.callee,node);continue}if(n.MemberExpression.check(parent)&&path.name==="object"){assert.strictEqual(parent.object,node);continue}if(n.ConditionalExpression.check(parent)&&path.name==="test"){assert.strictEqual(parent.test,node);continue}if(isBinary(parent)&&path.name==="left"){assert.strictEqual(parent.left,node);continue}if(n.UnaryExpression.check(parent)&&!parent.prefix&&path.name==="argument"){assert.strictEqual(parent.argument,node);continue}return false}return true}module.exports=NodePath},{"./path":68,"./scope":69,"./types":71,assert:74,util:98}],67:[function(require,module,exports){var assert=require("assert");var types=require("./types");var NodePath=require("./node-path");var Node=types.namedTypes.Node;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isFunction=types.builtInTypes.function;var hasOwn=Object.prototype.hasOwnProperty;var undefined;function PathVisitor(){assert.ok(this instanceof PathVisitor);this._reusableContextStack=[];this._methodNameTable=computeMethodNameTable(this);this.Context=makeContextConstructor(this)}function computeMethodNameTable(visitor){var typeNames=Object.create(null);for(var methodName in visitor){if(/^visit[A-Z]/.test(methodName)){typeNames[methodName.slice("visit".length)]=true}}var supertypeTable=types.computeSupertypeLookupTable(typeNames);var methodNameTable=Object.create(null);for(var typeName in supertypeTable){if(hasOwn.call(supertypeTable,typeName)){methodName="visit"+supertypeTable[typeName];if(isFunction.check(visitor[methodName])){methodNameTable[typeName]=methodName}}}return methodNameTable}PathVisitor.fromMethodsObject=function fromMethodsObject(methods){if(methods instanceof PathVisitor){return methods}if(!isObject.check(methods)){return new PathVisitor}function Visitor(){assert.ok(this instanceof Visitor);PathVisitor.call(this)}var Vp=Visitor.prototype=Object.create(PVp);Vp.constructor=Visitor;extend(Vp,methods);extend(Visitor,PathVisitor);isFunction.assert(Visitor.fromMethodsObject);isFunction.assert(Visitor.visit);return new Visitor};function extend(target,source){for(var property in source){if(hasOwn.call(source,property)){target[property]=source[property]}}return target}PathVisitor.visit=function visit(node,methods){var visitor=PathVisitor.fromMethodsObject(methods);if(node instanceof NodePath){visitor.visit(node);return node.value}var rootPath=new NodePath({root:node});visitor.visit(rootPath.get("root"));return rootPath.value.root};var PVp=PathVisitor.prototype;PVp.visit=function(path){if(this instanceof this.Context){return this.visitor.visit(path)}assert.ok(path instanceof NodePath);var value=path.value;var methodName=Node.check(value)&&this._methodNameTable[value.type];if(methodName){var context=this.acquireContext(path);try{context.invokeVisitorMethod(methodName)}finally{this.releaseContext(context)}}else{visitChildren(path,this)}};function visitChildren(path,visitor){assert.ok(path instanceof NodePath);assert.ok(visitor instanceof PathVisitor);var value=path.value;if(isArray.check(value)){path.each(visitor.visit,visitor)}else if(!isObject.check(value)){}else{var childNames=types.getFieldNames(value);var childCount=childNames.length;var childPaths=[];for(var i=0;i<childCount;++i){var childName=childNames[i];if(!hasOwn.call(value,childName)){value[childName]=types.getFieldValue(value,childName)}childPaths.push(path.get(childName))}for(var i=0;i<childCount;++i){visitor.visit(childPaths[i])}}}PVp.acquireContext=function(path){if(this._reusableContextStack.length===0){return new this.Context(path)}return this._reusableContextStack.pop().reset(path)};PVp.releaseContext=function(context){assert.ok(context instanceof this.Context);this._reusableContextStack.push(context);context.currentPath=null};function makeContextConstructor(visitor){function Context(path){assert.ok(this instanceof Context);assert.ok(this instanceof PathVisitor);assert.ok(path instanceof NodePath);Object.defineProperty(this,"visitor",{value:visitor,writable:false,enumerable:true,configurable:false});this.currentPath=path;this.needToCallTraverse=true;Object.seal(this)}assert.ok(visitor instanceof PathVisitor);var Cp=Context.prototype=Object.create(visitor);Cp.constructor=Context;extend(Cp,sharedContextProtoMethods);return Context}var sharedContextProtoMethods=Object.create(null);sharedContextProtoMethods.reset=function reset(path){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);this.currentPath=path;this.needToCallTraverse=true;return this};sharedContextProtoMethods.invokeVisitorMethod=function invokeVisitorMethod(methodName){assert.ok(this instanceof this.Context);assert.ok(this.currentPath instanceof NodePath);var result=this.visitor[methodName].call(this,this.currentPath);if(result===false){this.needToCallTraverse=false}else if(result!==undefined){this.currentPath=this.currentPath.replace(result)[0];if(this.needToCallTraverse){this.traverse(this.currentPath)}}assert.strictEqual(this.needToCallTraverse,false,"Must either call this.traverse or return false in "+methodName)};sharedContextProtoMethods.traverse=function traverse(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;visitChildren(path,PathVisitor.fromMethodsObject(newVisitor||this.visitor))};module.exports=PathVisitor},{"./node-path":66,"./types":71,assert:74}],68:[function(require,module,exports){var assert=require("assert");var Op=Object.prototype;var hasOwn=Op.hasOwnProperty;var types=require("./types");var isArray=types.builtInTypes.array;var isNumber=types.builtInTypes.number;var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;function Path(value,parentPath,name){assert.ok(this instanceof Path);if(parentPath){assert.ok(parentPath instanceof Path)}else{parentPath=null;name=null}this.value=value;this.parentPath=parentPath;this.name=name;this.__childCache=null}var Pp=Path.prototype;function getChildCache(path){return path.__childCache||(path.__childCache=Object.create(null))}function getChildPath(path,name){var cache=getChildCache(path);var actualChildValue=path.getValueProperty(name);var childPath=cache[name];if(!hasOwn.call(cache,name)||childPath.value!==actualChildValue){childPath=cache[name]=new path.constructor(actualChildValue,path,name)}return childPath}Pp.getValueProperty=function getValueProperty(name){return this.value[name]};Pp.get=function get(name){var path=this;var names=arguments;var count=names.length;for(var i=0;i<count;++i){path=getChildPath(path,names[i])}return path};Pp.each=function each(callback,context){var childPaths=[];var len=this.value.length;var i=0;for(var i=0;i<len;++i){if(hasOwn.call(this.value,i)){childPaths[i]=this.get(i)}}context=context||this;for(i=0;i<len;++i){if(hasOwn.call(childPaths,i)){callback.call(context,childPaths[i])}}};Pp.map=function map(callback,context){var result=[];this.each(function(childPath){result.push(callback.call(this,childPath))},context);return result};Pp.filter=function filter(callback,context){var result=[];this.each(function(childPath){if(callback.call(this,childPath)){result.push(childPath)}},context);return result};function emptyMoves(){}function getMoves(path,offset,start,end){isArray.assert(path.value);if(offset===0){return emptyMoves}var length=path.value.length;if(length<1){return emptyMoves}var argc=arguments.length;if(argc===2){start=0;end=length}else if(argc===3){start=Math.max(start,0);end=length}else{start=Math.max(start,0);end=Math.min(end,length)}isNumber.assert(start);isNumber.assert(end);var moves=Object.create(null);var cache=getChildCache(path);for(var i=start;i<end;++i){if(hasOwn.call(path.value,i)){var childPath=path.get(i);assert.strictEqual(childPath.name,i);var newIndex=i+offset;childPath.name=newIndex;moves[newIndex]=childPath;delete cache[i]}}delete cache.length;return function(){for(var newIndex in moves){var childPath=moves[newIndex];assert.strictEqual(childPath.name,+newIndex);cache[newIndex]=childPath;path.value[newIndex]=childPath.value}}}Pp.shift=function shift(){var move=getMoves(this,-1);var result=this.value.shift();move();return result};Pp.unshift=function unshift(node){var move=getMoves(this,arguments.length);var result=this.value.unshift.apply(this.value,arguments);move();return result};Pp.push=function push(node){isArray.assert(this.value);delete getChildCache(this).length;return this.value.push.apply(this.value,arguments)};Pp.pop=function pop(){isArray.assert(this.value);var cache=getChildCache(this);delete cache[this.value.length-1];delete cache.length;return this.value.pop()};Pp.insertAt=function insertAt(index,node){var argc=arguments.length;var move=getMoves(this,argc-1,index);if(move===emptyMoves){return this}index=Math.max(index,0);for(var i=1;i<argc;++i){this.value[index+i-1]=arguments[i]}move();return this};Pp.insertBefore=function insertBefore(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};Pp.insertAfter=function insertAfter(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name+1];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};function repairRelationshipWithParent(path){assert.ok(path instanceof Path);var pp=path.parentPath;if(!pp){return path}var parentValue=pp.value;var parentCache=getChildCache(pp);if(parentValue[path.name]===path.value){parentCache[path.name]=path}else if(isArray.check(parentValue)){var i=parentValue.indexOf(path.value);if(i>=0){parentCache[path.name=i]=path}}else{parentValue[path.name]=path.value;parentCache[path.name]=path}assert.strictEqual(parentValue[path.name],path.value);assert.strictEqual(path.parentPath.get(path.name),path);return path}Pp.replace=function replace(replacement){var results=[];var parentValue=this.parentPath.value;var parentCache=getChildCache(this.parentPath);var count=arguments.length;repairRelationshipWithParent(this);if(isArray.check(parentValue)){var originalLength=parentValue.length;var move=getMoves(this.parentPath,count-1,this.name+1);var spliceArgs=[this.name,1];for(var i=0;i<count;++i){spliceArgs.push(arguments[i])}var splicedOut=parentValue.splice.apply(parentValue,spliceArgs);assert.strictEqual(splicedOut[0],this.value);assert.strictEqual(parentValue.length,originalLength-1+count);move();if(count===0){delete this.value;delete parentCache[this.name];this.__childCache=null}else{assert.strictEqual(parentValue[this.name],replacement);if(this.value!==replacement){this.value=replacement;this.__childCache=null}for(i=0;i<count;++i){results.push(this.parentPath.get(this.name+i))}assert.strictEqual(results[0],this)}}else if(count===1){if(this.value!==replacement){this.__childCache=null}this.value=parentValue[this.name]=replacement;results.push(this)}else if(count===0){delete parentValue[this.name];delete this.value;this.__childCache=null}else{assert.ok(false,"Could not replace path")}return results};module.exports=Path},{"./types":71,assert:74}],69:[function(require,module,exports){var assert=require("assert");var types=require("./types");var Type=types.Type;var namedTypes=types.namedTypes;var Node=namedTypes.Node;var isArray=types.builtInTypes.array;var hasOwn=Object.prototype.hasOwnProperty;var b=types.builders;function Scope(path,parentScope){assert.ok(this instanceof Scope);assert.ok(path instanceof require("./node-path"));ScopeType.assert(path.value);var depth;if(parentScope){assert.ok(parentScope instanceof Scope);depth=parentScope.depth+1}else{parentScope=null;depth=0}Object.defineProperties(this,{path:{value:path},node:{value:path.value},isGlobal:{value:!parentScope,enumerable:true},depth:{value:depth},parent:{value:parentScope},bindings:{value:{}}})}var scopeTypes=[namedTypes.Program,namedTypes.Function,namedTypes.CatchClause];var ScopeType=Type.or.apply(Type,scopeTypes);Scope.isEstablishedBy=function(node){return ScopeType.check(node)};var Sp=Scope.prototype;Sp.didScan=false;Sp.declares=function(name){this.scan();return hasOwn.call(this.bindings,name)};Sp.declareTemporary=function(prefix){if(prefix){assert.ok(/^[a-z$_]/i.test(prefix),prefix)}else{prefix="t$"}prefix+=this.depth.toString(36)+"$";this.scan();var index=0;while(this.declares(prefix+index)){++index}var name=prefix+index;return this.bindings[name]=types.builders.identifier(name)};Sp.injectTemporary=function(identifier,init){identifier||(identifier=this.declareTemporary());var bodyPath=this.path.get("body");if(namedTypes.BlockStatement.check(bodyPath.value)){bodyPath=bodyPath.get("body")}bodyPath.unshift(b.variableDeclaration("var",[b.variableDeclarator(identifier,init||null)]));return identifier};Sp.scan=function(force){if(force||!this.didScan){for(var name in this.bindings){delete this.bindings[name]}scanScope(this.path,this.bindings);this.didScan=true}};Sp.getBindings=function(){this.scan();return this.bindings};function scanScope(path,bindings){var node=path.value;ScopeType.assert(node);if(namedTypes.CatchClause.check(node)){addPattern(path.get("param"),bindings)}else{recursiveScanScope(path,bindings)}}function recursiveScanScope(path,bindings){var node=path.value;if(path.parent&&namedTypes.FunctionExpression.check(path.parent.node)&&path.parent.node.id){addPattern(path.parent.get("id"),bindings)}if(!node){}else if(isArray.check(node)){path.each(function(childPath){recursiveScanChild(childPath,bindings)})}else if(namedTypes.Function.check(node)){path.get("params").each(function(paramPath){addPattern(paramPath,bindings)});recursiveScanChild(path.get("body"),bindings)}else if(namedTypes.VariableDeclarator.check(node)){addPattern(path.get("id"),bindings);recursiveScanChild(path.get("init"),bindings)}else if(node.type==="ImportSpecifier"||node.type==="ImportNamespaceSpecifier"||node.type==="ImportDefaultSpecifier"){addPattern(node.name?path.get("name"):path.get("id"),bindings)}else if(Node.check(node)){types.eachField(node,function(name,child){var childPath=path.get(name);assert.strictEqual(childPath.value,child);recursiveScanChild(childPath,bindings)})}}function recursiveScanChild(path,bindings){var node=path.value;if(!node){}else if(namedTypes.FunctionDeclaration.check(node)){addPattern(path.get("id"),bindings)
}else if(namedTypes.ClassDeclaration&&namedTypes.ClassDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(Scope.isEstablishedBy(node)){if(namedTypes.CatchClause.check(node)){var catchParamName=node.param.name;var hadBinding=hasOwn.call(bindings,catchParamName);recursiveScanScope(path.get("body"),bindings);if(!hadBinding){delete bindings[catchParamName]}}}else{recursiveScanScope(path,bindings)}}function addPattern(patternPath,bindings){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern);if(namedTypes.Identifier.check(pattern)){if(hasOwn.call(bindings,pattern.name)){bindings[pattern.name].push(patternPath)}else{bindings[pattern.name]=[patternPath]}}else if(namedTypes.SpreadElement&&namedTypes.SpreadElement.check(pattern)){addPattern(patternPath.get("argument"),bindings)}}Sp.lookup=function(name){for(var scope=this;scope;scope=scope.parent)if(scope.declares(name))break;return scope};Sp.getGlobalScope=function(){var scope=this;while(!scope.isGlobal)scope=scope.parent;return scope};module.exports=Scope},{"./node-path":66,"./types":71,assert:74}],70:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var builtin=types.builtInTypes;var isNumber=builtin.number;exports.geq=function(than){return new Type(function(value){return isNumber.check(value)&&value>=than},isNumber+" >= "+than)};exports.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined);exports.isPrimitive=new Type(function(value){if(value===null)return true;var type=typeof value;return!(type==="object"||type==="function")},naiveIsPrimitive.toString())},{"../lib/types":71}],71:[function(require,module,exports){var assert=require("assert");var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;var each=Ap.forEach;var Op=Object.prototype;var objToStr=Op.toString;var funObjStr=objToStr.call(function(){});var strObjStr=objToStr.call("");var hasOwn=Op.hasOwnProperty;function Type(check,name){var self=this;assert.ok(self instanceof Type,self);assert.strictEqual(objToStr.call(check),funObjStr,check+" is not a function");var nameObjStr=objToStr.call(name);assert.ok(nameObjStr===funObjStr||nameObjStr===strObjStr,name+" is neither a function nor a string");Object.defineProperties(self,{name:{value:name},check:{value:function(value,deep){var result=check.call(self,value,deep);if(!result&&deep&&objToStr.call(deep)===funObjStr)deep(self,value);return result}}})}var Tp=Type.prototype;exports.Type=Type;Tp.assert=function(value,deep){if(!this.check(value,deep)){var str=shallowStringify(value);assert.ok(false,str+" does not match type "+this);return false}return true};function shallowStringify(value){if(isObject.check(value))return"{"+Object.keys(value).map(function(key){return key+": "+value[key]}).join(", ")+"}";if(isArray.check(value))return"["+value.map(shallowStringify).join(", ")+"]";return JSON.stringify(value)}Tp.toString=function(){var name=this.name;if(isString.check(name))return name;if(isFunction.check(name))return name.call(this)+"";return name+" type"};var builtInTypes={};exports.builtInTypes=builtInTypes;function defBuiltInType(example,name){var objStr=objToStr.call(example);Object.defineProperty(builtInTypes,name,{enumerable:true,value:new Type(function(value){return objToStr.call(value)===objStr},name)});return builtInTypes[name]}var isString=defBuiltInType("","string");var isFunction=defBuiltInType(function(){},"function");var isArray=defBuiltInType([],"array");var isObject=defBuiltInType({},"object");var isRegExp=defBuiltInType(/./,"RegExp");var isDate=defBuiltInType(new Date,"Date");var isNumber=defBuiltInType(3,"number");var isBoolean=defBuiltInType(true,"boolean");var isNull=defBuiltInType(null,"null");var isUndefined=defBuiltInType(void 0,"undefined");function toType(from,name){if(from instanceof Type)return from;if(from instanceof Def)return from.type;if(isArray.check(from))return Type.fromArray(from);if(isObject.check(from))return Type.fromObject(from);if(isFunction.check(from))return new Type(from,name);return new Type(function(value){return value===from},isUndefined.check(name)?function(){return from+""}:name)}Type.or=function(){var types=[];var len=arguments.length;for(var i=0;i<len;++i)types.push(toType(arguments[i]));return new Type(function(value,deep){for(var i=0;i<len;++i)if(types[i].check(value,deep))return true;return false},function(){return types.join(" | ")})};Type.fromArray=function(arr){assert.ok(isArray.check(arr));assert.strictEqual(arr.length,1,"only one element type is permitted for typed arrays");return toType(arr[0]).arrayOf()};Tp.arrayOf=function(){var elemType=this;return new Type(function(value,deep){return isArray.check(value)&&value.every(function(elem){return elemType.check(elem,deep)})},function(){return"["+elemType+"]"})};Type.fromObject=function(obj){var fields=Object.keys(obj).map(function(name){return new Field(name,obj[name])});return new Type(function(value,deep){return isObject.check(value)&&fields.every(function(field){return field.type.check(value[field.name],deep)})},function(){return"{ "+fields.join(", ")+" }"})};function Field(name,type,defaultFn,hidden){var self=this;assert.ok(self instanceof Field);isString.assert(name);type=toType(type);var properties={name:{value:name},type:{value:type},hidden:{value:!!hidden}};if(isFunction.check(defaultFn)){properties.defaultFn={value:defaultFn}}Object.defineProperties(self,properties)}var Fp=Field.prototype;Fp.toString=function(){return JSON.stringify(this.name)+": "+this.type};Fp.getValue=function(obj){var value=obj[this.name];if(!isUndefined.check(value))return value;if(this.defaultFn)value=this.defaultFn.call(obj);return value};Type.def=function(typeName){isString.assert(typeName);return hasOwn.call(defCache,typeName)?defCache[typeName]:defCache[typeName]=new Def(typeName)};var defCache=Object.create(null);function Def(typeName){var self=this;assert.ok(self instanceof Def);Object.defineProperties(self,{typeName:{value:typeName},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new Type(function(value,deep){return self.check(value,deep)},typeName)}})}Def.fromValue=function(value){if(value&&typeof value==="object"){var type=value.type;if(typeof type==="string"&&hasOwn.call(defCache,type)){var d=defCache[type];if(d.finalized){return d}}}return null};var Dp=Def.prototype;Dp.isSupertypeOf=function(that){if(that instanceof Def){assert.strictEqual(this.finalized,true);assert.strictEqual(that.finalized,true);return hasOwn.call(that.allSupertypes,this.typeName)}else{assert.ok(false,that+" is not a Def")}};exports.getSupertypeNames=function(typeName){assert.ok(hasOwn.call(defCache,typeName));var d=defCache[typeName];assert.strictEqual(d.finalized,true);return d.supertypeList.slice(1)};exports.computeSupertypeLookupTable=function(candidates){var table={};for(var typeName in defCache){if(hasOwn.call(defCache,typeName)){var d=defCache[typeName];assert.strictEqual(d.finalized,true);for(var i=0;i<d.supertypeList.length;++i){var superTypeName=d.supertypeList[i];if(hasOwn.call(candidates,superTypeName)){table[typeName]=superTypeName;break}}}}return table};Dp.checkAllFields=function(value,deep){var allFields=this.allFields;assert.strictEqual(this.finalized,true);function checkFieldByName(name){var field=allFields[name];var type=field.type;var child=field.getValue(value);return type.check(child,deep)}return isObject.check(value)&&Object.keys(allFields).every(checkFieldByName)};Dp.check=function(value,deep){assert.strictEqual(this.finalized,true,"prematurely checking unfinalized type "+this.typeName);if(!isObject.check(value))return false;var vDef=Def.fromValue(value);if(!vDef){if(this.typeName==="SourceLocation"||this.typeName==="Position"){return this.checkAllFields(value,deep)}return false}if(deep&&vDef===this)return this.checkAllFields(value,deep);if(!this.isSupertypeOf(vDef))return false;if(!deep)return true;return vDef.checkAllFields(value,deep)&&this.checkAllFields(value,false)};Dp.bases=function(){var bases=this.baseNames;assert.strictEqual(this.finalized,false);each.call(arguments,function(baseName){isString.assert(baseName);if(bases.indexOf(baseName)<0)bases.push(baseName)});return this};Object.defineProperty(Dp,"buildable",{value:false});var builders={};exports.builders=builders;var nodePrototype={};exports.defineMethod=function(name,func){var old=nodePrototype[name];if(isUndefined.check(func)){delete nodePrototype[name]}else{isFunction.assert(func);Object.defineProperty(nodePrototype,name,{enumerable:true,configurable:true,value:func})}return old};Dp.build=function(){var self=this;Object.defineProperty(self,"buildParams",{value:slice.call(arguments),writable:false,enumerable:false,configurable:true});assert.strictEqual(self.finalized,false);isString.arrayOf().assert(self.buildParams);if(self.buildable){return self}self.field("type",self.typeName,function(){return self.typeName});Object.defineProperty(self,"buildable",{value:true});Object.defineProperty(builders,getBuilderName(self.typeName),{enumerable:true,value:function(){var args=arguments;var argc=args.length;var built=Object.create(nodePrototype);assert.ok(self.finalized,"attempting to instantiate unfinalized type "+self.typeName);function add(param,i){if(hasOwn.call(built,param))return;var all=self.allFields;assert.ok(hasOwn.call(all,param),param);var field=all[param];var type=field.type;var value;if(isNumber.check(i)&&i<argc){value=args[i]}else if(field.defaultFn){value=field.defaultFn.call(built)}else{var message="no value or default function given for field "+JSON.stringify(param)+" of "+self.typeName+"("+self.buildParams.map(function(name){return all[name]}).join(", ")+")";assert.ok(false,message)}assert.ok(type.check(value),shallowStringify(value)+" does not match field "+field+" of type "+self.typeName);built[param]=value}self.buildParams.forEach(function(param,i){add(param,i)});Object.keys(self.allFields).forEach(function(param){add(param)});assert.strictEqual(built.type,self.typeName);return built}});return self};function getBuilderName(typeName){return typeName.replace(/^[A-Z]+/,function(upperCasePrefix){var len=upperCasePrefix.length;switch(len){case 0:return"";case 1:return upperCasePrefix.toLowerCase();default:return upperCasePrefix.slice(0,len-1).toLowerCase()+upperCasePrefix.charAt(len-1)}})}Dp.field=function(name,type,defaultFn,hidden){assert.strictEqual(this.finalized,false);this.ownFields[name]=new Field(name,type,defaultFn,hidden);return this};var namedTypes={};exports.namedTypes=namedTypes;function getFieldNames(object){var d=Def.fromValue(object);if(d){return d.fieldNames.slice(0)}assert.strictEqual("type"in object,false,"did not recognize object of type "+JSON.stringify(object.type));return Object.keys(object)}exports.getFieldNames=getFieldNames;function getFieldValue(object,fieldName){var d=Def.fromValue(object);if(d){var field=d.allFields[fieldName];if(field){return field.getValue(object)}}return object[fieldName]}exports.getFieldValue=getFieldValue;exports.eachField=function(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name))},context)};exports.someField=function(object,callback,context){return getFieldNames(object).some(function(name){return callback.call(this,name,getFieldValue(object,name))},context)};Object.defineProperty(Dp,"finalized",{value:false});Dp.finalize=function(){if(!this.finalized){var allFields=this.allFields;var allSupertypes=this.allSupertypes;this.baseNames.forEach(function(name){var def=defCache[name];def.finalize();extend(allFields,def.allFields);extend(allSupertypes,def.allSupertypes)});extend(allFields,this.ownFields);allSupertypes[this.typeName]=this;this.fieldNames.length=0;for(var fieldName in allFields){if(hasOwn.call(allFields,fieldName)&&!allFields[fieldName].hidden){this.fieldNames.push(fieldName)}}Object.defineProperty(namedTypes,this.typeName,{enumerable:true,value:this.type});Object.defineProperty(this,"finalized",{value:true});populateSupertypeList(this.typeName,this.supertypeList)}};function populateSupertypeList(typeName,list){list.length=0;list.push(typeName);var lastSeen=Object.create(null);for(var pos=0;pos<list.length;++pos){typeName=list[pos];var d=defCache[typeName];assert.strictEqual(d.finalized,true);if(hasOwn.call(lastSeen,typeName)){delete list[lastSeen[typeName]]}lastSeen[typeName]=pos;list.push.apply(list,d.baseNames)}for(var to=0,from=to,len=list.length;from<len;++from){if(hasOwn.call(list,from)){list[to++]=list[from]}}list.length=to}function extend(into,from){Object.keys(from).forEach(function(name){into[name]=from[name]});return into}exports.finalize=function(){Object.keys(defCache).forEach(function(name){defCache[name].finalize()})}},{assert:74}],72:[function(require,module,exports){var types=require("./lib/types");require("./def/core");require("./def/es6");require("./def/es7");require("./def/mozilla");require("./def/e4x");require("./def/fb-harmony");types.finalize();exports.Type=types.Type;exports.builtInTypes=types.builtInTypes;exports.namedTypes=types.namedTypes;exports.builders=types.builders;exports.defineMethod=types.defineMethod;exports.getFieldNames=types.getFieldNames;exports.getFieldValue=types.getFieldValue;exports.eachField=types.eachField;exports.someField=types.someField;exports.getSupertypeNames=types.getSupertypeNames;exports.astNodesAreEquivalent=require("./lib/equiv");exports.finalize=types.finalize;exports.NodePath=require("./lib/node-path");exports.PathVisitor=require("./lib/path-visitor");exports.visit=exports.PathVisitor.visit},{"./def/core":59,"./def/e4x":60,"./def/es6":61,"./def/es7":62,"./def/fb-harmony":63,"./def/mozilla":64,"./lib/equiv":65,"./lib/node-path":66,"./lib/path-visitor":67,"./lib/types":71}],73:[function(require,module,exports){},{}],74:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&(isNaN(value)||!isFinite(value))){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(isArguments(a)){if(!isArguments(b)){return false}a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}try{var ka=objectKeys(a),kb=objectKeys(b),key,i}catch(e){return false}if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":98}],75:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=Buffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string),buf,offset,length);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function binarySlice(buf,start,end){return asciiSlice(buf,start,end)}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;if(Buffer.TYPED_ARRAY_SUPPORT){return Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;var newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}return newBuf}};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;
this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;if(end<start)throw new TypeError("sourceEnd < sourceStart");if(target_start<0||target_start>=target.length)throw new TypeError("targetStart out of bounds");if(start<0||start>=source.length)throw new TypeError("sourceStart out of bounds");if(end<0||end>source.length)throw new TypeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new TypeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new TypeError("start out of bounds");if(end<0||end>this.length)throw new TypeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){var b=str.charCodeAt(i);if(b<=127){byteArray.push(b)}else{var start=i;if(b>=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j<h.length;j++){byteArray.push(parseInt(h[j],16))}}}return byteArray}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":76,ieee754:77,"is-array":78}],76:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],77:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],78:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],79:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],80:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],81:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],82:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:83}],83:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],84:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":85}],85:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":87,"./_stream_writable":89,_process:83,"core-util-is":90,inherits:80}],86:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":88,"core-util-is":90,inherits:80}],87:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;
state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:83,buffer:75,"core-util-is":90,events:79,inherits:80,isarray:81,stream:95,"string_decoder/":96}],88:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":85,"core-util-is":90,inherits:80}],89:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":85,_process:83,buffer:75,"core-util-is":90,inherits:80,stream:95}],90:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:75}],91:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":86}],92:[function(require,module,exports){var Stream=require("stream");exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=Stream;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":85,"./lib/_stream_passthrough.js":86,"./lib/_stream_readable.js":87,"./lib/_stream_transform.js":88,"./lib/_stream_writable.js":89,stream:95}],93:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":88}],94:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":89}],95:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:79,inherits:80,"readable-stream/duplex.js":84,"readable-stream/passthrough.js":91,"readable-stream/readable.js":92,"readable-stream/transform.js":93,"readable-stream/writable.js":94}],96:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";while(this.charLength){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){return""}buffer=buffer.slice(available,buffer.length);charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:75}],97:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],98:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":97,_process:83,inherits:80}],99:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.estraverse={})}})(this,function(exports){"use strict";var Syntax,isArray,VisitorOption,VisitorKeys,objectCreate,objectKeys,BREAK,SKIP,REMOVE;function ignoreJSHintError(){}isArray=Array.isArray;if(!isArray){isArray=function isArray(array){return Object.prototype.toString.call(array)==="[object Array]"}}function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val)}else{ret[key]=val}}}return ret}function shallowCopy(obj){var ret={},key;for(key in obj){if(obj.hasOwnProperty(key)){ret[key]=obj[key]}}return ret}ignoreJSHintError(shallowCopy);function upperBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){len=diff}else{i=current+1;len-=diff+1}}return i}function lowerBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){i=current+1;len-=diff+1}else{len=diff}}return i}ignoreJSHintError(lowerBound);objectCreate=Object.create||function(){function F(){}return function(o){F.prototype=o;return new F}}();objectKeys=Object.keys||function(o){var keys=[],key;for(key in o){keys.push(key)}return keys};function extend(to,from){objectKeys(from).forEach(function(key){to[key]=from[key]});return to}Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};
BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key}Reference.prototype.replace=function replace(node){this.parent[this.key]=node};Reference.prototype.remove=function remove(){if(isArray(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref}function Controller(){}Controller.prototype.path=function path(){var i,iz,j,jz,result,element;function addToPath(result,path){if(isArray(path)){for(j=0,jz=path.length;j<jz;++j){result.push(path[j])}}else{result.push(path)}}if(!this.__current.path){return null}result=[];for(i=2,iz=this.__leavelist.length;i<iz;++i){element=this.__leavelist[i];addToPath(result,element.path)}addToPath(result,this.__current.path);return result};Controller.prototype.parents=function parents(){var i,iz,result;result=[];for(i=1,iz=this.__leavelist.length;i<iz;++i){result.push(this.__leavelist[i].node)}return result};Controller.prototype.current=function current(){return this.__current.node};Controller.prototype.__execute=function __execute(callback,element){var previous,result;result=undefined;previous=this.__current;this.__current=element;this.__state=null;if(callback){result=callback.call(this,element.node,this.__leavelist[this.__leavelist.length-1].node)}this.__current=previous;return result};Controller.prototype.notify=function notify(flag){this.__state=flag};Controller.prototype.skip=function(){this.notify(SKIP)};Controller.prototype["break"]=function(){this.notify(BREAK)};Controller.prototype.remove=function(){this.notify(REMOVE)};Controller.prototype.__initialize=function(root,visitor){this.visitor=visitor;this.root=root;this.__worklist=[];this.__leavelist=[];this.__current=null;this.__state=null;this.__fallback=visitor.fallback==="iteration";this.__keys=VisitorKeys;if(visitor.keys){this.__keys=extend(objectCreate(this.__keys),visitor.keys)}};function isNode(node){if(node==null){return false}return typeof node==="object"&&typeof node.type==="string"}function isProperty(nodeType,key){return(nodeType===Syntax.ObjectExpression||nodeType===Syntax.ObjectPattern)&&"properties"===key}Controller.prototype.traverse=function traverse(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return}continue}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue}node=element.node;nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null)}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null)}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,null))}}}}};Controller.prototype.replace=function replace(root,visitor){function removeElem(){var i,nextElem,parent;if(element.ref.remove()){parent=element.ref.parent;for(i=1;i<worklist.length;i++){nextElem=worklist[i];if(nextElem===sentinel||nextElem.ref.parent!==parent){break}nextElem.path[nextElem.path.length-1]=--nextElem.ref.key}}}var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;outer={root:root};element=new Element(root,null,null,new Reference(outer,"root"));worklist.push(element);leavelist.push(element);while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();target=this.__execute(visitor.leave,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target)}if(this.__state===REMOVE||target===REMOVE){removeElem()}if(this.__state===BREAK||target===BREAK){return outer.root}continue}target=this.__execute(visitor.enter,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target);element.node=target}if(this.__state===REMOVE||target===REMOVE){removeElem();element.node=null}if(this.__state===BREAK||target===BREAK){return outer.root}node=element.node;if(!node){continue}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||target===SKIP){continue}nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2))}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2))}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)))}}}return outer.root};function traverse(root,visitor){var controller=new Controller;return controller.traverse(root,visitor)}function replace(root,visitor){var controller=new Controller;return controller.replace(root,visitor)}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0]});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0]}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1]}return comment}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i,cursor;if(!tree.range){throw new Error("attachComments needs range information")}if(!tokens.length){if(providedComments.length){for(i=0,len=providedComments.length;i<len;i+=1){comment=deepCopy(providedComments[i]);comment.extendedRange=[0,tree.range[0]];comments.push(comment)}tree.leadingComments=comments}return tree}for(i=0,len=providedComments.length;i<len;i+=1){comments.push(extendCommentRange(deepCopy(providedComments[i]),tokens))}cursor=0;traverse(tree,{enter:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(comment.extendedRange[1]>node.range[0]){break}if(comment.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[]}node.leadingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});cursor=0;traverse(tree,{leave:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(node.range[1]<comment.extendedRange[0]){break}if(node.range[1]===comment.extendedRange[0]){if(!node.trailingComments){node.trailingComments=[]}node.trailingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});return tree}exports.version="1.5.1-dev";exports.Syntax=Syntax;exports.traverse=traverse;exports.replace=replace;exports.attachComments=attachComments;exports.VisitorKeys=VisitorKeys;exports.VisitorOption=VisitorOption;exports.Controller=Controller})},{}],100:[function(require,module,exports){(function(){"use strict";function isExpression(node){if(node==null){return false}switch(node.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function isIterationStatement(node){if(node==null){return false}switch(node.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function isStatement(node){if(node==null){return false}switch(node.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function isSourceElement(node){return isStatement(node)||node!=null&&node.type==="FunctionDeclaration"}function trailingStatement(node){switch(node.type){case"IfStatement":if(node.alternate!=null){return node.alternate}return node.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return node.body}return null}function isProblematicIfStatement(node){var current;if(node.type!=="IfStatement"){return false}if(node.alternate==null){return false}current=node.consequent;do{if(current.type==="IfStatement"){if(current.alternate==null){return true}}current=trailingStatement(current)}while(current);return false}module.exports={isExpression:isExpression,isStatement:isStatement,isIterationStatement:isIterationStatement,isSourceElement:isSourceElement,isProblematicIfStatement:isProblematicIfStatement,trailingStatement:trailingStatement}})()},{}],101:[function(require,module,exports){(function(){"use strict";var Regex;Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return isDecimalDigit(ch)||97<=ch&&ch<=102||65<=ch&&ch<=70}function isOctalDigit(ch){return ch>=48&&ch<=55}function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(ch)>=0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}module.exports={isDecimalDigit:isDecimalDigit,isHexDigit:isHexDigit,isOctalDigit:isOctalDigit,isWhiteSpace:isWhiteSpace,isLineTerminator:isLineTerminator,isIdentifierStart:isIdentifierStart,isIdentifierPart:isIdentifierPart}})()},{}],102:[function(require,module,exports){(function(){"use strict";var code=require("./code");function isStrictModeReservedWordES6(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function isKeywordES5(id,strict){if(!strict&&id==="yield"){return false}return isKeywordES6(id,strict)}function isKeywordES6(id,strict){if(strict&&isStrictModeReservedWordES6(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function isReservedWordES5(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES5(id,strict)}function isReservedWordES6(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES6(id,strict)}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isIdentifierName(id){var i,iz,ch;if(id.length===0){return false}ch=id.charCodeAt(0);if(!code.isIdentifierStart(ch)||ch===92){return false}for(i=1,iz=id.length;i<iz;++i){ch=id.charCodeAt(i);if(!code.isIdentifierPart(ch)||ch===92){return false}}return true}function isIdentifierES5(id,strict){return isIdentifierName(id)&&!isReservedWordES5(id,strict)}function isIdentifierES6(id,strict){return isIdentifierName(id)&&!isReservedWordES6(id,strict)}module.exports={isKeywordES5:isKeywordES5,isKeywordES6:isKeywordES6,isReservedWordES5:isReservedWordES5,isReservedWordES6:isReservedWordES6,isRestrictedWord:isRestrictedWord,isIdentifierName:isIdentifierName,isIdentifierES5:isIdentifierES5,isIdentifierES6:isIdentifierES6}})()},{"./code":101}],103:[function(require,module,exports){(function(){"use strict";exports.ast=require("./ast");exports.code=require("./code");exports.keyword=require("./keyword")})()},{"./ast":100,"./code":101,"./keyword":102}],104:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;
if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;
text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],105:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var isArray=types.builtInTypes.array;var b=types.builders;var n=types.namedTypes;var leap=require("./leap");var meta=require("./meta");var runtimeProperty=require("./util").runtimeProperty;var runtimeKeysMethod=runtimeProperty("keys");var hasOwn=Object.prototype.hasOwnProperty;function Emitter(contextId){assert.ok(this instanceof Emitter);n.Identifier.assert(contextId);Object.defineProperties(this,{contextId:{value:contextId},listing:{value:[]},marked:{value:[true]},finalLoc:{value:loc()},tryEntries:{value:[]}});Object.defineProperties(this,{leapManager:{value:new leap.LeapManager(this)}})}var Ep=Emitter.prototype;exports.Emitter=Emitter;function loc(){return b.literal(-1)}Ep.mark=function(loc){n.Literal.assert(loc);var index=this.listing.length;if(loc.value===-1){loc.value=index}else{assert.strictEqual(loc.value,index)}this.marked[index]=true;return loc};Ep.emit=function(node){if(n.Expression.check(node))node=b.expressionStatement(node);n.Statement.assert(node);this.listing.push(node)};Ep.emitAssign=function(lhs,rhs){this.emit(this.assign(lhs,rhs));return lhs};Ep.assign=function(lhs,rhs){return b.expressionStatement(b.assignmentExpression("=",lhs,rhs))};Ep.contextProperty=function(name){return b.memberExpression(this.contextId,b.identifier(name),false)};var volatileContextPropertyNames={prev:true,next:true,sent:true,rval:true};Ep.isVolatileContextProperty=function(expr){if(n.MemberExpression.check(expr)){if(expr.computed){return true}if(n.Identifier.check(expr.object)&&n.Identifier.check(expr.property)&&expr.object.name===this.contextId.name&&hasOwn.call(volatileContextPropertyNames,expr.property.name)){return true}}return false};Ep.stop=function(rval){if(rval){this.setReturnValue(rval)}this.jump(this.finalLoc)};Ep.setReturnValue=function(valuePath){n.Expression.assert(valuePath.value);this.emitAssign(this.contextProperty("rval"),this.explodeExpression(valuePath))};Ep.clearPendingException=function(tryLoc,assignee){n.Literal.assert(tryLoc);var catchCall=b.callExpression(this.contextProperty("catch"),[tryLoc]);if(assignee){this.emitAssign(assignee,catchCall)}else{this.emit(catchCall)}};Ep.jump=function(toLoc){this.emitAssign(this.contextProperty("next"),toLoc);this.emit(b.breakStatement())};Ep.jumpIf=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);this.emit(b.ifStatement(test,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};Ep.jumpIfNot=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);var negatedTest;if(n.UnaryExpression.check(test)&&test.operator==="!"){negatedTest=test.argument}else{negatedTest=b.unaryExpression("!",test)}this.emit(b.ifStatement(negatedTest,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};var nextTempId=0;Ep.makeTempVar=function(){return this.contextProperty("t"+nextTempId++)};Ep.getContextFunction=function(id){return b.functionExpression(id||null,[this.contextId],b.blockStatement([this.getDispatchLoop()]),false,false)};Ep.getDispatchLoop=function(){var self=this;var cases=[];var current;var alreadyEnded=false;self.listing.forEach(function(stmt,i){if(self.marked.hasOwnProperty(i)){cases.push(b.switchCase(b.literal(i),current=[]));alreadyEnded=false}if(!alreadyEnded){current.push(stmt);if(isSwitchCaseEnder(stmt))alreadyEnded=true}});this.finalLoc.value=this.listing.length;cases.push(b.switchCase(this.finalLoc,[]),b.switchCase(b.literal("end"),[b.returnStatement(b.callExpression(this.contextProperty("stop"),[]))]));return b.whileStatement(b.literal(1),b.switchStatement(b.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),cases))};function isSwitchCaseEnder(stmt){return n.BreakStatement.check(stmt)||n.ContinueStatement.check(stmt)||n.ReturnStatement.check(stmt)||n.ThrowStatement.check(stmt)}Ep.getTryEntryList=function(){if(this.tryEntries.length===0){return null}var lastLocValue=0;return b.arrayExpression(this.tryEntries.map(function(tryEntry){var thisLocValue=tryEntry.firstLoc.value;assert.ok(thisLocValue>=lastLocValue,"try entries out of order");lastLocValue=thisLocValue;var ce=tryEntry.catchEntry;var fe=tryEntry.finallyEntry;var triple=[tryEntry.firstLoc,ce?ce.firstLoc:null];if(fe){triple[2]=fe.firstLoc}return b.arrayExpression(triple)}))};Ep.explode=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var node=path.value;var self=this;n.Node.assert(node);if(n.Statement.check(node))return self.explodeStatement(path);if(n.Expression.check(node))return self.explodeExpression(path,ignoreResult);if(n.Declaration.check(node))throw getDeclError(node);switch(node.type){case"Program":return path.get("body").map(self.explodeStatement,self);case"VariableDeclarator":throw getDeclError(node);case"Property":case"SwitchCase":case"CatchClause":throw new Error(node.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(node.type))}};function getDeclError(node){return new Error("all declarations should have been transformed into "+"assignments before the Exploder began its work: "+JSON.stringify(node))}Ep.explodeStatement=function(path,labelId){assert.ok(path instanceof types.NodePath);var stmt=path.value;var self=this;n.Statement.assert(stmt);if(labelId){n.Identifier.assert(labelId)}else{labelId=null}if(n.BlockStatement.check(stmt)){return path.get("body").each(self.explodeStatement,self)}if(!meta.containsLeap(stmt)){self.emit(stmt);return}switch(stmt.type){case"ExpressionStatement":self.explodeExpression(path.get("expression"),true);break;case"LabeledStatement":self.explodeStatement(path.get("body"),stmt.label);break;case"WhileStatement":var before=loc();var after=loc();self.mark(before);self.jumpIfNot(self.explodeExpression(path.get("test")),after);self.leapManager.withEntry(new leap.LoopEntry(after,before,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(before);self.mark(after);break;case"DoWhileStatement":var first=loc();var test=loc();var after=loc();self.mark(first);self.leapManager.withEntry(new leap.LoopEntry(after,test,labelId),function(){self.explode(path.get("body"))});self.mark(test);self.jumpIf(self.explodeExpression(path.get("test")),first);self.mark(after);break;case"ForStatement":var head=loc();var update=loc();var after=loc();if(stmt.init){self.explode(path.get("init"),true)}self.mark(head);if(stmt.test){self.jumpIfNot(self.explodeExpression(path.get("test")),after)}else{}self.leapManager.withEntry(new leap.LoopEntry(after,update,labelId),function(){self.explodeStatement(path.get("body"))});self.mark(update);if(stmt.update){self.explode(path.get("update"),true)}self.jump(head);self.mark(after);break;case"ForInStatement":n.Identifier.assert(stmt.left);var head=loc();var after=loc();var keyIterNextFn=self.makeTempVar();self.emitAssign(keyIterNextFn,b.callExpression(runtimeKeysMethod,[self.explodeExpression(path.get("right"))]));self.mark(head);var keyInfoTmpVar=self.makeTempVar();self.jumpIf(b.memberExpression(b.assignmentExpression("=",keyInfoTmpVar,b.callExpression(keyIterNextFn,[])),b.identifier("done"),false),after);self.emitAssign(stmt.left,b.memberExpression(keyInfoTmpVar,b.identifier("value"),false));self.leapManager.withEntry(new leap.LoopEntry(after,head,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(head);self.mark(after);break;case"BreakStatement":self.emitAbruptCompletion({type:"break",target:self.leapManager.getBreakLoc(stmt.label)});break;case"ContinueStatement":self.emitAbruptCompletion({type:"continue",target:self.leapManager.getContinueLoc(stmt.label)});break;case"SwitchStatement":var disc=self.emitAssign(self.makeTempVar(),self.explodeExpression(path.get("discriminant")));var after=loc();var defaultLoc=loc();var condition=defaultLoc;var caseLocs=[];var cases=stmt.cases||[];for(var i=cases.length-1;i>=0;--i){var c=cases[i];n.SwitchCase.assert(c);if(c.test){condition=b.conditionalExpression(b.binaryExpression("===",disc,c.test),caseLocs[i]=loc(),condition)}else{caseLocs[i]=defaultLoc}}self.jump(self.explodeExpression(new types.NodePath(condition,path,"discriminant")));self.leapManager.withEntry(new leap.SwitchEntry(after),function(){path.get("cases").each(function(casePath){var c=casePath.value;var i=casePath.name;self.mark(caseLocs[i]);casePath.get("consequent").each(self.explodeStatement,self)})});self.mark(after);if(defaultLoc.value===-1){self.mark(defaultLoc);assert.strictEqual(after.value,defaultLoc.value)}break;case"IfStatement":var elseLoc=stmt.alternate&&loc();var after=loc();self.jumpIfNot(self.explodeExpression(path.get("test")),elseLoc||after);self.explodeStatement(path.get("consequent"));if(elseLoc){self.jump(after);self.mark(elseLoc);self.explodeStatement(path.get("alternate"))}self.mark(after);break;case"ReturnStatement":self.emitAbruptCompletion({type:"return",value:self.explodeExpression(path.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var after=loc();var handler=stmt.handler;if(!handler&&stmt.handlers){handler=stmt.handlers[0]||null}var catchLoc=handler&&loc();var catchEntry=catchLoc&&new leap.CatchEntry(catchLoc,handler.param);var finallyLoc=stmt.finalizer&&loc();var finallyEntry=finallyLoc&&new leap.FinallyEntry(finallyLoc);var tryEntry=new leap.TryEntry(self.getUnmarkedCurrentLoc(),catchEntry,finallyEntry);self.tryEntries.push(tryEntry);self.updateContextPrevLoc(tryEntry.firstLoc);self.leapManager.withEntry(tryEntry,function(){self.explodeStatement(path.get("block"));if(catchLoc){if(finallyLoc){self.jump(finallyLoc)}else{self.jump(after)}self.updateContextPrevLoc(self.mark(catchLoc));var bodyPath=path.get("handler","body");var safeParam=self.makeTempVar();self.clearPendingException(tryEntry.firstLoc,safeParam);var catchScope=bodyPath.scope;var catchParamName=handler.param.name;n.CatchClause.assert(catchScope.node);assert.strictEqual(catchScope.lookup(catchParamName),catchScope);types.visit(bodyPath,{visitIdentifier:function(path){if(path.value.name===catchParamName&&path.scope.lookup(catchParamName)===catchScope){return safeParam}this.traverse(path)}});self.leapManager.withEntry(catchEntry,function(){self.explodeStatement(bodyPath)})}if(finallyLoc){self.updateContextPrevLoc(self.mark(finallyLoc));self.leapManager.withEntry(finallyEntry,function(){self.explodeStatement(path.get("finalizer"))});self.emit(b.callExpression(self.contextProperty("finish"),[finallyEntry.firstLoc]))}});self.mark(after);break;case"ThrowStatement":self.emit(b.throwStatement(self.explodeExpression(path.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(stmt.type))}};Ep.emitAbruptCompletion=function(record){try{assert.ok(isValidCompletion(record))}catch(err){err.message="invalid completion record: "+JSON.stringify(record);throw err}assert.notStrictEqual(record.type,"normal","normal completions are not abrupt");var abruptArgs=[b.literal(record.type)];if(record.type==="break"||record.type==="continue"){n.Literal.assert(record.target);abruptArgs[1]=record.target}else if(record.type==="return"||record.type==="throw"){if(record.value){n.Expression.assert(record.value);abruptArgs[1]=record.value}}this.emit(b.returnStatement(b.callExpression(this.contextProperty("abrupt"),abruptArgs)))};function isValidCompletion(record){var type=record.type;if(type==="normal"){return!hasOwn.call(record,"target")}if(type==="break"||type==="continue"){return!hasOwn.call(record,"value")&&n.Literal.check(record.target)}if(type==="return"||type==="throw"){return hasOwn.call(record,"value")&&!hasOwn.call(record,"target")}return false}Ep.getUnmarkedCurrentLoc=function(){return b.literal(this.listing.length)};Ep.updateContextPrevLoc=function(loc){if(loc){n.Literal.assert(loc);if(loc.value===-1){loc.value=this.listing.length}else{assert.strictEqual(loc.value,this.listing.length)}}else{loc=this.getUnmarkedCurrentLoc()}this.emitAssign(this.contextProperty("prev"),loc)};Ep.explodeExpression=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var expr=path.value;if(expr){n.Expression.assert(expr)}else{return expr}var self=this;var result;function finish(expr){n.Expression.assert(expr);if(ignoreResult){self.emit(expr)}else{return expr}}if(!meta.containsLeap(expr)){return finish(expr)}var hasLeapingChildren=meta.containsLeap.onlyChildren(expr);function explodeViaTempVar(tempVar,childPath,ignoreChildResult){assert.ok(childPath instanceof types.NodePath);assert.ok(!ignoreChildResult||!tempVar,"Ignoring the result of a child expression but forcing it to "+"be assigned to a temporary variable?");var result=self.explodeExpression(childPath,ignoreChildResult);if(ignoreChildResult){}else if(tempVar||hasLeapingChildren&&(self.isVolatileContextProperty(result)||meta.hasSideEffects(result))){result=self.emitAssign(tempVar||self.makeTempVar(),result)}return result}switch(expr.type){case"ParenthesizedExpression":return finish(b.parenthesizedExpression(self.explodeExpression(path.get("expression"))));case"MemberExpression":return finish(b.memberExpression(self.explodeExpression(path.get("object")),expr.computed?explodeViaTempVar(null,path.get("property")):expr.property,expr.computed));case"CallExpression":var oldCalleePath=path.get("callee");var newCallee=self.explodeExpression(oldCalleePath);if(!n.MemberExpression.check(oldCalleePath.node)&&n.MemberExpression.check(newCallee)){newCallee=b.sequenceExpression([b.literal(0),newCallee])}return finish(b.callExpression(newCallee,path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"NewExpression":return finish(b.newExpression(explodeViaTempVar(null,path.get("callee")),path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"ObjectExpression":return finish(b.objectExpression(path.get("properties").map(function(propPath){return b.property(propPath.value.kind,propPath.value.key,explodeViaTempVar(null,propPath.get("value")))})));case"ArrayExpression":return finish(b.arrayExpression(path.get("elements").map(function(elemPath){return explodeViaTempVar(null,elemPath)})));case"SequenceExpression":var lastIndex=expr.expressions.length-1;path.get("expressions").each(function(exprPath){if(exprPath.name===lastIndex){result=self.explodeExpression(exprPath,ignoreResult)}else{self.explodeExpression(exprPath,true)}});return result;case"LogicalExpression":var after=loc();if(!ignoreResult){result=self.makeTempVar()}var left=explodeViaTempVar(result,path.get("left"));if(expr.operator==="&&"){self.jumpIfNot(left,after)}else{assert.strictEqual(expr.operator,"||");self.jumpIf(left,after)}explodeViaTempVar(result,path.get("right"),ignoreResult);self.mark(after);return result;case"ConditionalExpression":var elseLoc=loc();var after=loc();var test=self.explodeExpression(path.get("test"));self.jumpIfNot(test,elseLoc);if(!ignoreResult){result=self.makeTempVar()}explodeViaTempVar(result,path.get("consequent"),ignoreResult);self.jump(after);self.mark(elseLoc);explodeViaTempVar(result,path.get("alternate"),ignoreResult);self.mark(after);return result;case"UnaryExpression":return finish(b.unaryExpression(expr.operator,self.explodeExpression(path.get("argument")),!!expr.prefix));case"BinaryExpression":return finish(b.binaryExpression(expr.operator,explodeViaTempVar(null,path.get("left")),explodeViaTempVar(null,path.get("right"))));case"AssignmentExpression":return finish(b.assignmentExpression(expr.operator,self.explodeExpression(path.get("left")),self.explodeExpression(path.get("right"))));case"UpdateExpression":return finish(b.updateExpression(expr.operator,self.explodeExpression(path.get("argument")),expr.prefix));case"YieldExpression":var after=loc();var arg=expr.argument&&self.explodeExpression(path.get("argument"));if(arg&&expr.delegate){var result=self.makeTempVar();self.emit(b.returnStatement(b.callExpression(self.contextProperty("delegateYield"),[arg,b.literal(result.property.name),after])));self.mark(after);return result}self.emitAssign(self.contextProperty("next"),after);self.emit(b.returnStatement(arg||null));self.mark(after);return self.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(expr.type))}}},{"./leap":107,"./meta":108,"./util":109,assert:74,"ast-types":72}],106:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.hoist=function(funPath){assert.ok(funPath instanceof types.NodePath);n.Function.assert(funPath.value);var vars={};function varDeclToExpr(vdec,includeIdentifiers){n.VariableDeclaration.assert(vdec);var exprs=[];vdec.declarations.forEach(function(dec){vars[dec.id.name]=dec.id;if(dec.init){exprs.push(b.assignmentExpression("=",dec.id,dec.init))}else if(includeIdentifiers){exprs.push(dec.id)}});if(exprs.length===0)return null;if(exprs.length===1)return exprs[0];return b.sequenceExpression(exprs)}types.visit(funPath.get("body"),{visitVariableDeclaration:function(path){var expr=varDeclToExpr(path.value,false);if(expr===null){path.replace()}else{return b.expressionStatement(expr)}return false},visitForStatement:function(path){var init=path.value.init;if(n.VariableDeclaration.check(init)){path.get("init").replace(varDeclToExpr(init,false))}this.traverse(path)},visitForInStatement:function(path){var left=path.value.left;if(n.VariableDeclaration.check(left)){path.get("left").replace(varDeclToExpr(left,true))}this.traverse(path)},visitFunctionDeclaration:function(path){var node=path.value;vars[node.id.name]=node.id;var parentNode=path.parent.node;var assignment=b.expressionStatement(b.assignmentExpression("=",node.id,b.functionExpression(node.id,node.params,node.body,node.generator,node.expression)));if(n.BlockStatement.check(path.parent.node)){path.parent.get("body").unshift(assignment);path.replace()}else{path.replace(assignment)}return false},visitFunctionExpression:function(path){return false}});var paramNames={};funPath.get("params").each(function(paramPath){var param=paramPath.value;if(n.Identifier.check(param)){paramNames[param.name]=param}else{}});var declarations=[];Object.keys(vars).forEach(function(name){if(!hasOwn.call(paramNames,name)){declarations.push(b.variableDeclarator(vars[name],null))}});if(declarations.length===0){return null}return b.variableDeclaration("var",declarations)}},{assert:74,"ast-types":72}],107:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var inherits=require("util").inherits;var hasOwn=Object.prototype.hasOwnProperty;function Entry(){assert.ok(this instanceof Entry)}function FunctionEntry(returnLoc){Entry.call(this);n.Literal.assert(returnLoc);Object.defineProperties(this,{returnLoc:{value:returnLoc}})}inherits(FunctionEntry,Entry);exports.FunctionEntry=FunctionEntry;function LoopEntry(breakLoc,continueLoc,label){Entry.call(this);n.Literal.assert(breakLoc);n.Literal.assert(continueLoc);if(label){n.Identifier.assert(label)}else{label=null}Object.defineProperties(this,{breakLoc:{value:breakLoc},continueLoc:{value:continueLoc},label:{value:label}})}inherits(LoopEntry,Entry);exports.LoopEntry=LoopEntry;function SwitchEntry(breakLoc){Entry.call(this);n.Literal.assert(breakLoc);Object.defineProperties(this,{breakLoc:{value:breakLoc}})}inherits(SwitchEntry,Entry);exports.SwitchEntry=SwitchEntry;function TryEntry(firstLoc,catchEntry,finallyEntry){Entry.call(this);n.Literal.assert(firstLoc);if(catchEntry){assert.ok(catchEntry instanceof CatchEntry)}else{catchEntry=null}if(finallyEntry){assert.ok(finallyEntry instanceof FinallyEntry)}else{finallyEntry=null}assert.ok(catchEntry||finallyEntry);Object.defineProperties(this,{firstLoc:{value:firstLoc},catchEntry:{value:catchEntry},finallyEntry:{value:finallyEntry}})}inherits(TryEntry,Entry);exports.TryEntry=TryEntry;function CatchEntry(firstLoc,paramId){Entry.call(this);n.Literal.assert(firstLoc);n.Identifier.assert(paramId);Object.defineProperties(this,{firstLoc:{value:firstLoc},paramId:{value:paramId}})}inherits(CatchEntry,Entry);exports.CatchEntry=CatchEntry;function FinallyEntry(firstLoc){Entry.call(this);n.Literal.assert(firstLoc);Object.defineProperties(this,{firstLoc:{value:firstLoc}})}inherits(FinallyEntry,Entry);exports.FinallyEntry=FinallyEntry;function LeapManager(emitter){assert.ok(this instanceof LeapManager);var Emitter=require("./emit").Emitter;assert.ok(emitter instanceof Emitter);Object.defineProperties(this,{emitter:{value:emitter},entryStack:{value:[new FunctionEntry(emitter.finalLoc)]}})}var LMp=LeapManager.prototype;exports.LeapManager=LeapManager;LMp.withEntry=function(entry,callback){assert.ok(entry instanceof Entry);this.entryStack.push(entry);try{callback.call(this.emitter)}finally{var popped=this.entryStack.pop();assert.strictEqual(popped,entry)}};LMp._findLeapLocation=function(property,label){for(var i=this.entryStack.length-1;i>=0;--i){var entry=this.entryStack[i];var loc=entry[property];if(loc){if(label){if(entry.label&&entry.label.name===label.name){return loc}}else{return loc}}}return null};LMp.getBreakLoc=function(label){return this._findLeapLocation("breakLoc",label)};LMp.getContinueLoc=function(label){return this._findLeapLocation("continueLoc",label)}},{"./emit":105,assert:74,"ast-types":72,util:98}],108:[function(require,module,exports){var assert=require("assert");var m=require("private").makeAccessor();var types=require("ast-types");var isArray=types.builtInTypes.array;var n=types.namedTypes;var hasOwn=Object.prototype.hasOwnProperty;function makePredicate(propertyName,knownTypes){function onlyChildren(node){n.Node.assert(node);var result=false;function check(child){if(result){}else if(isArray.check(child)){child.some(check)}else if(n.Node.check(child)){assert.strictEqual(result,false);result=predicate(child)}return result}types.eachField(node,function(name,child){check(child)});return result}function predicate(node){n.Node.assert(node);var meta=m(node);if(hasOwn.call(meta,propertyName))return meta[propertyName];if(hasOwn.call(opaqueTypes,node.type))return meta[propertyName]=false;if(hasOwn.call(knownTypes,node.type))return meta[propertyName]=true;return meta[propertyName]=onlyChildren(node)}predicate.onlyChildren=onlyChildren;return predicate}var opaqueTypes={FunctionExpression:true};var sideEffectTypes={CallExpression:true,ForInStatement:true,UnaryExpression:true,BinaryExpression:true,AssignmentExpression:true,UpdateExpression:true,NewExpression:true};var leapTypes={YieldExpression:true,BreakStatement:true,ContinueStatement:true,ReturnStatement:true,ThrowStatement:true};for(var type in leapTypes){if(hasOwn.call(leapTypes,type)){sideEffectTypes[type]=leapTypes[type]}}exports.hasSideEffects=makePredicate("hasSideEffects",sideEffectTypes);exports.containsLeap=makePredicate("containsLeap",leapTypes)},{assert:74,"ast-types":72,"private":112}],109:[function(require,module,exports){var b=require("ast-types").builders;var hasOwn=Object.prototype.hasOwnProperty;exports.defaults=function(obj){var len=arguments.length;var extension;for(var i=1;i<len;++i){if(extension=arguments[i]){for(var key in extension){if(hasOwn.call(extension,key)&&!hasOwn.call(obj,key)){obj[key]=extension[key]}}}}return obj};exports.runtimeProperty=function(name){return b.memberExpression(b.identifier("regeneratorRuntime"),b.identifier(name),false)}},{"ast-types":72}],110:[function(require,module,exports){var assert=require("assert");var fs=require("fs");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var hoist=require("./hoist").hoist;var Emitter=require("./emit").Emitter;var runtimeProperty=require("./util").runtimeProperty;var runtimeWrapMethod=runtimeProperty("wrap");var runtimeMarkMethod=runtimeProperty("mark");var runtimeValuesMethod=runtimeProperty("values");var runtimeAsyncMethod=runtimeProperty("async");exports.transform=function transform(node,options){return types.visit(node,visitor)};var visitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){this.traverse(path);var node=path.value;if(!node.generator&&!node.async){return}node.generator=false;if(node.expression){node.expression=false;node.body=b.blockStatement([b.returnStatement(node.body)])}if(node.async){awaitVisitor.visit(path.get("body"))}var outerFnId=node.id||(node.id=path.scope.parent.declareTemporary("callee$"));
var innerFnId=b.identifier(node.id.name+"$");var contextId=path.scope.declareTemporary("context$");var argsId=path.scope.declareTemporary("args$");var shouldAliasArguments=renameArguments(path,argsId);var vars=hoist(path);if(shouldAliasArguments){vars=vars||b.variableDeclaration("var",[]);vars.declarations.push(b.variableDeclarator(argsId,b.identifier("arguments")))}var emitter=new Emitter(contextId);emitter.explode(path.get("body"));var outerBody=[];if(vars&&vars.declarations.length>0){outerBody.push(vars)}var wrapArgs=[emitter.getContextFunction(innerFnId),node.async?b.literal(null):outerFnId,b.thisExpression()];var tryEntryList=emitter.getTryEntryList();if(tryEntryList){wrapArgs.push(tryEntryList)}var wrapCall=b.callExpression(node.async?runtimeAsyncMethod:runtimeWrapMethod,wrapArgs);outerBody.push(b.returnStatement(wrapCall));node.body=b.blockStatement(outerBody);if(node.async){node.async=false;return}if(n.FunctionDeclaration.check(node)){var pp=path.parent;while(pp&&!(n.BlockStatement.check(pp.value)||n.Program.check(pp.value))){pp=pp.parent}if(!pp){return}path.replace();node.type="FunctionExpression";var varDecl=b.variableDeclaration("var",[b.variableDeclarator(node.id,b.callExpression(runtimeMarkMethod,[node]))]);if(node.comments){varDecl.comments=node.comments;node.comments=null}var bodyPath=pp.get("body");var bodyLen=bodyPath.value.length;for(var i=0;i<bodyLen;++i){var firstStmtPath=bodyPath.get(i);if(!shouldNotHoistAbove(firstStmtPath)){firstStmtPath.insertBefore(varDecl);return}}bodyPath.push(varDecl)}else{n.FunctionExpression.assert(node);return b.callExpression(runtimeMarkMethod,[node])}},visitForOfStatement:function(path){this.traverse(path);var node=path.value;var tempIterId=path.scope.declareTemporary("t$");var tempIterDecl=b.variableDeclarator(tempIterId,b.callExpression(runtimeValuesMethod,[node.right]));var tempInfoId=path.scope.declareTemporary("t$");var tempInfoDecl=b.variableDeclarator(tempInfoId,null);var init=node.left;var loopId;if(n.VariableDeclaration.check(init)){loopId=init.declarations[0].id;init.declarations.push(tempIterDecl,tempInfoDecl)}else{loopId=init;init=b.variableDeclaration("var",[tempIterDecl,tempInfoDecl])}n.Identifier.assert(loopId);var loopIdAssignExprStmt=b.expressionStatement(b.assignmentExpression("=",loopId,b.memberExpression(tempInfoId,b.identifier("value"),false)));if(n.BlockStatement.check(node.body)){node.body.body.unshift(loopIdAssignExprStmt)}else{node.body=b.blockStatement([loopIdAssignExprStmt,node.body])}return b.forStatement(init,b.unaryExpression("!",b.memberExpression(b.assignmentExpression("=",tempInfoId,b.callExpression(b.memberExpression(tempIterId,b.identifier("next"),false),[])),b.identifier("done"),false)),null,node.body)}});function shouldNotHoistAbove(stmtPath){var value=stmtPath.value;n.Statement.assert(value);if(n.ExpressionStatement.check(value)&&n.Literal.check(value.expression)&&value.expression.value==="use strict"){return true}if(n.VariableDeclaration.check(value)){for(var i=0;i<value.declarations.length;++i){var decl=value.declarations[i];if(n.CallExpression.check(decl.init)&&types.astNodesAreEquivalent(decl.init.callee,runtimeMarkMethod)){return true}}}return false}function renameArguments(funcPath,argsId){assert.ok(funcPath instanceof types.NodePath);var func=funcPath.value;var didReplaceArguments=false;var hasImplicitArguments=false;types.visit(funcPath,{visitFunction:function(path){if(path.value===func){hasImplicitArguments=!path.scope.lookup("arguments");this.traverse(path)}else{return false}},visitIdentifier:function(path){if(path.value.name==="arguments"){var isMemberProperty=n.MemberExpression.check(path.parent.node)&&path.name==="property"&&!path.parent.node.computed;if(!isMemberProperty){path.replace(argsId);didReplaceArguments=true;return false}}this.traverse(path)}});return didReplaceArguments&&hasImplicitArguments}var awaitVisitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){return false},visitAwaitExpression:function(path){return b.yieldExpression(path.value.argument,false)}})},{"./emit":105,"./hoist":106,"./util":109,assert:74,"ast-types":72,fs:73}],111:[function(require,module,exports){(function(__dirname){var assert=require("assert");var path=require("path");var fs=require("fs");var through=require("through");var transform=require("./lib/visit").transform;var utils=require("./lib/util");var types=require("ast-types");var genOrAsyncFunExp=/\bfunction\s*\*|\basync\b/;var blockBindingExp=/\b(let|const)\s+/;function exports(file,options){var data=[];return through(write,end);function write(buf){data.push(buf)}function end(){this.queue(compile(data.join(""),options).code);this.queue(null)}}module.exports=exports;function runtime(){require("./runtime")}exports.runtime=runtime;runtime.path=path.join(__dirname,"runtime.js");exports.transform=transform}).call(this,"/node_modules/regenerator-6to5")},{"./lib/util":109,"./lib/visit":110,"./runtime":120,assert:74,"ast-types":72,fs:73,path:82,through:119}],112:[function(require,module,exports){"use strict";var originalObject=Object;var originalDefProp=Object.defineProperty;var originalCreate=Object.create;function defProp(obj,name,value){if(originalDefProp)try{originalDefProp.call(originalObject,obj,name,{value:value})}catch(definePropertyIsBrokenInIE8){obj[name]=value}else{obj[name]=value}}function makeSafeToCall(fun){if(fun){defProp(fun,"call",fun.call);defProp(fun,"apply",fun.apply)}return fun}makeSafeToCall(originalDefProp);makeSafeToCall(originalCreate);var hasOwn=makeSafeToCall(Object.prototype.hasOwnProperty);var numToStr=makeSafeToCall(Number.prototype.toString);var strSlice=makeSafeToCall(String.prototype.slice);var cloner=function(){};function create(prototype){if(originalCreate){return originalCreate.call(originalObject,prototype)}cloner.prototype=prototype||null;return new cloner}var rand=Math.random;var uniqueKeys=create(null);function makeUniqueKey(){do var uniqueKey=strSlice.call(numToStr.call(rand(),36),2);while(hasOwn.call(uniqueKeys,uniqueKey));return uniqueKeys[uniqueKey]=uniqueKey}defProp(exports,"makeUniqueKey",makeUniqueKey);var originalGetOPNs=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function getOwnPropertyNames(object){for(var names=originalGetOPNs(object),src=0,dst=0,len=names.length;src<len;++src){if(!hasOwn.call(uniqueKeys,names[src])){if(src>dst){names[dst]=names[src]}++dst}}names.length=dst;return names};function defaultCreatorFn(object){return create(null)}function makeAccessor(secretCreatorFn){var brand=makeUniqueKey();var passkey=create(null);secretCreatorFn=secretCreatorFn||defaultCreatorFn;function register(object){var secret;function vault(key,forget){if(key===passkey){return forget?secret=null:secret||(secret=secretCreatorFn(object))}}defProp(object,brand,vault)}function accessor(object){if(!hasOwn.call(object,brand))register(object);return object[brand](passkey)}accessor.forget=function(object){if(hasOwn.call(object,brand))object[brand](passkey,true)};return accessor}defProp(exports,"makeAccessor",makeAccessor)},{}],113:[function(require,module,exports){"use strict";module.exports=require("./lib/core.js");require("./lib/done.js");require("./lib/es6-extensions.js");require("./lib/node-extensions.js")},{"./lib/core.js":114,"./lib/done.js":115,"./lib/es6-extensions.js":116,"./lib/node-extensions.js":117}],114:[function(require,module,exports){"use strict";var asap=require("asap");module.exports=Promise;function Promise(fn){if(typeof this!=="object")throw new TypeError("Promises must be constructed via new");if(typeof fn!=="function")throw new TypeError("not a function");var state=null;var value=null;var deferreds=[];var self=this;this.then=function(onFulfilled,onRejected){return new self.constructor(function(resolve,reject){handle(new Handler(onFulfilled,onRejected,resolve,reject))})};function handle(deferred){if(state===null){deferreds.push(deferred);return}asap(function(){var cb=state?deferred.onFulfilled:deferred.onRejected;if(cb===null){(state?deferred.resolve:deferred.reject)(value);return}var ret;try{ret=cb(value)}catch(e){deferred.reject(e);return}deferred.resolve(ret)})}function resolve(newValue){try{if(newValue===self)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&(typeof newValue==="object"||typeof newValue==="function")){var then=newValue.then;if(typeof then==="function"){doResolve(then.bind(newValue),resolve,reject);return}}state=true;value=newValue;finale()}catch(e){reject(e)}}function reject(newValue){state=false;value=newValue;finale()}function finale(){for(var i=0,len=deferreds.length;i<len;i++)handle(deferreds[i]);deferreds=null}doResolve(fn,resolve,reject)}function Handler(onFulfilled,onRejected,resolve,reject){this.onFulfilled=typeof onFulfilled==="function"?onFulfilled:null;this.onRejected=typeof onRejected==="function"?onRejected:null;this.resolve=resolve;this.reject=reject}function doResolve(fn,onFulfilled,onRejected){var done=false;try{fn(function(value){if(done)return;done=true;onFulfilled(value)},function(reason){if(done)return;done=true;onRejected(reason)})}catch(ex){if(done)return;done=true;onRejected(ex)}}},{asap:118}],115:[function(require,module,exports){"use strict";var Promise=require("./core.js");var asap=require("asap");module.exports=Promise;Promise.prototype.done=function(onFulfilled,onRejected){var self=arguments.length?this.then.apply(this,arguments):this;self.then(null,function(err){asap(function(){throw err})})}},{"./core.js":114,asap:118}],116:[function(require,module,exports){"use strict";var Promise=require("./core.js");var asap=require("asap");module.exports=Promise;function ValuePromise(value){this.then=function(onFulfilled){if(typeof onFulfilled!=="function")return this;return new Promise(function(resolve,reject){asap(function(){try{resolve(onFulfilled(value))}catch(ex){reject(ex)}})})}}ValuePromise.prototype=Promise.prototype;var TRUE=new ValuePromise(true);var FALSE=new ValuePromise(false);var NULL=new ValuePromise(null);var UNDEFINED=new ValuePromise(undefined);var ZERO=new ValuePromise(0);var EMPTYSTRING=new ValuePromise("");Promise.resolve=function(value){if(value instanceof Promise)return value;if(value===null)return NULL;if(value===undefined)return UNDEFINED;if(value===true)return TRUE;if(value===false)return FALSE;if(value===0)return ZERO;if(value==="")return EMPTYSTRING;if(typeof value==="object"||typeof value==="function"){try{var then=value.then;if(typeof then==="function"){return new Promise(then.bind(value))}}catch(ex){return new Promise(function(resolve,reject){reject(ex)})}}return new ValuePromise(value)};Promise.all=function(arr){var args=Array.prototype.slice.call(arr);return new Promise(function(resolve,reject){if(args.length===0)return resolve([]);var remaining=args.length;function res(i,val){try{if(val&&(typeof val==="object"||typeof val==="function")){var then=val.then;if(typeof then==="function"){then.call(val,function(val){res(i,val)},reject);return}}args[i]=val;if(--remaining===0){resolve(args)}}catch(ex){reject(ex)}}for(var i=0;i<args.length;i++){res(i,args[i])}})};Promise.reject=function(value){return new Promise(function(resolve,reject){reject(value)})};Promise.race=function(values){return new Promise(function(resolve,reject){values.forEach(function(value){Promise.resolve(value).then(resolve,reject)})})};Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)}},{"./core.js":114,asap:118}],117:[function(require,module,exports){"use strict";var Promise=require("./core.js");var asap=require("asap");module.exports=Promise;Promise.denodeify=function(fn,argumentCount){argumentCount=argumentCount||Infinity;return function(){var self=this;var args=Array.prototype.slice.call(arguments);return new Promise(function(resolve,reject){while(args.length&&args.length>argumentCount){args.pop()}args.push(function(err,res){if(err)reject(err);else resolve(res)});fn.apply(self,args)})}};Promise.nodeify=function(fn){return function(){var args=Array.prototype.slice.call(arguments);var callback=typeof args[args.length-1]==="function"?args.pop():null;var ctx=this;try{return fn.apply(this,arguments).nodeify(callback,ctx)}catch(ex){if(callback===null||typeof callback=="undefined"){return new Promise(function(resolve,reject){reject(ex)})}else{asap(function(){callback.call(ctx,ex)})}}}};Promise.prototype.nodeify=function(callback,ctx){if(typeof callback!="function")return this;this.then(function(value){asap(function(){callback.call(ctx,null,value)})},function(err){asap(function(){callback.call(ctx,err)})})}},{"./core.js":114,asap:118}],118:[function(require,module,exports){(function(process){var head={task:void 0,next:null};var tail=head;var flushing=false;var requestFlush=void 0;var isNodeJS=false;function flush(){while(head.next){head=head.next;var task=head.task;head.task=void 0;var domain=head.domain;if(domain){head.domain=void 0;domain.enter()}try{task()}catch(e){if(isNodeJS){if(domain){domain.exit()}setTimeout(flush,0);if(domain){domain.enter()}throw e}else{setTimeout(function(){throw e},0)}}if(domain){domain.exit()}}flushing=false}if(typeof process!=="undefined"&&process.nextTick){isNodeJS=true;requestFlush=function(){process.nextTick(flush)}}else if(typeof setImmediate==="function"){if(typeof window!=="undefined"){requestFlush=setImmediate.bind(window,flush)}else{requestFlush=function(){setImmediate(flush)}}}else if(typeof MessageChannel!=="undefined"){var channel=new MessageChannel;channel.port1.onmessage=flush;requestFlush=function(){channel.port2.postMessage(0)}}else{requestFlush=function(){setTimeout(flush,0)}}function asap(task){tail=tail.next={task:task,domain:isNodeJS&&process.domain,next:null};if(!flushing){flushing=true;requestFlush()}}module.exports=asap}).call(this,require("_process"))},{_process:83}],119:[function(require,module,exports){(function(process){var Stream=require("stream");exports=module.exports=through;through.through=through;function through(write,end,opts){write=write||function(data){this.queue(data)};end=end||function(){this.queue(null)};var ended=false,destroyed=false,buffer=[],_ended=false;var stream=new Stream;stream.readable=stream.writable=true;stream.paused=false;stream.autoDestroy=!(opts&&opts.autoDestroy===false);stream.write=function(data){write.call(this,data);return!stream.paused};function drain(){while(buffer.length&&!stream.paused){var data=buffer.shift();if(null===data)return stream.emit("end");else stream.emit("data",data)}}stream.queue=stream.push=function(data){if(_ended)return stream;if(data==null)_ended=true;buffer.push(data);drain();return stream};stream.on("end",function(){stream.readable=false;if(!stream.writable&&stream.autoDestroy)process.nextTick(function(){stream.destroy()})});function _end(){stream.writable=false;end.call(stream);if(!stream.readable&&stream.autoDestroy)stream.destroy()}stream.end=function(data){if(ended)return;ended=true;if(arguments.length)stream.write(data);_end();return stream};stream.destroy=function(){if(destroyed)return;destroyed=true;ended=true;buffer.length=0;stream.writable=stream.readable=false;stream.emit("close");return stream};stream.pause=function(){if(stream.paused)return;stream.paused=true;return stream};stream.resume=function(){if(stream.paused){stream.paused=false;stream.emit("resume")}drain();if(!stream.paused)stream.emit("drain");return stream};return stream}}).call(this,require("_process"))},{_process:83,stream:95}],120:[function(require,module,exports){!function(){var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";if(typeof Promise==="undefined")try{Promise=require("promise")}catch(ignored){}if(typeof regeneratorRuntime==="object"){return}var runtime=regeneratorRuntime=typeof exports==="undefined"?{}:exports;function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}var Gp=Generator.prototype;var GFp=GeneratorFunction.prototype=Object.create(Function.prototype);GFp.constructor=GeneratorFunction;GFp.prototype=Gp;Gp.constructor=GFp;if(GeneratorFunction.name!=="GeneratorFunction"){GeneratorFunction.name="GeneratorFunction"}if(GeneratorFunction.name!=="GeneratorFunction"){throw new Error("GeneratorFunction renamed?")}runtime.isGeneratorFunction=function(genFun){var ctor=genFun&&genFun.constructor;return ctor?GeneratorFunction.name===ctor.name:false};runtime.mark=function(genFun){genFun.__proto__=GFp;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator.throw);function step(arg){try{var info=this(arg);var value=info.value}catch(error){return reject(error)}if(info.done){resolve(value)}else{Promise.resolve(value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){throw new Error("Generator has already finished")}while(true){var delegate=context.delegate;if(delegate){try{var info=delegate.iterator[method](arg);method="next";arg=undefined}catch(uncaught){context.delegate=null;method="throw";arg=uncaught;continue}if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;try{var value=innerFn.call(self,context);state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:value,done:context.done};if(value===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}catch(thrown){state=GenStateCompleted;if(method==="next"){context.dispatchException(thrown)}else{arg=thrown}}}}generator.next=invoke.bind(generator,"next");generator.throw=invoke.bind(generator,"throw");generator.return=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){var iterator=iterable;if(iteratorSymbol in iterable){iterator=iterable[iteratorSymbol]()}else if(!isNaN(iterable.length)){var i=-1;iterator=function next(){while(++i<iterable.length){if(i in iterable){next.value=iterable[i];next.done=false;return next}}next.done=true;return next};iterator.next=iterator}return iterator}runtime.values=values;Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}()},{promise:113}],121:[function(require,module,exports){var regenerate=require("regenerate");exports.REGULAR={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,65535),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)};exports.UNICODE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)};exports.UNICODE_IGNORE_CASE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:123}],122:[function(require,module,exports){module.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],123:[function(require,module,exports){(function(global){(function(root){var freeExports=typeof exports=="object"&&exports;var freeModule=typeof module=="object"&&module&&module.exports==freeExports&&module;var freeGlobal=typeof global=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal){root=freeGlobal}var ERRORS={rangeOrder:"A range’s `stop` value must be greater than or equal "+"to the `start` value.",codePointRange:"Invalid code point value. Code points range from "+"U+000000 to U+10FFFF."};var HIGH_SURROGATE_MIN=55296;var HIGH_SURROGATE_MAX=56319;var LOW_SURROGATE_MIN=56320;var LOW_SURROGATE_MAX=57343;var regexNull=/\\x00([^0123456789]|$)/g;var object={};var hasOwnProperty=object.hasOwnProperty;var extend=function(destination,source){var key;for(key in source){if(hasOwnProperty.call(source,key)){destination[key]=source[key]}}return destination};var forEach=function(array,callback){var index=-1;var length=array.length;while(++index<length){callback(array[index],index)}};var toString=object.toString;var isArray=function(value){return toString.call(value)=="[object Array]"};var isNumber=function(value){return typeof value=="number"||toString.call(value)=="[object Number]"};var zeroes="0000";var pad=function(number,totalCharacters){var string=String(number);return string.length<totalCharacters?(zeroes+string).slice(-totalCharacters):string};var hex=function(number){return Number(number).toString(16).toUpperCase()};var slice=[].slice;var dataFromCodePoints=function(codePoints){var index=-1;var length=codePoints.length;var max=length-1;var result=[];var isStart=true;var tmp;var previous=0;while(++index<length){tmp=codePoints[index];if(isStart){result.push(tmp);previous=tmp;isStart=false}else{if(tmp==previous+1){if(index!=max){previous=tmp;continue}else{isStart=true;result.push(tmp+1)}}else{result.push(previous+1,tmp);previous=tmp}}}if(!isStart){result.push(tmp+1)}return result};var dataRemove=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){if(codePoint==start){if(end==start+1){data.splice(index,2);return data}else{data[index]=codePoint+1;return data}}else if(codePoint==end-1){data[index+1]=codePoint;return data}else{data.splice(index,2,start,codePoint,codePoint+1,end);return data}}index+=2}return data};var dataRemoveRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}var index=0;var start;var end;while(index<data.length){start=data[index];end=data[index+1]-1;if(start>rangeEnd){return data}if(rangeStart<=start&&rangeEnd>=end){data.splice(index,2);continue}if(rangeStart>=start&&rangeEnd<end){if(rangeStart==start){data[index]=rangeEnd+1;data[index+1]=end+1;return data}data.splice(index,2,start,rangeStart,rangeEnd+1,end+1);return data}if(rangeStart>=start&&rangeStart<=end){data[index+1]=rangeStart}else if(rangeEnd>=start&&rangeEnd<=end){data[index]=rangeEnd+1;return data}index+=2}return data};var dataAdd=function(data,codePoint){var index=0;var start;var end;var lastIndex=null;var length=data.length;if(codePoint<0||codePoint>1114111){throw RangeError(ERRORS.codePointRange)}while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return data}if(codePoint==start-1){data[index]=codePoint;return data}if(start>codePoint){data.splice(lastIndex!=null?lastIndex+2:0,0,codePoint,codePoint+1);return data}if(codePoint==end){if(codePoint+1==data[index+2]){data.splice(index,4,start,data[index+3]);return data}data[index+1]=codePoint+1;return data}lastIndex=index;index+=2}data.push(codePoint,codePoint+1);return data};var dataAddData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataAdd(data,start)}else{data=dataAddRange(data,start,end)}index+=2}return data};var dataRemoveData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataRemove(data,start)}else{data=dataRemoveRange(data,start,end)}index+=2}return data};var dataAddRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}if(rangeStart<0||rangeStart>1114111||rangeEnd<0||rangeEnd>1114111){throw RangeError(ERRORS.codePointRange)}var index=0;var start;var end;var added=false;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(added){if(start==rangeEnd+1){data.splice(index-1,2);return data}if(start>rangeEnd){return data}if(start>=rangeStart&&start<=rangeEnd){if(end>rangeStart&&end-1<=rangeEnd){data.splice(index,2);index-=2}else{data.splice(index-1,2);index-=2}}}else if(start==rangeEnd+1){data[index]=rangeStart;return data}else if(start>rangeEnd){data.splice(index,0,rangeStart,rangeEnd+1);return data}else if(rangeStart>=start&&rangeStart<end&&rangeEnd+1<=end){return data}else if(rangeStart>=start&&rangeStart<end||end==rangeStart){data[index+1]=rangeEnd+1;added=true}else if(rangeStart<=start&&rangeEnd+1>=end){data[index]=rangeStart;data[index+1]=rangeEnd+1;added=true}index+=2}if(!added){data.push(rangeStart,rangeEnd+1)}return data};var dataContains=function(data,codePoint){var index=0;
var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return true}index+=2}return false};var dataIntersection=function(data,codePoints){var index=0;var length=codePoints.length;var codePoint;var result=[];while(index<length){codePoint=codePoints[index];if(dataContains(data,codePoint)){result.push(codePoint)}++index}return dataFromCodePoints(result)};var dataIsEmpty=function(data){return!data.length};var dataIsSingleton=function(data){return data.length==2&&data[0]+1==data[1]};var dataToArray=function(data){var index=0;var start;var end;var result=[];var length=data.length;while(index<length){start=data[index];end=data[index+1];while(start<end){result.push(start);++start}index+=2}return result};var floor=Math.floor;var highSurrogate=function(codePoint){return parseInt(floor((codePoint-65536)/1024)+HIGH_SURROGATE_MIN,10)};var lowSurrogate=function(codePoint){return parseInt((codePoint-65536)%1024+LOW_SURROGATE_MIN,10)};var stringFromCharCode=String.fromCharCode;var codePointToString=function(codePoint){var string;if(codePoint==9){string="\\t"}else if(codePoint==10){string="\\n"}else if(codePoint==12){string="\\f"}else if(codePoint==13){string="\\r"}else if(codePoint==92){string="\\\\"}else if(codePoint==36||codePoint>=40&&codePoint<=43||codePoint==45||codePoint==46||codePoint==63||codePoint>=91&&codePoint<=94||codePoint>=123&&codePoint<=125){string="\\"+stringFromCharCode(codePoint)}else if(codePoint>=32&&codePoint<=126){string=stringFromCharCode(codePoint)}else if(codePoint<=255){string="\\x"+pad(hex(codePoint),2)}else{string="\\u"+pad(hex(codePoint),4)}return string};var symbolToCodePoint=function(symbol){var length=symbol.length;var first=symbol.charCodeAt(0);var second;if(first>=HIGH_SURROGATE_MIN&&first<=HIGH_SURROGATE_MAX&&length>1){second=symbol.charCodeAt(1);return(first-HIGH_SURROGATE_MIN)*1024+second-LOW_SURROGATE_MIN+65536}return first};var createBMPCharacterClasses=function(data){var result="";var index=0;var start;var end;var length=data.length;if(dataIsSingleton(data)){return codePointToString(data[0])}while(index<length){start=data[index];end=data[index+1]-1;if(start==end){result+=codePointToString(start)}else if(start+1==end){result+=codePointToString(start)+codePointToString(end)}else{result+=codePointToString(start)+"-"+codePointToString(end)}index+=2}return"["+result+"]"};var splitAtBMP=function(data){var loneHighSurrogates=[];var bmp=[];var astral=[];var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1]-1;if(start<=65535&&end<=65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){if(end<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,end+1)}else{loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,end+1)}}else if(end>=HIGH_SURROGATE_MIN&&end<=HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,end+1)}else if(start<HIGH_SURROGATE_MIN&&end>HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,end+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,end+1)}}else if(start<=65535&&end>65535){if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);bmp.push(HIGH_SURROGATE_MAX+1,65535+1)}else if(start<HIGH_SURROGATE_MIN){bmp.push(start,HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1,65535+1);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1)}else{bmp.push(start,65535+1)}astral.push(65535+1,end+1)}else{astral.push(start,end+1)}index+=2}return{loneHighSurrogates:loneHighSurrogates,bmp:bmp,astral:astral}};var optimizeSurrogateMappings=function(surrogateMappings){var result=[];var tmpLow=[];var addLow=false;var mapping;var nextMapping;var highSurrogates;var lowSurrogates;var nextHighSurrogates;var nextLowSurrogates;var index=-1;var length=surrogateMappings.length;while(++index<length){mapping=surrogateMappings[index];nextMapping=surrogateMappings[index+1];if(!nextMapping){result.push(mapping);continue}highSurrogates=mapping[0];lowSurrogates=mapping[1];nextHighSurrogates=nextMapping[0];nextLowSurrogates=nextMapping[1];tmpLow=lowSurrogates;while(nextHighSurrogates&&highSurrogates[0]==nextHighSurrogates[0]&&highSurrogates[1]==nextHighSurrogates[1]){if(dataIsSingleton(nextLowSurrogates)){tmpLow=dataAdd(tmpLow,nextLowSurrogates[0])}else{tmpLow=dataAddRange(tmpLow,nextLowSurrogates[0],nextLowSurrogates[1]-1)}++index;mapping=surrogateMappings[index];highSurrogates=mapping[0];lowSurrogates=mapping[1];nextMapping=surrogateMappings[index+1];nextHighSurrogates=nextMapping&&nextMapping[0];nextLowSurrogates=nextMapping&&nextMapping[1];addLow=true}result.push([highSurrogates,addLow?tmpLow:lowSurrogates]);addLow=false}return optimizeByLowSurrogates(result)};var optimizeByLowSurrogates=function(surrogateMappings){if(surrogateMappings.length==1){return surrogateMappings}var index=-1;var innerIndex=-1;while(++index<surrogateMappings.length){var mapping=surrogateMappings[index];var lowSurrogates=mapping[1];var lowSurrogateStart=lowSurrogates[0];var lowSurrogateEnd=lowSurrogates[1];innerIndex=index;while(++innerIndex<surrogateMappings.length){var otherMapping=surrogateMappings[innerIndex];var otherLowSurrogates=otherMapping[1];var otherLowSurrogateStart=otherLowSurrogates[0];var otherLowSurrogateEnd=otherLowSurrogates[1];if(lowSurrogateStart==otherLowSurrogateStart&&lowSurrogateEnd==otherLowSurrogateEnd){if(dataIsSingleton(otherMapping[0])){mapping[0]=dataAdd(mapping[0],otherMapping[0][0])}else{mapping[0]=dataAddRange(mapping[0],otherMapping[0][0],otherMapping[0][1]-1)}surrogateMappings.splice(innerIndex,1);--innerIndex}}}return surrogateMappings};var surrogateSet=function(data){if(!data.length){return[]}var index=0;var start;var end;var startHigh;var startLow;var prevStartHigh=0;var prevEndHigh=0;var tmpLow=[];var endHigh;var endLow;var surrogateMappings=[];var length=data.length;var dataHigh=[];while(index<length){start=data[index];end=data[index+1]-1;startHigh=highSurrogate(start);startLow=lowSurrogate(start);endHigh=highSurrogate(end);endLow=lowSurrogate(end);var startsWithLowestLowSurrogate=startLow==LOW_SURROGATE_MIN;var endsWithHighestLowSurrogate=endLow==LOW_SURROGATE_MAX;var complete=false;if(startHigh==endHigh||startsWithLowestLowSurrogate&&endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh,endHigh+1],[startLow,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh,startHigh+1],[startLow,LOW_SURROGATE_MAX+1]])}if(!complete&&startHigh+1<endHigh){if(endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh+1,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh+1,endHigh],[LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1]])}}if(!complete){surrogateMappings.push([[endHigh,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]])}prevStartHigh=startHigh;prevEndHigh=endHigh;index+=2}return optimizeSurrogateMappings(surrogateMappings)};var createSurrogateCharacterClasses=function(surrogateMappings){var result=[];forEach(surrogateMappings,function(surrogateMapping){var highSurrogates=surrogateMapping[0];var lowSurrogates=surrogateMapping[1];result.push(createBMPCharacterClasses(highSurrogates)+createBMPCharacterClasses(lowSurrogates))});return result.join("|")};var createCharacterClassesFromData=function(data){var result=[];var parts=splitAtBMP(data);var loneHighSurrogates=parts.loneHighSurrogates;var bmp=parts.bmp;var astral=parts.astral;var hasAstral=!dataIsEmpty(parts.astral);var hasLoneSurrogates=!dataIsEmpty(loneHighSurrogates);var surrogateMappings=surrogateSet(astral);if(!hasAstral&&hasLoneSurrogates){bmp=dataAddData(bmp,loneHighSurrogates)}if(!dataIsEmpty(bmp)){result.push(createBMPCharacterClasses(bmp))}if(surrogateMappings.length){result.push(createSurrogateCharacterClasses(surrogateMappings))}if(hasAstral&&hasLoneSurrogates){result.push(createBMPCharacterClasses(loneHighSurrogates))}return result.join("|")};var regenerate=function(value){if(arguments.length>1){value=slice.call(arguments)}if(this instanceof regenerate){this.data=[];return value?this.add(value):this}return(new regenerate).add(value)};regenerate.version="1.0.1";var proto=regenerate.prototype;extend(proto,{add:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataAddData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.add(item)});return $this}$this.data=dataAdd($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},remove:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataRemoveData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.remove(item)});return $this}$this.data=dataRemove($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},addRange:function(start,end){var $this=this;$this.data=dataAddRange($this.data,isNumber(start)?start:symbolToCodePoint(start),isNumber(end)?end:symbolToCodePoint(end));return $this},removeRange:function(start,end){var $this=this;var startCodePoint=isNumber(start)?start:symbolToCodePoint(start);var endCodePoint=isNumber(end)?end:symbolToCodePoint(end);$this.data=dataRemoveRange($this.data,startCodePoint,endCodePoint);return $this},intersection:function(argument){var $this=this;var array=argument instanceof regenerate?dataToArray(argument.data):argument;$this.data=dataIntersection($this.data,array);return $this},contains:function(codePoint){return dataContains(this.data,isNumber(codePoint)?codePoint:symbolToCodePoint(codePoint))},clone:function(){var set=new regenerate;set.data=this.data.slice(0);return set},toString:function(){var result=createCharacterClassesFromData(this.data);return result.replace(regexNull,"\\0$1")},toRegExp:function(flags){return RegExp(this.toString(),flags||"")},valueOf:function(){return dataToArray(this.data)}});proto.toArray=proto.valueOf;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return regenerate})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=regenerate}else{freeExports.regenerate=regenerate}}else{root.regenerate=regenerate}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],124:[function(require,module,exports){(function(global){(function(){"use strict";var objectTypes={"function":true,object:true};var root=objectTypes[typeof window]&&window||this;var oldRoot=root;var freeExports=objectTypes[typeof exports]&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var stringFromCharCode=String.fromCharCode;var floor=Math.floor;function fromCodePoint(){var MAX_SIZE=16384;var codeUnits=[];var highSurrogate;var lowSurrogate;var index=-1;var length=arguments.length;if(!length){return""}var result="";while(++index<length){var codePoint=Number(arguments[index]);if(!isFinite(codePoint)||codePoint<0||codePoint>1114111||floor(codePoint)!=codePoint){throw RangeError("Invalid code point: "+codePoint)}if(codePoint<=65535){codeUnits.push(codePoint)}else{codePoint-=65536;highSurrogate=(codePoint>>10)+55296;lowSurrogate=codePoint%1024+56320;codeUnits.push(highSurrogate,lowSurrogate)}if(index+1==length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits);codeUnits.length=0}}return result}function assertType(type,expected){if(expected.indexOf("|")==-1){if(type==expected){return}throw Error("Invalid node type: "+type)}expected=assertType.hasOwnProperty(expected)?assertType[expected]:assertType[expected]=RegExp("^(?:"+expected+")$");if(expected.test(type)){return}throw Error("Invalid node type: "+type)}function generate(node){var type=node.type;if(generate.hasOwnProperty(type)&&typeof generate[type]=="function"){return generate[type](node)}throw Error("Invalid node type: "+type)}function generateAlternative(node){assertType(node.type,"alternative");var terms=node.body,length=terms?terms.length:0;if(length==1){return generateTerm(terms[0])}else{var i=-1,result="";while(++i<length){result+=generateTerm(terms[i])}return result}}function generateAnchor(node){assertType(node.type,"anchor");switch(node.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function generateAtom(node){assertType(node.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value");return generate(node)}function generateCharacterClass(node){assertType(node.type,"characterClass");var classRanges=node.body,length=classRanges?classRanges.length:0;var i=-1,result="[";if(node.negative){result+="^"}while(++i<length){result+=generateClassAtom(classRanges[i])}result+="]";return result}function generateCharacterClassEscape(node){assertType(node.type,"characterClassEscape");return"\\"+node.value}function generateCharacterClassRange(node){assertType(node.type,"characterClassRange");var min=node.min,max=node.max;if(min.type=="characterClassRange"||max.type=="characterClassRange"){throw Error("Invalid character class range")}return generateClassAtom(min)+"-"+generateClassAtom(max)}function generateClassAtom(node){assertType(node.type,"anchor|characterClassEscape|characterClassRange|dot|value");return generate(node)}function generateDisjunction(node){assertType(node.type,"disjunction");var body=node.body,length=body?body.length:0;if(length==0){throw Error("No body")}else if(length==1){return generate(body[0])}else{var i=-1,result="";while(++i<length){if(i!=0){result+="|"}result+=generate(body[i])}return result}}function generateDot(node){assertType(node.type,"dot");return"."}function generateGroup(node){assertType(node.type,"group");var result="(";switch(node.behavior){case"normal":break;case"ignore":result+="?:";break;case"lookahead":result+="?=";break;case"negativeLookahead":result+="?!";break;default:throw Error("Invalid behaviour: "+node.behaviour)}var body=node.body,length=body?body.length:0;if(length==1){result+=generate(body[0])}else{var i=-1;while(++i<length){result+=generate(body[i])}}result+=")";return result}function generateQuantifier(node){assertType(node.type,"quantifier");var quantifier="",min=node.min,max=node.max;switch(max){case undefined:case null:switch(min){case 0:quantifier="*";break;case 1:quantifier="+";break;default:quantifier="{"+min+",}";break}break;default:if(min==max){quantifier="{"+min+"}"}else if(min==0&&max==1){quantifier="?"}else{quantifier="{"+min+","+max+"}"}break}if(!node.greedy){quantifier+="?"}return generateAtom(node.body[0])+quantifier}function generateReference(node){assertType(node.type,"reference");return"\\"+node.matchIndex}function generateTerm(node){assertType(node.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value");return generate(node)}function generateValue(node){assertType(node.type,"value");var kind=node.kind,codePoint=node.codePoint;switch(kind){case"controlLetter":return"\\c"+fromCodePoint(codePoint+64);case"hexadecimalEscape":return"\\x"+("00"+codePoint.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+fromCodePoint(codePoint);case"null":return"\\"+codePoint;case"octal":return"\\"+codePoint.toString(8);case"singleEscape":switch(codePoint){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+codePoint)}case"symbol":return fromCodePoint(codePoint);case"unicodeEscape":return"\\u"+("0000"+codePoint.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+codePoint.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+kind)}}generate.alternative=generateAlternative;generate.anchor=generateAnchor;generate.characterClass=generateCharacterClass;generate.characterClassEscape=generateCharacterClassEscape;generate.characterClassRange=generateCharacterClassRange;generate.disjunction=generateDisjunction;generate.dot=generateDot;generate.group=generateGroup;generate.quantifier=generateQuantifier;generate.reference=generateReference;generate.value=generateValue;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return{generate:generate}})}else if(freeExports&&freeModule){freeExports.generate=generate}else{root.regjsgen={generate:generate}}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],125:[function(require,module,exports){(function(){function parse(str,flags){var hasUnicodeFlag=(flags||"").indexOf("u")!==-1;var pos=0;var closedCaptureCounter=0;function addRaw(node){node.raw=str.substring(node.range[0],node.range[1]);return node}function updateRawStart(node,start){node.range[0]=start;return addRaw(node)}function createAnchor(kind,rawLength){return addRaw({type:"anchor",kind:kind,range:[pos-rawLength,pos]})}function createValue(kind,codePoint,from,to){return addRaw({type:"value",kind:kind,codePoint:codePoint,range:[from,to]})}function createEscaped(kind,codePoint,value,fromOffset){fromOffset=fromOffset||0;return createValue(kind,codePoint,pos-(value.length+fromOffset),pos)}function createCharacter(matches){var _char=matches[0];var first=_char.charCodeAt(0);if(hasUnicodeFlag){var second;if(_char.length===1&&first>=55296&&first<=56319){second=lookahead().charCodeAt(0);if(second>=56320&&second<=57343){pos++;return createValue("symbol",(first-55296)*1024+second-56320+65536,pos-2,pos)}}}return createValue("symbol",first,pos-1,pos)}function createDisjunction(alternatives,from,to){return addRaw({type:"disjunction",body:alternatives,range:[from,to]})}function createDot(){return addRaw({type:"dot",range:[pos-1,pos]})}function createCharacterClassEscape(value){return addRaw({type:"characterClassEscape",value:value,range:[pos-2,pos]})}function createReference(matchIndex){return addRaw({type:"reference",matchIndex:parseInt(matchIndex,10),range:[pos-1-matchIndex.length,pos]})}function createGroup(behavior,disjunction,from,to){return addRaw({type:"group",behavior:behavior,body:disjunction,range:[from,to]})}function createQuantifier(min,max,from,to){if(to==null){from=pos-1;to=pos}return addRaw({type:"quantifier",min:min,max:max,greedy:true,body:null,range:[from,to]})}function createAlternative(terms,from,to){return addRaw({type:"alternative",body:terms,range:[from,to]})}function createCharacterClass(classRanges,negative,from,to){return addRaw({type:"characterClass",body:classRanges,negative:negative,range:[from,to]})}function createClassRange(min,max,from,to){if(min.codePoint>max.codePoint){throw SyntaxError("invalid range in character class")}return addRaw({type:"characterClassRange",min:min,max:max,range:[from,to]})}function flattenBody(body){if(body.type==="alternative"){return body.body}else{return[body]}}function isEmpty(obj){return obj.type==="empty"}function incr(amount){amount=amount||1;var res=str.substring(pos,pos+amount);pos+=amount||1;return res}function skip(value){if(!match(value)){throw SyntaxError("character: "+value)}}function match(value){if(str.indexOf(value,pos)===pos){return incr(value.length)}}function lookahead(){return str[pos]}function current(value){return str.indexOf(value,pos)===pos}function next(value){return str[pos+1]===value}function matchReg(regExp){var subStr=str.substring(pos);var res=subStr.match(regExp);if(res){res.range=[];res.range[0]=pos;incr(res[0].length);res.range[1]=pos}return res}function parseDisjunction(){var res=[],from=pos;res.push(parseAlternative());while(match("|")){res.push(parseAlternative())}if(res.length===1){return res[0]}return createDisjunction(res,from,pos)}function parseAlternative(){var res=[],from=pos;var term;while(term=parseTerm()){res.push(term)}if(res.length===1){return res[0]}return createAlternative(res,from,pos)}function parseTerm(){if(pos>=str.length||current("|")||current(")")){return null}var anchor=parseAnchor();if(anchor){return anchor}var atom=parseAtom();if(!atom){throw SyntaxError("Expected atom")}var quantifier=parseQuantifier()||false;if(quantifier){quantifier.body=flattenBody(atom);updateRawStart(quantifier,atom.range[0]);return quantifier}return atom}function parseGroup(matchA,typeA,matchB,typeB){var type=null,from=pos;if(match(matchA)){type=typeA}else if(match(matchB)){type=typeB}else{return false}var body=parseDisjunction();if(!body){throw SyntaxError("Expected disjunction")}skip(")");var group=createGroup(type,flattenBody(body),from,pos);if(type=="normal"){closedCaptureCounter++}return group}function parseAnchor(){var res,from=pos;if(match("^")){return createAnchor("start",1)}else if(match("$")){return createAnchor("end",1)}else if(match("\\b")){return createAnchor("boundary",2)}else if(match("\\B")){return createAnchor("not-boundary",2)}else{return parseGroup("(?=","lookahead","(?!","negativeLookahead")}}function parseQuantifier(){var res;var quantifier;var min,max;if(match("*")){quantifier=createQuantifier(0)}else if(match("+")){quantifier=createQuantifier(1)}else if(match("?")){quantifier=createQuantifier(0,1)}else if(res=matchReg(/^\{([0-9]+)\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,min,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,undefined,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),([0-9]+)\}/)){min=parseInt(res[1],10);max=parseInt(res[2],10);if(min>max){throw SyntaxError("numbers out of order in {} quantifier")}quantifier=createQuantifier(min,max,res.range[0],res.range[1])}if(quantifier){if(match("?")){quantifier.greedy=false;quantifier.range[1]+=1}}return quantifier}function parseAtom(){var res;if(res=matchReg(/^[^^$\\.*+?(){[|]/)){return createCharacter(res)}else if(match(".")){return createDot()}else if(match("\\")){res=parseAtomEscape();if(!res){throw SyntaxError("atomEscape")}return res}else if(res=parseCharacterClass()){return res}else{return parseGroup("(?:","ignore","(","normal")}}function parseUnicodeSurrogatePairEscape(firstEscape){if(hasUnicodeFlag){var first,second;if(firstEscape.kind=="unicodeEscape"&&(first=firstEscape.codePoint)>=55296&&first<=56319&¤t("\\")&&next("u")){var prevPos=pos;pos++;var secondEscape=parseClassEscape();if(secondEscape.kind=="unicodeEscape"&&(second=secondEscape.codePoint)>=56320&&second<=57343){firstEscape.range[1]=secondEscape.range[1];firstEscape.codePoint=(first-55296)*1024+second-56320+65536;firstEscape.type="value";firstEscape.kind="unicodeCodePointEscape";addRaw(firstEscape)}else{pos=prevPos}}}return firstEscape}function parseClassEscape(){return parseAtomEscape(true)}function parseAtomEscape(insideCharacterClass){var res;res=parseDecimalEscape();if(res){return res}if(insideCharacterClass){if(match("b")){return createEscaped("singleEscape",8,"\\b")}else if(match("B")){throw SyntaxError("\\B not possible inside of CharacterClass")}}res=parseCharacterEscape();return res}function parseDecimalEscape(){var res,match;if(res=matchReg(/^(?!0)\d+/)){match=res[0];var refIdx=parseInt(res[0],10);if(refIdx<=closedCaptureCounter){return createReference(res[0])}else{incr(-res[0].length);if(res=matchReg(/^[0-7]{1,3}/)){return createEscaped("octal",parseInt(res[0],8),res[0],1)}else{res=createCharacter(matchReg(/^[89]/));return updateRawStart(res,res.range[0]-1)}}}else if(res=matchReg(/^[0-7]{1,3}/)){match=res[0];if(/^0{1,3}$/.test(match)){return createEscaped("null",0,"0",match.length+1)}else{return createEscaped("octal",parseInt(match,8),match,1)}}else if(res=matchReg(/^[dDsSwW]/)){return createCharacterClassEscape(res[0])}return false}function parseCharacterEscape(){var res;if(res=matchReg(/^[fnrtv]/)){var codePoint=0;switch(res[0]){case"t":codePoint=9;break;case"n":codePoint=10;break;case"v":codePoint=11;break;case"f":codePoint=12;break;case"r":codePoint=13;break}return createEscaped("singleEscape",codePoint,"\\"+res[0])}else if(res=matchReg(/^c([a-zA-Z])/)){return createEscaped("controlLetter",res[1].charCodeAt(0)%32,res[1],2)}else if(res=matchReg(/^x([0-9a-fA-F]{2})/)){return createEscaped("hexadecimalEscape",parseInt(res[1],16),res[1],2)}else if(res=matchReg(/^u([0-9a-fA-F]{4})/)){return parseUnicodeSurrogatePairEscape(createEscaped("unicodeEscape",parseInt(res[1],16),res[1],2))}else if(hasUnicodeFlag&&(res=matchReg(/^u\{([0-9a-fA-F]{1,6})\}/))){return createEscaped("unicodeCodePointEscape",parseInt(res[1],16),res[1],4)}else{return parseIdentityEscape()}}function isIdentifierPart(ch){var NonAsciiIdentifierPart=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function parseIdentityEscape(){var ZWJ="";var ZWNJ="";var res;var tmp;if(!isIdentifierPart(lookahead())){tmp=incr();return createEscaped("identifier",tmp.charCodeAt(0),tmp,1)}if(match(ZWJ)){return createEscaped("identifier",8204,ZWJ)}else if(match(ZWNJ)){return createEscaped("identifier",8205,ZWNJ)}return null}function parseCharacterClass(){var res,from=pos;if(res=matchReg(/^\[\^/)){res=parseClassRanges();skip("]");return createCharacterClass(res,true,from,pos)}else if(match("[")){res=parseClassRanges();skip("]");return createCharacterClass(res,false,from,pos)}return null}function parseClassRanges(){var res;if(current("]")){return[]}else{res=parseNonemptyClassRanges();if(!res){throw SyntaxError("nonEmptyClassRanges")}return res}}function parseHelperClassRanges(atom){var from,to,res;if(current("-")&&!next("]")){skip("-");res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}to=pos;var classRanges=parseClassRanges();if(!classRanges){throw SyntaxError("classRanges")}from=atom.range[0];if(classRanges.type==="empty"){return[createClassRange(atom,res,from,to)]}return[createClassRange(atom,res,from,to)].concat(classRanges)}res=parseNonemptyClassRangesNoDash();if(!res){throw SyntaxError("nonEmptyClassRangesNoDash")}return[atom].concat(res)}function parseNonemptyClassRanges(){var atom=parseClassAtom();if(!atom){throw SyntaxError("classAtom")}if(current("]")){return[atom]}return parseHelperClassRanges(atom)}function parseNonemptyClassRangesNoDash(){var res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}if(current("]")){return res}return parseHelperClassRanges(res)}function parseClassAtom(){if(match("-")){return createCharacter("-")}else{return parseClassAtomNoDash()}}function parseClassAtomNoDash(){var res;if(res=matchReg(/^[^\\\]-]/)){return createCharacter(res[0])}else if(match("\\")){res=parseClassEscape();if(!res){throw SyntaxError("classEscape")}return parseUnicodeSurrogatePairEscape(res)}}str=String(str);if(str===""){str="(?:)"}var result=parseDisjunction();if(result.range[1]!==str.length){throw SyntaxError("Could not parse entire input - got stuck: "+str)}return result}var regjsparser={parse:parse};if(typeof module!=="undefined"&&module.exports){module.exports=regjsparser}else{window.regjsparser=regjsparser}})()},{}],126:[function(require,module,exports){var generate=require("regjsgen").generate;var parse=require("regjsparser").parse;var regenerate=require("regenerate");var iuMappings=require("./data/iu-mappings.json");var ESCAPE_SETS=require("./data/character-class-escape-sets.js");function getCharacterClassEscapeSet(character){if(unicode){if(ignoreCase){return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]}return ESCAPE_SETS.UNICODE[character]}return ESCAPE_SETS.REGULAR[character]}var object={};var hasOwnProperty=object.hasOwnProperty;function has(object,property){return hasOwnProperty.call(object,property)}var UNICODE_SET=regenerate().addRange(0,1114111);var BMP_SET=regenerate().addRange(0,65535);var DOT_SET_UNICODE=UNICODE_SET.clone().remove(10,13,8232,8233);var DOT_SET=DOT_SET_UNICODE.clone().intersection(BMP_SET);regenerate.prototype.iuAddRange=function(min,max){var $this=this;do{var folded=caseFold(min);if(folded){$this.add(folded)}}while(++min<=max);return $this};function assign(target,source){for(var key in source){target[key]=source[key]}}function update(item,pattern){var tree=parse(pattern,"");switch(tree.type){case"characterClass":case"group":case"value":break;default:tree=wrap(tree,pattern)}assign(item,tree)}function wrap(tree,pattern){return{type:"group",behavior:"ignore",body:[tree],raw:"(?:"+pattern+")"}}function caseFold(codePoint){return has(iuMappings,codePoint)?iuMappings[codePoint]:false}var ignoreCase=false;var unicode=false;function processCharacterClass(characterClassItem){var set=regenerate();var body=characterClassItem.body.forEach(function(item){switch(item.type){case"value":set.add(item.codePoint);if(ignoreCase&&unicode){var folded=caseFold(item.codePoint);if(folded){set.add(folded)}}break;case"characterClassRange":var min=item.min.codePoint;var max=item.max.codePoint;set.addRange(min,max);if(ignoreCase&&unicode){set.iuAddRange(min,max)}break;case"characterClassEscape":set.add(getCharacterClassEscapeSet(item.value));break;default:throw Error("Unknown term type: "+item.type)}});if(characterClassItem.negative){set=(unicode?UNICODE_SET:BMP_SET).clone().remove(set)}update(characterClassItem,set.toString());return characterClassItem}function processTerm(item){switch(item.type){case"dot":update(item,(unicode?DOT_SET_UNICODE:DOT_SET).toString());break;case"characterClass":item=processCharacterClass(item);break;case"characterClassEscape":update(item,getCharacterClassEscapeSet(item.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":item.body=item.body.map(processTerm);break;case"value":var codePoint=item.codePoint;var set=regenerate(codePoint);if(ignoreCase&&unicode){var folded=caseFold(codePoint);if(folded){set.add(folded)}}update(item,set.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+item.type)}return item}module.exports=function(pattern,flags){var tree=parse(pattern,flags);ignoreCase=flags?flags.indexOf("i")>-1:false;unicode=flags?flags.indexOf("u")>-1:false;assign(tree,processTerm(tree));return generate(tree)}},{"./data/character-class-escape-sets.js":121,"./data/iu-mappings.json":122,regenerate:123,regjsgen:124,regjsparser:125}],127:[function(require,module,exports){exports.SourceMapGenerator=require("./source-map/source-map-generator").SourceMapGenerator;exports.SourceMapConsumer=require("./source-map/source-map-consumer").SourceMapConsumer;exports.SourceNode=require("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":132,"./source-map/source-map-generator":133,"./source-map/source-node":134}],128:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)
}define(function(require,exports,module){var util=require("./util");function ArraySet(){this._array=[];this._set={}}ArraySet.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet;for(var i=0,len=aArray.length;i<len;i++){set.add(aArray[i],aAllowDuplicates)}return set};ArraySet.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var isDuplicate=this.has(aStr);var idx=this._array.length;if(!isDuplicate||aAllowDuplicates){this._array.push(aStr)}if(!isDuplicate){this._set[util.toSetString(aStr)]=idx}};ArraySet.prototype.has=function ArraySet_has(aStr){return Object.prototype.hasOwnProperty.call(this._set,util.toSetString(aStr))};ArraySet.prototype.indexOf=function ArraySet_indexOf(aStr){if(this.has(aStr)){return this._set[util.toSetString(aStr)]}throw new Error('"'+aStr+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length){return this._array[aIdx]}throw new Error("No element indexed by "+aIdx)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};exports.ArraySet=ArraySet})},{"./util":135,amdefine:136}],129:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64=require("./base64");var VLQ_BASE_SHIFT=5;var VLQ_BASE=1<<VLQ_BASE_SHIFT;var VLQ_BASE_MASK=VLQ_BASE-1;var VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(aValue){return aValue<0?(-aValue<<1)+1:(aValue<<1)+0}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted}exports.encode=function base64VLQ_encode(aValue){var encoded="";var digit;var vlq=toVLQSigned(aValue);do{digit=vlq&VLQ_BASE_MASK;vlq>>>=VLQ_BASE_SHIFT;if(vlq>0){digit|=VLQ_CONTINUATION_BIT}encoded+=base64.encode(digit)}while(vlq>0);return encoded};exports.decode=function base64VLQ_decode(aStr,aOutParam){var i=0;var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do{if(i>=strLen){throw new Error("Expected more digits in base 64 VLQ value.")}digit=base64.decode(aStr.charAt(i++));continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<<shift);shift+=VLQ_BASE_SHIFT}while(continuation);aOutParam.value=fromVLQSigned(result);aOutParam.rest=aStr.slice(i)}})},{"./base64":130,amdefine:136}],130:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var charToIntMap={};var intToCharMap={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(ch,index){charToIntMap[ch]=index;intToCharMap[index]=ch});exports.encode=function base64_encode(aNumber){if(aNumber in intToCharMap){return intToCharMap[aNumber]}throw new TypeError("Must be between 0 and 63: "+aNumber)};exports.decode=function base64_decode(aChar){if(aChar in charToIntMap){return charToIntMap[aChar]}throw new TypeError("Not a valid base 64 digit: "+aChar)}})},{amdefine:136}],131:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){var mid=Math.floor((aHigh-aLow)/2)+aLow;var cmp=aCompare(aNeedle,aHaystack[mid],true);if(cmp===0){return aHaystack[mid]}else if(cmp>0){if(aHigh-mid>1){return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare)}return aHaystack[mid]}else{if(mid-aLow>1){return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare)}return aLow<0?null:aHaystack[aLow]}}exports.search=function search(aNeedle,aHaystack,aCompare){return aHaystack.length>0?recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare):null}})},{amdefine:136}],132:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");var binarySearch=require("./binary-search");var ArraySet=require("./array-set").ArraySet;var base64VLQ=require("./base64-vlq");function SourceMapConsumer(aSourceMap){var sourceMap=aSourceMap;if(typeof aSourceMap==="string"){sourceMap=JSON.parse(aSourceMap.replace(/^\)\]\}'/,""))}var version=util.getArg(sourceMap,"version");var sources=util.getArg(sourceMap,"sources");var names=util.getArg(sourceMap,"names",[]);var sourceRoot=util.getArg(sourceMap,"sourceRoot",null);var sourcesContent=util.getArg(sourceMap,"sourcesContent",null);var mappings=util.getArg(sourceMap,"mappings");var file=util.getArg(sourceMap,"file",null);if(version!=this._version){throw new Error("Unsupported version: "+version)}this._names=ArraySet.fromArray(names,true);this._sources=ArraySet.fromArray(sources,true);this.sourceRoot=sourceRoot;this.sourcesContent=sourcesContent;this._mappings=mappings;this.file=file}SourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(aSourceMap){var smc=Object.create(SourceMapConsumer.prototype);smc._names=ArraySet.fromArray(aSourceMap._names.toArray(),true);smc._sources=ArraySet.fromArray(aSourceMap._sources.toArray(),true);smc.sourceRoot=aSourceMap._sourceRoot;smc.sourcesContent=aSourceMap._generateSourcesContent(smc._sources.toArray(),smc.sourceRoot);smc.file=aSourceMap._file;smc.__generatedMappings=aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);smc.__originalMappings=aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);return smc};SourceMapConsumer.prototype._version=3;Object.defineProperty(SourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map(function(s){return this.sourceRoot!=null?util.join(this.sourceRoot,s):s},this)}});SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._nextCharIsMappingSeparator=function SourceMapConsumer_nextCharIsMappingSeparator(aStr){var c=aStr.charAt(0);return c===";"||c===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(aStr,aSourceRoot){var generatedLine=1;var previousGeneratedColumn=0;var previousOriginalLine=0;var previousOriginalColumn=0;var previousSource=0;var previousName=0;var str=aStr;var temp={};var mapping;while(str.length>0){if(str.charAt(0)===";"){generatedLine++;str=str.slice(1);previousGeneratedColumn=0}else if(str.charAt(0)===","){str=str.slice(1)}else{mapping={};mapping.generatedLine=generatedLine;base64VLQ.decode(str,temp);mapping.generatedColumn=previousGeneratedColumn+temp.value;previousGeneratedColumn=mapping.generatedColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.source=this._sources.at(previousSource+temp.value);previousSource+=temp.value;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source, but no line and column")}base64VLQ.decode(str,temp);mapping.originalLine=previousOriginalLine+temp.value;previousOriginalLine=mapping.originalLine;mapping.originalLine+=1;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source and line, but no column")}base64VLQ.decode(str,temp);mapping.originalColumn=previousOriginalColumn+temp.value;previousOriginalColumn=mapping.originalColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.name=this._names.at(previousName+temp.value);previousName+=temp.value;str=temp.rest}}this.__generatedMappings.push(mapping);if(typeof mapping.originalLine==="number"){this.__originalMappings.push(mapping)}}}this.__generatedMappings.sort(util.compareByGeneratedPositions);this.__originalMappings.sort(util.compareByOriginalPositions)};SourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator){if(aNeedle[aLineName]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName])}if(aNeedle[aColumnName]<0){throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName])}return binarySearch.search(aNeedle,aMappings,aComparator)};SourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(aArgs){var needle={generatedLine:util.getArg(aArgs,"line"),generatedColumn:util.getArg(aArgs,"column")};var mapping=this._findMapping(needle,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositions);if(mapping&&mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);if(source!=null&&this.sourceRoot!=null){source=util.join(this.sourceRoot,source)}return{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:util.getArg(mapping,"name",null)}}return{source:null,line:null,column:null,name:null}};SourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){aSource=util.relative(this.sourceRoot,aSource)}if(this._sources.has(aSource)){return this.sourcesContent[this._sources.indexOf(aSource)]}var url;if(this.sourceRoot!=null&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=aSource.replace(/^file:\/\//,"");if(url.scheme=="file"&&this._sources.has(fileUriAbsPath)){return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]}if((!url.path||url.path=="/")&&this._sources.has("/"+aSource)){return this.sourcesContent[this._sources.indexOf("/"+aSource)]}}throw new Error('"'+aSource+'" is not in the SourceMap.')};SourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var mapping=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(mapping){return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null)}}return{line:null,column:null}};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){var context=aContext||null;var order=aOrder||SourceMapConsumer.GENERATED_ORDER;var mappings;switch(order){case SourceMapConsumer.GENERATED_ORDER:mappings=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:mappings=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var sourceRoot=this.sourceRoot;mappings.map(function(mapping){var source=mapping.source;if(source!=null&&sourceRoot!=null){source=util.join(sourceRoot,source)}return{source:source,generatedLine:mapping.generatedLine,generatedColumn:mapping.generatedColumn,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:mapping.name}}).forEach(aCallback,context)};exports.SourceMapConsumer=SourceMapConsumer})},{"./array-set":128,"./base64-vlq":129,"./binary-search":131,"./util":135,amdefine:136}],133:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64VLQ=require("./base64-vlq");var util=require("./util");var ArraySet=require("./array-set").ArraySet;function SourceMapGenerator(aArgs){if(!aArgs){aArgs={}}this._file=util.getArg(aArgs,"file",null);this._sourceRoot=util.getArg(aArgs,"sourceRoot",null);this._sources=new ArraySet;this._names=new ArraySet;this._mappings=[];this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer){var sourceRoot=aSourceMapConsumer.sourceRoot;var generator=new SourceMapGenerator({file:aSourceMapConsumer.file,sourceRoot:sourceRoot});aSourceMapConsumer.eachMapping(function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}};if(mapping.source!=null){newMapping.source=mapping.source;if(sourceRoot!=null){newMapping.source=util.relative(sourceRoot,newMapping.source)}newMapping.original={line:mapping.originalLine,column:mapping.originalColumn};if(mapping.name!=null){newMapping.name=mapping.name}}generator.addMapping(newMapping)});aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){generator.setSourceContent(sourceFile,content)}});return generator};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated");var original=util.getArg(aArgs,"original",null);var source=util.getArg(aArgs,"source",null);var name=util.getArg(aArgs,"name",null);this._validateMapping(generated,original,source,name);if(source!=null&&!this._sources.has(source)){this._sources.add(source)}if(name!=null&&!this._names.has(name)){this._names.add(name)}this._mappings.push({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile;if(this._sourceRoot!=null){source=util.relative(this._sourceRoot,source)}if(aSourceContent!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile;if(aSourceFile==null){if(aSourceMapConsumer.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot;if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}var newSources=new ArraySet;var newNames=new ArraySet;this._mappings.forEach(function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});if(original.source!=null){mapping.source=original.source;if(aSourceMapPath!=null){mapping.source=util.join(aSourceMapPath,mapping.source)}if(sourceRoot!=null){mapping.source=util.relative(sourceRoot,mapping.source)}mapping.originalLine=original.line;mapping.originalColumn=original.column;if(original.name!=null){mapping.name=original.name}}}var source=mapping.source;if(source!=null&&!newSources.has(source)){newSources.add(source)}var name=mapping.name;if(name!=null&&!newNames.has(name)){newNames.add(name)}},this);this._sources=newSources;this._names=newNames;aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aSourceMapPath!=null){sourceFile=util.join(aSourceMapPath,sourceFile)}if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}this.setSourceContent(sourceFile,content)}},this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName){return}else if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0;var previousGeneratedLine=1;var previousOriginalColumn=0;var previousOriginalLine=0;var previousName=0;var previousSource=0;var result="";var mapping;this._mappings.sort(util.compareByGeneratedPositions);for(var i=0,len=this._mappings.length;i<len;i++){mapping=this._mappings[i];if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0;while(mapping.generatedLine!==previousGeneratedLine){result+=";";previousGeneratedLine++}}else{if(i>0){if(!util.compareByGeneratedPositions(mapping,this._mappings[i-1])){continue}result+=","}}result+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn);previousGeneratedColumn=mapping.generatedColumn;if(mapping.source!=null){result+=base64VLQ.encode(this._sources.indexOf(mapping.source)-previousSource);previousSource=this._sources.indexOf(mapping.source);result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOriginalLine=mapping.originalLine-1;result+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn);previousOriginalColumn=mapping.originalColumn;if(mapping.name!=null){result+=base64VLQ.encode(this._names.indexOf(mapping.name)-previousName);previousName=this._names.indexOf(mapping.name)}}}return result};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map(function(source){if(!this._sourcesContents){return null}if(aSourceRoot!=null){source=util.relative(aSourceRoot,source)}var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null},this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)}return map};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this)};exports.SourceMapGenerator=SourceMapGenerator})},{"./array-set":128,"./base64-vlq":129,"./util":135,amdefine:136}],134:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var SourceMapGenerator=require("./source-map-generator").SourceMapGenerator;var util=require("./util");var REGEX_NEWLINE=/(\r?\n)/;var REGEX_CHARACTER=/\r\n|[\s\S]/g;function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;if(aChunks!=null)this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode;var remainingLines=aGeneratedCode.split(REGEX_NEWLINE);var shiftNextLine=function(){var lineContents=remainingLines.shift();var newLine=remainingLines.shift()||"";return lineContents+newLine};var lastGeneratedLine=1,lastGeneratedColumn=0;var lastMapping=null;aSourceMapConsumer.eachMapping(function(mapping){if(lastMapping!==null){if(lastGeneratedLine<mapping.generatedLine){var code="";addMappingWithCode(lastMapping,shiftNextLine());lastGeneratedLine++;lastGeneratedColumn=0}else{var nextLine=remainingLines[0];var code=nextLine.substr(0,mapping.generatedColumn-lastGeneratedColumn);remainingLines[0]=nextLine.substr(mapping.generatedColumn-lastGeneratedColumn);lastGeneratedColumn=mapping.generatedColumn;addMappingWithCode(lastMapping,code);lastMapping=mapping;return}}while(lastGeneratedLine<mapping.generatedLine){node.add(shiftNextLine());lastGeneratedLine++}if(lastGeneratedColumn<mapping.generatedColumn){var nextLine=remainingLines[0];node.add(nextLine.substr(0,mapping.generatedColumn));remainingLines[0]=nextLine.substr(mapping.generatedColumn);lastGeneratedColumn=mapping.generatedColumn}lastMapping=mapping},this);if(remainingLines.length>0){if(lastMapping){addMappingWithCode(lastMapping,shiftNextLine())}node.add(remainingLines.join(""))}aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aRelativePath!=null){sourceFile=util.join(aRelativePath,sourceFile)}node.setSourceContent(sourceFile,content)}});return node;function addMappingWithCode(mapping,code){if(mapping===null||mapping.source===undefined){node.add(code)}else{var source=aRelativePath?util.join(aRelativePath,mapping.source):mapping.source;node.add(new SourceNode(mapping.originalLine,mapping.originalColumn,source,code,mapping.name))}}};SourceNode.prototype.add=function SourceNode_add(aChunk){if(Array.isArray(aChunk)){aChunk.forEach(function(chunk){this.add(chunk)},this)}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){if(aChunk){this.children.push(aChunk)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.prepend=function SourceNode_prepend(aChunk){if(Array.isArray(aChunk)){for(var i=aChunk.length-1;i>=0;i--){this.prepend(aChunk[i])}}else if(aChunk instanceof SourceNode||typeof aChunk==="string"){this.children.unshift(aChunk)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.walk=function SourceNode_walk(aFn){var chunk;for(var i=0,len=this.children.length;i<len;i++){chunk=this.children[i];if(chunk instanceof SourceNode){chunk.walk(aFn)}else{if(chunk!==""){aFn(chunk,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};SourceNode.prototype.join=function SourceNode_join(aSep){var newChildren;var i;var len=this.children.length;if(len>0){newChildren=[];for(i=0;i<len-1;i++){newChildren.push(this.children[i]);newChildren.push(aSep)}newChildren.push(this.children[i]);this.children=newChildren}return this};SourceNode.prototype.replaceRight=function SourceNode_replaceRight(aPattern,aReplacement){var lastChild=this.children[this.children.length-1];if(lastChild instanceof SourceNode){lastChild.replaceRight(aPattern,aReplacement)}else if(typeof lastChild==="string"){this.children[this.children.length-1]=lastChild.replace(aPattern,aReplacement)}else{this.children.push("".replace(aPattern,aReplacement))}return this};SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(aSourceFile,aSourceContent){this.sourceContents[util.toSetString(aSourceFile)]=aSourceContent};SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(aFn){for(var i=0,len=this.children.length;i<len;i++){if(this.children[i]instanceof SourceNode){this.children[i].walkSourceContents(aFn)}}var sources=Object.keys(this.sourceContents);for(var i=0,len=sources.length;i<len;i++){aFn(util.fromSetString(sources[i]),this.sourceContents[sources[i]])}};SourceNode.prototype.toString=function SourceNode_toString(){var str="";this.walk(function(chunk){str+=chunk});return str};SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false}chunk.match(REGEX_CHARACTER).forEach(function(ch,idx,array){if(REGEX_NEWLINE.test(ch)){generated.line++;generated.column=0;if(idx+1===array.length){lastOriginalSource=null;sourceMappingActive=false}else if(sourceMappingActive){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}}else{generated.column+=ch.length}})});this.walkSourceContents(function(sourceFile,sourceContent){map.setSourceContent(sourceFile,sourceContent)});return{code:generated.code,map:map}};exports.SourceNode=SourceNode})},{"./source-map-generator":133,"./util":135,amdefine:136}],135:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName]}else if(arguments.length===3){return aDefaultValue}else{throw new Error('"'+aName+'" is a required argument.')}}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var dataUrlRegexp=/^data:.+\,.+$/;function urlParse(aUrl){var match=aUrl.match(urlRegexp);if(!match){return null}return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse;function urlGenerate(aParsedUrl){var url="";if(aParsedUrl.scheme){url+=aParsedUrl.scheme+":"}url+="//";if(aParsedUrl.auth){url+=aParsedUrl.auth+"@"}if(aParsedUrl.host){url+=aParsedUrl.host}if(aParsedUrl.port){url+=":"+aParsedUrl.port}if(aParsedUrl.path){url+=aParsedUrl.path}return url}exports.urlGenerate=urlGenerate;function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath}path=url.path}var isAbsolute=path.charAt(0)==="/";var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==="."){parts.splice(i,1)}else if(part===".."){up++}else if(up>0){if(part===""){parts.splice(i+1,up);up=0}else{parts.splice(i,2);up--}}}path=parts.join("/");if(path===""){path=isAbsolute?"/":"."}if(url){url.path=path;return urlGenerate(url)}return path}exports.normalize=normalize;function join(aRoot,aPath){if(aRoot===""){aRoot="."}if(aPath===""){aPath="."}var aPathUrl=urlParse(aPath);var aRootUrl=urlParse(aRoot);if(aRootUrl){aRoot=aRootUrl.path||"/"}if(aPathUrl&&!aPathUrl.scheme){if(aRootUrl){aPathUrl.scheme=aRootUrl.scheme}return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp)){return aPath}if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath;return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);if(aRootUrl){aRootUrl.path=joined;return urlGenerate(aRootUrl)}return joined}exports.join=join;function relative(aRoot,aPath){if(aRoot===""){aRoot="."}aRoot=aRoot.replace(/\/$/,"");var url=urlParse(aRoot);if(aPath.charAt(0)=="/"&&url&&url.path=="/"){return aPath.slice(1)}return aPath.indexOf(aRoot+"/")===0?aPath.substr(aRoot.length+1):aPath}exports.relative=relative;function toSetString(aStr){return"$"+aStr}exports.toSetString=toSetString;function fromSetString(aStr){return aStr.substr(1)}exports.fromSetString=fromSetString;function strcmp(aStr1,aStr2){var s1=aStr1||"";var s2=aStr2||"";return(s1>s2)-(s1<s2)}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp;cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp||onlyCompareOriginal){return cmp}cmp=strcmp(mappingA.name,mappingB.name);if(cmp){return cmp}cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}return mappingA.generatedColumn-mappingB.generatedColumn}exports.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositions(mappingA,mappingB,onlyCompareGenerated){var cmp;cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp||onlyCompareGenerated){return cmp}cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp){return cmp}return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositions=compareByGeneratedPositions})},{amdefine:136}],136:[function(require,module,exports){(function(process,__filename){"use strict";function amdefine(module,requireFn){"use strict";var defineCache={},loaderCache={},alreadyCalled=false,path=require("path"),makeRequire,stringRequire;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName){var baseParts;if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseName.split("/");baseParts=baseParts.slice(0,baseParts.length-1);baseParts=baseParts.concat(name.split("/"));trimDots(baseParts);name=baseParts.join("/")}}return name}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(id){function load(value){loaderCache[id]=value}load.fromText=function(id,text){throw new Error("amdefine does not implement load.fromText")};return load}makeRequire=function(systemRequire,exports,module,relId){function amdRequire(deps,callback){if(typeof deps==="string"){return stringRequire(systemRequire,exports,module,deps,relId)}else{deps=deps.map(function(depName){return stringRequire(systemRequire,exports,module,depName,relId)});process.nextTick(function(){callback.apply(null,deps)})}}amdRequire.toUrl=function(filePath){if(filePath.indexOf(".")===0){return normalize(filePath,path.dirname(module.filename))}else{return filePath}};return amdRequire};requireFn=requireFn||function req(){return module.require.apply(module,arguments)};function runFactory(id,deps,factory){var r,e,m,result;if(id){e=loaderCache[id]={};m={id:id,uri:__filename,exports:e};r=makeRequire(requireFn,e,m,id)}else{if(alreadyCalled){throw new Error("amdefine with no module ID cannot be called more than once per file.")}alreadyCalled=true;e=module.exports;m=module;r=makeRequire(requireFn,e,m,module.id)}if(deps){deps=deps.map(function(depName){return r(depName)})}if(typeof factory==="function"){result=factory.apply(m.exports,deps)}else{result=factory}if(result!==undefined){m.exports=result;if(id){loaderCache[id]=m.exports}}}stringRequire=function(systemRequire,exports,module,id,relId){var index=id.indexOf("!"),originalId=id,prefix,plugin;if(index===-1){id=normalize(id,relId);if(id==="require"){return makeRequire(systemRequire,exports,module,relId)}else if(id==="exports"){return exports}else if(id==="module"){return module}else if(loaderCache.hasOwnProperty(id)){return loaderCache[id]}else if(defineCache[id]){runFactory.apply(null,defineCache[id]);
return loaderCache[id]}else{if(systemRequire){return systemRequire(originalId)}else{throw new Error("No module with ID: "+id)}}}else{prefix=id.substring(0,index);id=id.substring(index+1,id.length);plugin=stringRequire(systemRequire,exports,module,prefix,relId);if(plugin.normalize){id=plugin.normalize(id,makeNormalize(relId))}else{id=normalize(id,relId)}if(loaderCache[id]){return loaderCache[id]}else{plugin.load(id,makeRequire(systemRequire,exports,module,relId),makeLoad(id),{});return loaderCache[id]}}};function define(id,deps,factory){if(Array.isArray(id)){factory=deps;deps=id;id=undefined}else if(typeof id!=="string"){factory=id;id=deps=undefined}if(deps&&!Array.isArray(deps)){factory=deps;deps=undefined}if(!deps){deps=["require","exports","module"]}if(id){defineCache[id]=[id,deps,factory]}else{runFactory(id,deps,factory)}}define.require=function(id){if(loaderCache[id]){return loaderCache[id]}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}};define.amd={};return define}module.exports=amdefine}).call(this,require("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:83,path:82}],137:[function(require,module,exports){module.exports={"arguments-slice-assign-arg":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SLICE_KEY"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"arguments"},{type:"Identifier",name:"SLICE_ARG"}]}}],kind:"var"}]},"arguments-slice-assign":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SLICE_KEY"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"arguments"}]}}],kind:"var"}]},"arguments-slice":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SLICE_KEY"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"arguments"}]}}]},"array-comprehension-container":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"KEY"},init:{type:"ArrayExpression",elements:[]}}],kind:"var"},{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false}},arguments:[]}}]},"array-comprehension-for-each":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"forEach"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[]},expression:false}]}}]},"array-expression-comprehension-filter":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"filter"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"FILTER"}}]},expression:false}]},property:{type:"Identifier",name:"map"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"STATEMENT"}}]},expression:false}]}}]},"array-expression-comprehension-map":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ARRAY"},property:{type:"Identifier",name:"map"},computed:false},arguments:[{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"STATEMENT"}}]},expression:false}]}}]},"array-push":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"KEY"},property:{type:"Identifier",name:"push"},computed:false},arguments:[{type:"Identifier",name:"STATEMENT"}]}}]},call:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"Identifier",name:"call"},computed:false},arguments:[{type:"Identifier",name:"CONTEXT"}]}}]},"class-props":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"},{type:"Identifier",name:"instanceProps"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"Identifier",name:"staticProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"child"},{type:"Identifier",name:"staticProps"}]}},alternate:null},{type:"IfStatement",test:{type:"Identifier",name:"instanceProps"},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},{type:"Identifier",name:"instanceProps"}]}},alternate:null}]},expression:false}}}]},"class-super-constructor-call":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"SUPER_NAME"},property:{type:"Identifier",name:"apply"},computed:false},arguments:[{type:"ThisExpression"},{type:"Identifier",name:"arguments"}]}}]},"class":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"CLASS_NAME"},init:{type:"FunctionExpression",id:null,params:[],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[]},expression:false}}],kind:"var"},{type:"ReturnStatement",argument:{type:"Identifier",name:"CLASS_NAME"}}]},expression:false}},arguments:[]}}]},"exports-assign-key":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"VARIABLE_NAME"},computed:false},right:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"Identifier",name:"KEY"},computed:false}}}]},"exports-assign":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"KEY"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-default":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"default"},computed:false},right:{type:"Identifier",name:"VALUE"}}}]},"exports-wildcard":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"obj"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ForInStatement",left:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"i"},init:null}],kind:"var"},right:{type:"Identifier",name:"obj"},body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"exports"},property:{type:"Identifier",name:"i"},computed:true},right:{type:"MemberExpression",object:{type:"Identifier",name:"obj"},property:{type:"Identifier",name:"i"},computed:true}}}]}}]},expression:false}},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"extends":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"child"},{type:"Identifier",name:"parent"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"prototype"},computed:false},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"create"},computed:false},arguments:[{type:"MemberExpression",object:{type:"Identifier",name:"parent"},property:{type:"Identifier",name:"prototype"},computed:false},{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"constructor"},value:{type:"ObjectExpression",properties:[{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"value"},value:{type:"Identifier",name:"child"},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"enumerable"},value:{type:"Literal",value:false},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"writable"},value:{type:"Literal",value:true},kind:"init"},{type:"Property",method:false,shorthand:false,computed:false,key:{type:"Identifier",name:"configurable"},value:{type:"Literal",value:true},kind:"init"}]},kind:"init"}]}]}}},{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",object:{type:"Identifier",name:"child"},property:{type:"Identifier",name:"__proto__"},computed:false},right:{type:"Identifier",name:"parent"}}}]},expression:false}}}]},"for-of":{type:"Program",body:[{type:"ForStatement",init:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"ITERATOR_KEY"},init:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"OBJECT"},property:{type:"MemberExpression",object:{type:"Identifier",name:"Symbol"},property:{type:"Identifier",name:"iterator"},computed:false},computed:true},arguments:[]}},{type:"VariableDeclarator",id:{type:"Identifier",name:"STEP_KEY"},init:null}],kind:"var"},test:{type:"UnaryExpression",operator:"!",prefix:true,argument:{type:"MemberExpression",object:{type:"ParenthesizedExpression",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"STEP_KEY"},right:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"ITERATOR_KEY"},property:{type:"Identifier",name:"next"},computed:false},arguments:[]}}},property:{type:"Identifier",name:"done"},computed:false}},update:null,body:{type:"BlockStatement",body:[]}}]},"function-return-obj":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false}},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"if-undefined-set-to":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"Identifier",name:"VARIABLE"},operator:"===",right:{type:"Identifier",name:"undefined"}},consequent:{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"Identifier",name:"VARIABLE"},right:{type:"Identifier",name:"DEFAULT"}}},alternate:null}]},"let-scoping-return":{type:"Program",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"RETURN"}},operator:"===",right:{type:"Literal",value:"object"}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"Identifier",name:"RETURN"},property:{type:"Identifier",name:"v"},computed:false}},alternate:null}]},"object-define-properties-closure":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"KEY"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"Identifier",name:"CONTENT"}},{type:"ReturnStatement",argument:{type:"Identifier",name:"KEY"}}]},expression:false}},arguments:[{type:"Identifier",name:"OBJECT"}]}}]},"object-define-properties":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"MemberExpression",object:{type:"Identifier",name:"Object"},property:{type:"Identifier",name:"defineProperties"},computed:false},arguments:[{type:"Identifier",name:"OBJECT"},{type:"Identifier",name:"PROPS"}]}}]},"prototype-identifier":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"Identifier",name:"CLASS_NAME"},property:{type:"Identifier",name:"prototype"},computed:false}}]},"require-assign-key":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"MemberExpression",object:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]},property:{type:"Identifier",name:"KEY"},computed:false}}],kind:"var"}]},"require-assign":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"VARIABLE_NAME"},init:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}],kind:"var"}]},require:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"require"},arguments:[{type:"Identifier",name:"MODULE_NAME"}]}}]},"self-global":{type:"Program",body:[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"self"},init:{type:"ConditionalExpression",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"global"}},operator:"===",right:{type:"Literal",value:"undefined"}},consequent:{type:"Identifier",name:"window"},alternate:{type:"Identifier",name:"global"}}}],kind:"var"}]},slice:{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"MemberExpression",object:{type:"MemberExpression",object:{type:"Identifier",name:"Array"},property:{type:"Identifier",name:"prototype"},computed:false},property:{type:"Identifier",name:"slice"},computed:false}}]},"umd-runner-body":{type:"Program",body:[{type:"ExpressionStatement",expression:{type:"ParenthesizedExpression",expression:{type:"FunctionExpression",id:null,params:[{type:"Identifier",name:"factory"}],defaults:[],rest:null,generator:false,async:false,body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"define"}},operator:"===",right:{type:"Literal",value:"function"}},operator:"&&",right:{type:"MemberExpression",object:{type:"Identifier",name:"define"},property:{type:"Identifier",name:"amd"},computed:false}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"define"},arguments:[{type:"Identifier",name:"AMD_ARGUMENTS"},{type:"Identifier",name:"factory"}]}}]},alternate:{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:true,argument:{type:"Identifier",name:"exports"}},operator:"!==",right:{type:"Literal",value:"undefined"}},consequent:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"factory"},arguments:[{type:"Identifier",name:"exports"},{type:"Identifier",name:"COMMON_ARGUMENTS"}]}}]},alternate:null}}]},expression:false}}}]}}},{}]},{},[2])(2)}); |
app/components/activepublisherlistitem.js | jzhang729/zoey.news | import React from 'react'
import Fluxxor from 'fluxxor'
import Color from '../services/barchartcolor.js'
import { Input, Button } from 'react-bootstrap'
var FluxMixin = Fluxxor.FluxMixin(React)
export default React.createClass({
mixins: [FluxMixin],
handleRemovePublisher: function(publisherIndex) {
if (this.props.activePublishers.length > 1) {
this.getFlux().actions.removePublisher(this.props.chartID, publisherIndex);
}
},
render: function() {
var publisher = this.props.publisher
var publisherIndex = this.props.publisherIndex
var legendButtonStyle = []
for (var i = 0; i < 8; i++) {
legendButtonStyle.push(
{
backgroundColor: Color.Fill[i],
borderBottomWidth: '0px'
})
}
var normalButtonStyle = {
backgroundColor: 'rgba(0,0,0,0.5)'
}
var iStyle = {
color: 'rgba(255,255,255,1)'
}
var innerButtonLegend = <Button style={legendButtonStyle[this.props.publisherIndex]} onClick={this.handleRemovePublisher.bind(this, publisherIndex)}><i style={iStyle} className="fa fa-times"></i></Button>;
var innerButtonNormal = <Button style={normalButtonStyle} onClick={this.handleRemovePublisher.bind(this, publisherIndex)}><i style={iStyle} className="fa fa-times"></i></Button>;
var listItem;
if (this.props.legend == true) {
listItem = (
<div className="publisher-list-item">
<Input type='text' buttonBefore={innerButtonLegend} value={publisher} />
</div>
)
} else {
listItem = (
<div className="publisher-list-item">
<Input type='text' buttonBefore={innerButtonNormal} value={publisher} />
</div>
)
}
return (
<li>
{listItem}
</li>
)
}
})
|
frontend/app_v2/src/components/DashboardMedia/DashboardMediaContainer.js | First-Peoples-Cultural-Council/fv-web-ui | import React from 'react'
import { Route, Routes } from 'react-router-dom'
// FPCC
import DashboardMediaPresentation from 'components/DashboardMedia/DashboardMediaPresentation'
import DashboardMediaData from 'components/DashboardMedia/DashboardMediaData'
import MediaBrowser from 'components/MediaBrowser'
function DashboardMediaContainer() {
const { tileContent, headerContent, site } = DashboardMediaData()
return (
<div id="DashboardMediaContainer">
<Routes>
<Route path="browser" element={<MediaBrowser.Container />} />
<Route
path=""
element={<DashboardMediaPresentation tileContent={tileContent} headerContent={headerContent} site={site} />}
/>
</Routes>
</div>
)
}
export default DashboardMediaContainer
|
routes/MenuLink/routes/PostList.js | mcdermed/FutureJS | // import React from 'react'
import get from 'lodash/get'
import find from 'lodash/find'
import PostListController from '../components/PostListController'
import PostController from '../components/PostController'
import { setPost } from '../../../store/actions/PostList'
export default (store, path) => {
return {
path: path,
getComponents(nextState, callback) {
PostListController.load(store.dispatch)
.then(() => {
callback(null, PostListController)
})
},
indexRoute: { onEnter: (nextState, replace, callback) => {
PostListController.load(store.dispatch)
.then(() => {
const post = get(store.getState(), 'posts.posts')[0]
callback(replace(`${path}/${post._id}`))
})
}
},
childRoutes: [ {
path: ':_id',
getComponents(nextState, callback) {
return PostController.load(store.dispatch, nextState.params._id)
.then(() => {
callback(null, PostController)
})
}
} ]
}
}
|
src/App/App.js | amysimmons/a-guide-to-the-care-and-feeding-of-new-devs | import React from 'react';
import Header from '../Header/Header';
import Recommendations from '../Recommendations/Recommendations'
import Findings from '../Findings/Findings'
import StorySelectors from '../StorySelectors/StorySelectors'
import Footer from '../Footer/Footer';
require("./App.css");
var App = React.createClass({
getInitialState(){
let storyData = this.loadData();
let selectedStory = null;
let selectedStories = 0;
return{
storyData: storyData,
selectedStory: selectedStory,
selectedStories: selectedStories
};
},
loadData(){
return require("json!../Data/stories.json");
},
selectStory(selectedStory){
var selectedStory = selectedStory;
var selectedStories = this.state.selectedStories;
if (!selectedStory["selected"]) {
selectedStories++;
selectedStory["selected"] = true;
}
this.setState({selectedStory:selectedStory, selectedStories:selectedStories});
},
render(){
var storyData = this.state.storyData;
var selectedStory = this.state.selectedStory;
var selectedStories = this.state.selectedStories;
var selectStory = this.selectStory;
return (
<div className="app-container">
<Header/>
<Findings
storyData={storyData}/>
<Recommendations/>
<StorySelectors
storyData={storyData}
selectedStory={selectedStory}
selectedStories={selectedStories}
selectStory={selectStory}/>
<Footer/>
</div>
)
}
});
module.exports = App; |
packages/mineral-ui-icons/src/IconLaptopMac.js | mineral-ui/mineral-ui | /* @flow */
import React from 'react';
import Icon from 'mineral-ui/Icon';
import type { IconProps } from 'mineral-ui/Icon/types';
/* eslint-disable prettier/prettier */
export default function IconLaptopMac(props: IconProps) {
const iconProps = {
rtl: false,
...props
};
return (
<Icon {...iconProps}>
<g>
<path d="M20 18c1.1 0 1.99-.9 1.99-2L22 5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2H0c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2h-4zM4 5h16v11H4V5zm8 14c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"/>
</g>
</Icon>
);
}
IconLaptopMac.displayName = 'IconLaptopMac';
IconLaptopMac.category = 'hardware';
|
src/components/Footer.js | cmd-kvn/one_file_todo_redux | import React from 'react';
import PropTypes from 'prop-types';
const Footer = ({ handleClearCompleted, handleViewChange }) => { /* the handleViewChange and handleClearCompleted functions from App is on the props object */
return (
<p>
<button
type='submit'
onClick={handleClearCompleted}
>
Clear completed
</button>
{' '} Show: {' '}
{/*
data-[customize this] is an custom attribute on the event object.
It can be referenced by event.target.dataset.[customized name].
In this case value='VALUE' and event.target.value (in handleViewChange) also works
*/}
<button type='submit' data-filter='ALL' onClick={handleViewChange}>All</button>
{' '}
<button type='submit' data-filter='ACTIVE' onClick={handleViewChange}>Active</button>
{' '}
<button type='submit' data-filter='COMPLETED' onClick={handleViewChange}>Completed</button>
</p>
);
};
Footer.propTypes = {
handleClearCompleted: PropTypes.func.isRequired,
handleViewChange: PropTypes.func.isRequired,
};
export default Footer; |
webpack/components/withLoading.js | theforeman/foreman_ansible | import React from 'react';
import { translate as __ } from 'foremanReact/common/I18n';
import PropTypes from 'prop-types';
import Skeleton from 'react-loading-skeleton';
import EmptyState from 'foremanReact/components/common/EmptyState/EmptyStatePattern';
import { LockIcon } from '@patternfly/react-icons';
import { EmptyStateIcon } from '@patternfly/react-core';
import {
permissionCheck,
permissionDeniedMsg,
allowPrimaryAction,
} from '../permissionsHelper';
import ErrorState from './ErrorState';
const pluckData = (data, path) => {
const split = path.split('.');
return split.reduce((memo, item) => {
if (item) {
return memo[item];
}
throw new Error('Unexpected empty segment in response data path');
}, data);
};
const withLoading = Component => {
const defaultEmptyStateProps = {
header: __('Nothing Found!'),
description: '',
};
const Subcomponent = ({
fetchFn,
renameData,
renamedDataPath,
showEmptyState,
emptyWrapper,
loadingWrapper,
wrapper,
emptyStateProps,
permissions,
allowed,
requiredPermissions,
primaryActionPermissions,
...rest
}) => {
const { loading, error, data } = fetchFn(rest);
if (loading) {
return loadingWrapper(<Skeleton count={5} />);
}
if (error) {
return emptyWrapper(<ErrorState description={error.message} />);
}
const check = permissionCheck(data.currentUser, permissions);
if (!check.allowed) {
return emptyWrapper(
<EmptyState
icon={<EmptyStateIcon icon={LockIcon} />}
header={__('Permission denied')}
description={permissionDeniedMsg(
check.permissions.map(item => item.name)
)}
/>
);
}
if (!allowed) {
return emptyWrapper(
<EmptyState
icon={<EmptyStateIcon icon={LockIcon} />}
header={__('Permission denied')}
description={permissionDeniedMsg(requiredPermissions)}
/>
);
}
const renamedData = renameData(data);
const result = pluckData(renamedData, renamedDataPath);
if (
showEmptyState &&
((Array.isArray(result) && result.length === 0) || !result)
) {
return emptyWrapper(
<EmptyState
{...{
...defaultEmptyStateProps,
...allowPrimaryAction(
emptyStateProps,
data.currentUser,
primaryActionPermissions
),
}}
/>
);
}
return wrapper(<Component {...rest} {...renamedData} />);
};
Subcomponent.propTypes = {
fetchFn: PropTypes.func.isRequired,
renamedDataPath: PropTypes.string.isRequired,
renameData: PropTypes.func,
showEmptyState: PropTypes.bool,
loadingWrapper: PropTypes.func,
emptyWrapper: PropTypes.func,
emptyStateProps: PropTypes.object,
wrapper: PropTypes.func,
permissions: PropTypes.array,
allowed: PropTypes.bool,
primaryActionPermissions: PropTypes.array,
};
Subcomponent.defaultProps = {
renameData: data => data,
showEmptyState: true,
loadingWrapper: child => child,
emptyWrapper: child => child,
wrapper: child => child,
emptyStateProps: defaultEmptyStateProps,
permissions: [],
requiredPermissions: [],
primaryActionPermissions: [],
allowed: true,
};
return Subcomponent;
};
export default withLoading;
|
.structor/src/SelectedOverlay.js | ipselon/react-boilerplate-clone | import React, {Component, PropTypes} from 'react';
const borderRadius = '2px';
const nullPx = '0px';
const px = 'px';
const position = 'absolute';
const borderStyle = 'solid #35b3ee';
const borderSize = '1px';
function isVisible(element) {
let invisibleParent = false;
if ($(element).css("display") === "none") {
invisibleParent = true;
} else {
$(element).parents().each(function (i, el) {
if ($(el).css("display") === "none") {
invisibleParent = true;
return false;
}
return true;
});
}
return !invisibleParent;
}
class SelectedOverlay extends Component {
constructor(props) {
super(props);
this.isSubscribed = false;
this.state = {
newPos: null,
border: '' + (props.bSize ? props.bSize : borderSize) + ' ' + (props.bStyle ? props.bStyle : borderStyle),
contextMenuType: null,
contextMenuItem: null,
isOverlay: false,
};
this.startRefreshTimer = this.startRefreshTimer.bind(this);
this.refreshPosition = this.refreshPosition.bind(this);
this.subscribeToInitialState = this.subscribeToInitialState.bind(this);
this.setSelectedPosition = this.setSelectedPosition.bind(this);
this.resetTimer = this.resetTimer.bind(this);
this.handleMouseEnterLine = this.handleMouseEnterLine.bind(this);
this.handleMouseLeaveLine = this.handleMouseLeaveLine.bind(this);
}
componentDidMount() {
this.bodyWidth = document.body.clientWidth;
this.bodyHeight = document.body.clientHeight;
this.subscribeToInitialState();
}
componentWillUnmount() {
if (this.refreshTimerId) {
clearTimeout((this.refreshTimerId));
this.refreshTimerId = undefined;
}
this.$DOMNode = undefined;
}
componentDidUpdate() {
this.subscribeToInitialState();
}
componentWillReceiveProps(nextProps) {
this.isSubscribed = false;
}
subscribeToInitialState() {
if (!this.isSubscribed) {
const {selectedKey, initialState} = this.props;
if (selectedKey && initialState) {
const element = initialState.elements[selectedKey];
if (element) {
const targetDOMNode = element.getDOMNode();
this.isSubscribed = true;
this.setSelectedPosition({targetDOMNode});
} else {
this.resetTimer();
this.setState({newPos: null});
}
}
this.isSubscribed = true;
}
}
startRefreshTimer() {
this.refreshTimerId = setTimeout(() => {
this.refreshPosition();
}, 500);
}
refreshPosition() {
const $DOMNode = this.$DOMNode;
if ($DOMNode) {
const {newPos: oldPos} = this.state;
if (isVisible($DOMNode)) {
let pos = $DOMNode.offset();
let newPos = {
top: pos.top,
left: pos.left,
width: $DOMNode.outerWidth(),
height: $DOMNode.outerHeight()
};
if (!oldPos ||
newPos.top !== oldPos.top ||
newPos.left !== oldPos.left ||
newPos.width !== oldPos.width ||
newPos.height !== oldPos.height) {
this.setState({newPos});
}
} else {
if (oldPos) {
this.setState({newPos: null});
}
}
}
this.startRefreshTimer();
}
resetTimer() {
if (this.refreshTimerId) {
clearTimeout((this.refreshTimerId));
this.refreshTimerId = undefined;
}
this.$DOMNode = undefined;
}
setSelectedPosition(options) {
let targetDOMNode = options.targetDOMNode;
this.resetTimer();
if (targetDOMNode) {
this.$DOMNode = $(targetDOMNode);
this.refreshPosition();
} else {
console.error('')
}
}
handleButtonClick = (selectedKey, func) => (e) => {
e.preventDefault();
e.stopPropagation();
if (func) {
func(selectedKey, e.metaKey || e.ctrlKey)
}
};
handleMouseEnterLine(e) {
e.preventDefault();
e.stopPropagation();
if(!this.state.isOverlay){
this.setState({isOverlay: true});
}
}
handleMouseLeaveLine(e) {
e.preventDefault();
e.stopPropagation();
if(this.state.isOverlay){
this.setState({isOverlay: false});
}
}
render() {
const {newPos, border, isOverlay} = this.state;
const {selectedKey, initialState: {onLoadOptions, isMultipleSelection}} = this.props;
const {initialState: {onCopy, onCut, onDelete, onBefore, onFirst, onLast, onAfter, onReplace, isClipboardEmpty}} = this.props;
const isMultiple = isMultipleSelection();
// const isEmpty = isClipboardEmpty();
let content;
if (newPos) {
const endPoint = {
top: newPos.top + px,
left: newPos.left + px,
width: '1px',
height: '1px',
position: position,
zIndex: 1035
};
const topLine = {
top: nullPx,
left: nullPx,
width: (newPos.width - 1) + 'px',
height: nullPx,
position: position,
borderTopLeftRadius: borderRadius,
borderTopRightRadius: borderRadius,
borderTop: border,
opacity: 0.5,
};
const leftLine = {
top: nullPx,
left: nullPx,
width: nullPx,
height: (newPos.height - 1) + px,
position: position,
borderTopLeftRadius: borderRadius,
borderBottomLeftRadius: borderRadius,
borderLeft: border,
opacity: 0.5,
};
const bottomLine = {
bottom: '-' + (newPos.height - 1) + px,
left: nullPx,
width: (newPos.width - 1) + px,
height: nullPx,
position: position,
borderBottomLeftRadius: borderRadius,
borderBottomRightRadius: borderRadius,
borderBottom: border,
opacity: 0.5,
};
const rightLine = {
right: '-' + (newPos.width - 1) + px,
top: nullPx,
width: nullPx,
height: newPos.height + px,
position: position,
borderTopRightRadius: borderRadius,
borderBottomRightRadius: borderRadius,
borderRight: border,
opacity: 0.5,
};
let buttonLine;
if (!isMultiple) {
buttonLine = {
display: 'flex',
flexDirection: 'row',
position: position
};
if ((newPos.left + 400) < this.bodyWidth) {
buttonLine.left = nullPx;
} else {
buttonLine.right = '-' + (newPos.width - 1) + px;
buttonLine.minWidth = newPos.width + px;
}
if (newPos.height < 50) {
if (newPos.top < 50) {
buttonLine.bottom = 'calc(-' + (newPos.height - 1) + px + ' - 23px)';
} else {
buttonLine.top = '-23px';
}
} else {
buttonLine.top = '0px';
}
}
let overlay;
if(isOverlay) {
overlay = {
top: nullPx,
left: nullPx,
width: newPos.width + px,
height: newPos.height + px,
opacity: 0.2,
backgroundColor: '#35b3ee',
};
}
content = (
<div style={endPoint}>
{isOverlay && <div style={overlay} />}
<div style={topLine} />
<div style={leftLine} />
<div style={bottomLine} />
<div style={rightLine} />
{!isMultiple ?
<div
style={buttonLine}
onMouseOver={this.handleMouseEnterLine}
onMouseOut={this.handleMouseLeaveLine}
>
<div className="selected-overlay-button umy-icon-append-before"
title="Append before selected"
onClick={this.handleButtonClick(selectedKey, onBefore)}/>
<div className="selected-overlay-button umy-icon-insert-first"
title="Insert into selected as first child"
onClick={this.handleButtonClick(selectedKey, onFirst)}
style={{borderRight: '1px solid #FFFFFF'}}/>
<div className="selected-overlay-button umy-icon-edit selected-overlay-button-success"
onClick={this.handleButtonClick(selectedKey, onLoadOptions)}
title="Edit component properties"
style={{borderRight: '1px solid #FFFFFF'}}/>
<div className="selected-overlay-button umy-icon-copy"
title="Copy selected into clipboard"
onClick={this.handleButtonClick(selectedKey, onCopy)}/>
<div className="selected-overlay-button umy-icon-cut"
title="Cut selected into clipboard"
onClick={this.handleButtonClick(selectedKey, onCut)}/>
<div className="selected-overlay-button umy-icon-replace"
title="Replace selected"
onClick={this.handleButtonClick(selectedKey, onReplace)}/>
<div className="selected-overlay-button umy-icon-delete selected-overlay-button-warning"
title="Remove component from the page"
onClick={this.handleButtonClick(selectedKey, onDelete)}
style={{borderLeft: '1px solid #FFFFFF'}}/>
<div className="selected-overlay-button umy-icon-insert-last"
title="Insert into selected as last child"
onClick={this.handleButtonClick(selectedKey, onLast)}
style={{borderLeft: '1px solid #FFFFFF'}}/>
<div className="selected-overlay-button umy-icon-append-after"
title="Append after selected"
onClick={this.handleButtonClick(selectedKey, onAfter)}/>
</div> : null
}
</div>
);
} else {
const style = {
display: 'none'
};
content = (<span style={style}/>);
}
return content;
}
}
export default SelectedOverlay;
|
node_modules/material-ui/svg-icons/social/sentiment-very-dissatisfied.js | SerendpityZOEY/Fixr-RelevantCodeSearch | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _pure = require('recompose/pure');
var _pure2 = _interopRequireDefault(_pure);
var _SvgIcon = require('../../SvgIcon');
var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SocialSentimentVeryDissatisfied = function SocialSentimentVeryDissatisfied(props) {
return _react2.default.createElement(
_SvgIcon2.default,
props,
_react2.default.createElement('path', { d: 'M11.99 2C6.47 2 2 6.47 2 12s4.47 10 9.99 10S22 17.53 22 12 17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm4.18-12.24l-1.06 1.06-1.06-1.06L13 8.82l1.06 1.06L13 10.94 14.06 12l1.06-1.06L16.18 12l1.06-1.06-1.06-1.06 1.06-1.06zM7.82 12l1.06-1.06L9.94 12 11 10.94 9.94 9.88 11 8.82 9.94 7.76 8.88 8.82 7.82 7.76 6.76 8.82l1.06 1.06-1.06 1.06zM12 14c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5z' })
);
};
SocialSentimentVeryDissatisfied = (0, _pure2.default)(SocialSentimentVeryDissatisfied);
SocialSentimentVeryDissatisfied.displayName = 'SocialSentimentVeryDissatisfied';
SocialSentimentVeryDissatisfied.muiName = 'SvgIcon';
exports.default = SocialSentimentVeryDissatisfied; |
packages/material-ui-icons/src/Brightness5TwoTone.js | Kagami/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M18 9.52V6h-3.52L12 3.52 9.52 6H6v3.52L3.52 12 6 14.48V18h3.52L12 20.48 14.48 18H18v-3.52L20.48 12 18 9.52zm-6 7.98c-3.03 0-5.5-2.47-5.5-5.5S8.97 6.5 12 6.5s5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z" opacity=".3" /><path d="M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69zm-2 5.79V18h-3.52L12 20.48 9.52 18H6v-3.52L3.52 12 6 9.52V6h3.52L12 3.52 14.48 6H18v3.52L20.48 12 18 14.48z" /><path d="M12 6.5c-3.03 0-5.5 2.47-5.5 5.5s2.47 5.5 5.5 5.5 5.5-2.47 5.5-5.5-2.47-5.5-5.5-5.5zm0 9c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" /></g></React.Fragment>
, 'Brightness5TwoTone');
|
components/Themes/index.js | dawnlabs/carbon | import React from 'react'
import dynamic from 'next/dynamic'
import Dropdown from '../Dropdown'
import { managePopout } from '../Popout'
import ThemeIcon from '../svg/Theme'
import RemoveIcon from '../svg/Remove'
import { COLORS } from '../../lib/constants'
const ThemeCreate = dynamic(() => import('./ThemeCreate'), {
loading: () => null
})
const ThemeItem = ({ children, item, isSelected, remove }) => (
<div className="theme-item">
{children}
{item.custom && !isSelected && (
<div
role="button"
tabIndex={0}
className="icon"
onClick={e => {
e.stopPropagation()
remove(item.id)
}}
>
<RemoveIcon color={COLORS.SECONDARY} />
</div>
)}
<style jsx>
{`
.theme-item {
display: flex;
flex: 1;
justify-content: ${item.id === 'create' ? 'center' : 'space-between'};
align-items: center;
}
.icon {
display: flex;
margin-right: 6px;
}
`}
</style>
</div>
)
const themeIcon = <ThemeIcon />
const getCustomName = themes =>
`Custom Theme ${themes.filter(({ name }) => name.startsWith('Custom Theme')).length + 1}`
class Themes extends React.PureComponent {
state = {
name: ''
}
dropdown = React.createRef()
static getDerivedStateFromProps(props) {
if (!props.isVisible) {
return {
name: getCustomName(props.themes)
}
}
return null
}
handleThemeSelected = theme => {
if (theme) {
const { toggleVisibility, update } = this.props
if (theme.id === 'create') {
toggleVisibility()
this.dropdown.current.closeMenu()
} else {
update(theme.id)
}
}
}
create = theme => {
this.props.toggleVisibility()
this.props.create(theme)
}
itemWrapper = props => <ThemeItem {...props} remove={this.props.remove} />
render() {
const { themes, theme, isVisible, toggleVisibility } = this.props
const highlights = { ...theme.highlights, ...this.props.highlights }
const dropdownValue = isVisible ? { name: this.state.name } : theme
const dropdownList = [
{
id: 'create',
name: 'Create +'
},
...themes
]
return (
<div className="themes" data-cy="themes-container">
<Dropdown
title="Theme"
innerRef={this.dropdown}
icon={themeIcon}
disableInput={isVisible}
selected={dropdownValue}
list={dropdownList}
itemWrapper={this.itemWrapper}
onChange={this.handleThemeSelected}
onOpen={isVisible && toggleVisibility}
/>
{isVisible && (
<ThemeCreate
theme={theme}
themes={themes}
highlights={highlights}
create={this.create}
updateHighlights={this.props.updateHighlights}
name={this.state.name}
onInputChange={e => this.setState({ name: e.target.value })}
/>
)}
<style jsx>
{`
.themes {
position: relative;
}
:global(.CodeMirror__container .CodeMirror) {
color: ${highlights.text} !important;
background-color: ${highlights.background} !important;
}
:global(.cm-string),
:global(.cm-string-2) {
color: ${highlights.string} !important;
}
:global(.cm-comment) {
color: ${highlights.comment} !important;
}
:global(.cm-variable),
:global(.cm-variable-2),
:global(.cm-variable-3) {
color: ${highlights.variable} !important;
}
:global(.cm-number) {
color: ${highlights.number} !important;
}
:global(.cm-keyword) {
color: ${highlights.keyword} !important;
}
:global(.cm-property) {
color: ${highlights.property} !important;
}
:global(.cm-def) {
color: ${highlights.definition} !important;
}
:global(.cm-meta) {
color: ${highlights.meta} !important;
}
:global(.cm-operator) {
color: ${highlights.operator} !important;
}
:global(.cm-attribute) {
color: ${highlights.attribute} !important;
}
:global(.cm-s-dracula .CodeMirror-cursor) {
border-left: solid 2px #159588 !important;
}
:global(.cm-s-solarized) {
box-shadow: none !important;
}
:global(.cm-s-solarized.cm-s-light) {
text-shadow: #eee8d5 0 1px !important;
}
:global(.cm-s-solarized.cm-s-light .CodeMirror-linenumber),
:global(.cm-s-solarized.cm-s-light .CodeMirror-linenumbers) {
background-color: #fdf6e3 !important;
}
:global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumber),
:global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumbers) {
background-color: #002b36 !important;
}
`}
</style>
</div>
)
}
}
export default managePopout(Themes)
|
ajax/libs/core-js/0.5.2/library.js | iamJoeTaylor/cdnjs | /**
* Core.js 0.5.2
* https://github.com/zloirock/core-js
* License: http://rock.mit-license.org
* © 2015 Denis Pushkarev
*/
!function(global, framework, undefined){
'use strict';
/******************************************************************************
* Module : common *
******************************************************************************/
// Shortcuts for [[Class]] & property names
var OBJECT = 'Object'
, FUNCTION = 'Function'
, ARRAY = 'Array'
, STRING = 'String'
, NUMBER = 'Number'
, REGEXP = 'RegExp'
, DATE = 'Date'
, MAP = 'Map'
, SET = 'Set'
, WEAKMAP = 'WeakMap'
, WEAKSET = 'WeakSet'
, SYMBOL = 'Symbol'
, PROMISE = 'Promise'
, MATH = 'Math'
, ARGUMENTS = 'Arguments'
, PROTOTYPE = 'prototype'
, CONSTRUCTOR = 'constructor'
, TO_STRING = 'toString'
, TO_STRING_TAG = TO_STRING + 'Tag'
, TO_LOCALE = 'toLocaleString'
, HAS_OWN = 'hasOwnProperty'
, FOR_EACH = 'forEach'
, ITERATOR = 'iterator'
, FF_ITERATOR = '@@' + ITERATOR
, PROCESS = 'process'
, CREATE_ELEMENT = 'createElement'
// Aliases global objects and prototypes
, Function = global[FUNCTION]
, Object = global[OBJECT]
, Array = global[ARRAY]
, String = global[STRING]
, Number = global[NUMBER]
, RegExp = global[REGEXP]
, Date = global[DATE]
, Map = global[MAP]
, Set = global[SET]
, WeakMap = global[WEAKMAP]
, WeakSet = global[WEAKSET]
, Symbol = global[SYMBOL]
, Math = global[MATH]
, TypeError = global.TypeError
, setTimeout = global.setTimeout
, setImmediate = global.setImmediate
, clearImmediate = global.clearImmediate
, parseInt = global.parseInt
, isFinite = global.isFinite
, process = global[PROCESS]
, nextTick = process && process.nextTick
, document = global.document
, html = document && document.documentElement
, navigator = global.navigator
, define = global.define
, ArrayProto = Array[PROTOTYPE]
, ObjectProto = Object[PROTOTYPE]
, FunctionProto = Function[PROTOTYPE]
, Infinity = 1 / 0
, DOT = '.'
// Methods from https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
, CONSOLE_METHODS = 'assert,clear,count,debug,dir,dirxml,error,exception,' +
'group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,' +
'markTimeline,profile,profileEnd,table,time,timeEnd,timeline,' +
'timelineEnd,timeStamp,trace,warn';
// http://jsperf.com/core-js-isobject
function isObject(it){
return it !== null && (typeof it == 'object' || typeof it == 'function');
}
function isFunction(it){
return typeof it == 'function';
}
// Native function?
var isNative = ctx(/./.test, /\[native code\]\s*\}\s*$/, 1);
// Object internal [[Class]] or toStringTag
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring
var toString = ObjectProto[TO_STRING];
function setToStringTag(it, tag, stat){
if(it && !has(it = stat ? it : it[PROTOTYPE], SYMBOL_TAG))hidden(it, SYMBOL_TAG, tag);
}
function cof(it){
return toString.call(it).slice(8, -1);
}
function classof(it){
var O, T;
return it == undefined ? it === undefined ? 'Undefined' : 'Null'
: typeof (T = (O = Object(it))[SYMBOL_TAG]) == 'string' ? T : cof(O);
}
// Function
var call = FunctionProto.call
, apply = FunctionProto.apply
, REFERENCE_GET;
// Partial apply
function part(/* ...args */){
var fn = assertFunction(this)
, length = arguments.length
, args = Array(length)
, i = 0
, _ = path._
, holder = false;
while(length > i)if((args[i] = arguments[i++]) === _)holder = true;
return function(/* ...args */){
var that = this
, _length = arguments.length
, i = 0, j = 0, _args;
if(!holder && !_length)return invoke(fn, args, that);
_args = args.slice();
if(holder)for(;length > i; i++)if(_args[i] === _)_args[i] = arguments[j++];
while(_length > j)_args.push(arguments[j++]);
return invoke(fn, _args, that);
}
}
// Optional / simple context binding
function ctx(fn, that, length){
assertFunction(fn);
if(~length && that === undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
}
case 2: return function(a, b){
return fn.call(that, a, b);
}
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
}
} return function(/* ...args */){
return fn.apply(that, arguments);
}
}
// Fast apply
// http://jsperf.lnkit.com/fast-apply/5
function invoke(fn, args, that){
var un = that === undefined;
switch(args.length | 0){
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
case 5: return un ? fn(args[0], args[1], args[2], args[3], args[4])
: fn.call(that, args[0], args[1], args[2], args[3], args[4]);
} return fn.apply(that, args);
}
function construct(target, argumentsList /*, newTarget*/){
var proto = assertFunction(arguments.length < 3 ? target : arguments[2])[PROTOTYPE]
, instance = create(isObject(proto) ? proto : ObjectProto)
, result = apply.call(target, instance, argumentsList);
return isObject(result) ? result : instance;
}
// Object:
var create = Object.create
, getPrototypeOf = Object.getPrototypeOf
, setPrototypeOf = Object.setPrototypeOf
, defineProperty = Object.defineProperty
, defineProperties = Object.defineProperties
, getOwnDescriptor = Object.getOwnPropertyDescriptor
, getKeys = Object.keys
, getNames = Object.getOwnPropertyNames
, getSymbols = Object.getOwnPropertySymbols
, isFrozen = Object.isFrozen
, has = ctx(call, ObjectProto[HAS_OWN], 2)
// Dummy, fix for not array-like ES3 string in es5 module
, ES5Object = Object
, Dict;
function toObject(it){
return ES5Object(assertDefined(it));
}
function returnIt(it){
return it;
}
function returnThis(){
return this;
}
function get(object, key){
if(has(object, key))return object[key];
}
function ownKeys(it){
assertObject(it);
return getSymbols ? getNames(it).concat(getSymbols(it)) : getNames(it);
}
// 19.1.2.1 Object.assign(target, source, ...)
var assign = Object.assign || function(target, source){
var T = Object(assertDefined(target))
, l = arguments.length
, i = 1;
while(l > i){
var S = ES5Object(arguments[i++])
, keys = getKeys(S)
, length = keys.length
, j = 0
, key;
while(length > j)T[key = keys[j++]] = S[key];
}
return T;
}
function keyOf(object, el){
var O = toObject(object)
, keys = getKeys(O)
, length = keys.length
, index = 0
, key;
while(length > index)if(O[key = keys[index++]] === el)return key;
}
// Array
// array('str1,str2,str3') => ['str1', 'str2', 'str3']
function array(it){
return String(it).split(',');
}
var push = ArrayProto.push
, unshift = ArrayProto.unshift
, slice = ArrayProto.slice
, splice = ArrayProto.splice
, indexOf = ArrayProto.indexOf
, forEach = ArrayProto[FOR_EACH];
/*
* 0 -> forEach
* 1 -> map
* 2 -> filter
* 3 -> some
* 4 -> every
* 5 -> find
* 6 -> findIndex
*/
function createArrayMethod(type){
var isMap = type == 1
, isFilter = type == 2
, isSome = type == 3
, isEvery = type == 4
, isFindIndex = type == 6
, noholes = type == 5 || isFindIndex;
return function(callbackfn/*, that = undefined */){
var O = Object(assertDefined(this))
, that = arguments[1]
, self = ES5Object(O)
, f = ctx(callbackfn, that, 3)
, length = toLength(self.length)
, index = 0
, result = isMap ? Array(length) : isFilter ? [] : undefined
, val, res;
for(;length > index; index++)if(noholes || index in self){
val = self[index];
res = f(val, index, O);
if(type){
if(isMap)result[index] = res; // map
else if(res)switch(type){
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if(isEvery)return false; // every
}
}
return isFindIndex ? -1 : isSome || isEvery ? isEvery : result;
}
}
function createArrayContains(isContains){
return function(el /*, fromIndex = 0 */){
var O = toObject(this)
, length = toLength(O.length)
, index = toIndex(arguments[1], length);
if(isContains && el != el){
for(;length > index; index++)if(sameNaN(O[index]))return isContains || index;
} else for(;length > index; index++)if(isContains || index in O){
if(O[index] === el)return isContains || index;
} return !isContains && -1;
}
}
function generic(A, B){
// strange IE quirks mode bug -> use typeof vs isFunction
return typeof A == 'function' ? A : B;
}
// Math
var MAX_SAFE_INTEGER = 0x1fffffffffffff // pow(2, 53) - 1 == 9007199254740991
, pow = Math.pow
, abs = Math.abs
, ceil = Math.ceil
, floor = Math.floor
, max = Math.max
, min = Math.min
, random = Math.random
, trunc = Math.trunc || function(it){
return (it > 0 ? floor : ceil)(it);
}
// 20.1.2.4 Number.isNaN(number)
function sameNaN(number){
return number != number;
}
// 7.1.4 ToInteger
function toInteger(it){
return isNaN(it) ? 0 : trunc(it);
}
// 7.1.15 ToLength
function toLength(it){
return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0;
}
function toIndex(index, length){
var index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
}
function createReplacer(regExp, replace, isStatic){
var replacer = isObject(replace) ? function(part){
return replace[part];
} : replace;
return function(it){
return String(isStatic ? it : this).replace(regExp, replacer);
}
}
function createPointAt(toString){
return function(pos){
var s = String(assertDefined(this))
, i = toInteger(pos)
, l = s.length
, a, b;
if(i < 0 || i >= l)return toString ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? toString ? s.charAt(i) : a
: toString ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
}
}
// Assertion & errors
var REDUCE_ERROR = 'Reduce of empty object with no initial value';
function assert(condition, msg1, msg2){
if(!condition)throw TypeError(msg2 ? msg1 + msg2 : msg1);
}
function assertDefined(it){
if(it == undefined)throw TypeError('Function called on null or undefined');
return it;
}
function assertFunction(it){
assert(isFunction(it), it, ' is not a function!');
return it;
}
function assertObject(it){
assert(isObject(it), it, ' is not an object!');
return it;
}
function assertInstance(it, Constructor, name){
assert(it instanceof Constructor, name, ": use the 'new' operator!");
}
// Property descriptors & Symbol
function descriptor(bitmap, value){
return {
enumerable : !(bitmap & 1),
configurable: !(bitmap & 2),
writable : !(bitmap & 4),
value : value
}
}
function simpleSet(object, key, value){
object[key] = value;
return object;
}
function createDefiner(bitmap){
return DESC ? function(object, key, value){
return defineProperty(object, key, descriptor(bitmap, value));
} : simpleSet;
}
function uid(key){
return SYMBOL + '(' + key + ')_' + (++sid + random())[TO_STRING](36);
}
function getWellKnownSymbol(name, setter){
return (Symbol && Symbol[name]) || (setter ? Symbol : safeSymbol)(SYMBOL + DOT + name);
}
// The engine works fine with descriptors? Thank's IE8 for his funny defineProperty.
var DESC = !!function(){
try {
return defineProperty({}, 'a', {get: function(){ return 2 }}).a == 2;
} catch(e){}
}()
, sid = 0
, hidden = createDefiner(1)
, set = Symbol ? simpleSet : hidden
, safeSymbol = Symbol || uid;
function assignHidden(target, src){
for(var key in src)hidden(target, key, src[key]);
return target;
}
var SYMBOL_UNSCOPABLES = getWellKnownSymbol('unscopables')
, ArrayUnscopables = ArrayProto[SYMBOL_UNSCOPABLES] || {}
, SYMBOL_SPECIES = getWellKnownSymbol('species');
function setSpecies(C){
if(framework || !isNative(C))defineProperty(C, SYMBOL_SPECIES, {
configurable: true,
get: returnThis
});
}
// Iterators
var SYMBOL_ITERATOR = getWellKnownSymbol(ITERATOR)
, SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG)
, SUPPORT_FF_ITER = FF_ITERATOR in ArrayProto
, ITER = safeSymbol('iter')
, KEY = 1
, VALUE = 2
, Iterators = {}
, IteratorPrototype = {}
, NATIVE_ITERATORS = SYMBOL_ITERATOR in ArrayProto
// Safari define byggy iterators w/o `next`
, BUGGY_ITERATORS = 'keys' in ArrayProto && !('next' in [].keys());
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
setIterator(IteratorPrototype, returnThis);
function setIterator(O, value){
hidden(O, SYMBOL_ITERATOR, value);
// Add iterator for FF iterator protocol
SUPPORT_FF_ITER && hidden(O, FF_ITERATOR, value);
}
function createIterator(Constructor, NAME, next, proto){
Constructor[PROTOTYPE] = create(proto || IteratorPrototype, {next: descriptor(1, next)});
setToStringTag(Constructor, NAME + ' Iterator');
}
function defineIterator(Constructor, NAME, value, DEFAULT){
var proto = Constructor[PROTOTYPE]
, iter = get(proto, SYMBOL_ITERATOR) || get(proto, FF_ITERATOR) || (DEFAULT && get(proto, DEFAULT)) || value;
if(framework){
// Define iterator
setIterator(proto, iter);
if(iter !== value){
var iterProto = getPrototypeOf(iter.call(new Constructor));
// Set @@toStringTag to native iterators
setToStringTag(iterProto, NAME + ' Iterator', true);
// FF fix
has(proto, FF_ITERATOR) && setIterator(iterProto, returnThis);
}
}
// Plug for library
Iterators[NAME] = iter;
// FF & v8 fix
Iterators[NAME + ' Iterator'] = returnThis;
return iter;
}
function defineStdIterators(Base, NAME, Constructor, next, DEFAULT, IS_SET){
function createIter(kind){
return function(){
return new Constructor(this, kind);
}
}
createIterator(Constructor, NAME, next);
var entries = createIter(KEY+VALUE)
, values = createIter(VALUE);
if(DEFAULT == VALUE)values = defineIterator(Base, NAME, values, 'values');
else entries = defineIterator(Base, NAME, entries, 'entries');
if(DEFAULT){
$define(PROTO + FORCED * BUGGY_ITERATORS, NAME, {
entries: entries,
keys: IS_SET ? values : createIter(KEY),
values: values
});
}
}
function iterResult(done, value){
return {value: value, done: !!done};
}
function isIterable(it){
var O = Object(it)
, Symbol = global[SYMBOL]
, hasExt = (Symbol && Symbol[ITERATOR] || FF_ITERATOR) in O;
return hasExt || SYMBOL_ITERATOR in O || has(Iterators, classof(O));
}
function getIterator(it){
var Symbol = global[SYMBOL]
, ext = it[Symbol && Symbol[ITERATOR] || FF_ITERATOR]
, getIter = ext || it[SYMBOL_ITERATOR] || Iterators[classof(it)];
return assertObject(getIter.call(it));
}
function stepCall(fn, value, entries){
return entries ? invoke(fn, value) : fn(value);
}
function forOf(iterable, entries, fn, that){
var iterator = getIterator(iterable)
, f = ctx(fn, that, entries ? 2 : 1)
, step;
while(!(step = iterator.next()).done)if(stepCall(f, step.value, entries) === false)return;
}
// core
var NODE = cof(process) == PROCESS
, core = {}
, path = framework ? global : core
, old = global.core
, exportGlobal
// type bitmap
, FORCED = 1
, GLOBAL = 2
, STATIC = 4
, PROTO = 8
, BIND = 16
, WRAP = 32;
function $define(type, name, source){
var key, own, out, exp
, isGlobal = type & GLOBAL
, target = isGlobal ? global : (type & STATIC)
? global[name] : (global[name] || ObjectProto)[PROTOTYPE]
, exports = isGlobal ? core : core[name] || (core[name] = {});
if(isGlobal)source = name;
for(key in source){
// there is a similar native
own = !(type & FORCED) && target && key in target
&& (!isFunction(target[key]) || isNative(target[key]));
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
if(type & BIND && own)exp = ctx(out, global);
// wrap global constructors for prevent change them in library
else if(type & WRAP && !framework && target[key] == out){
exp = function(param){
return this instanceof out ? new out(param) : out(param);
}
exp[PROTOTYPE] = out[PROTOTYPE];
} else exp = type & PROTO && isFunction(out) ? ctx(call, out) : out;
// export
if(exports[key] != out)hidden(exports, key, exp);
// extend global
if(framework && target && !own){
if(isGlobal)target[key] = out;
else delete target[key] && hidden(target, key, out);
}
}
}
// CommonJS export
if(typeof module != 'undefined' && module.exports)module.exports = core;
// RequireJS export
else if(isFunction(define) && define.amd)define(function(){return core});
// Export to global object
else exportGlobal = true;
if(exportGlobal || framework){
core.noConflict = function(){
global.core = old;
return core;
}
global.core = core;
}
/******************************************************************************
* Module : es5 *
******************************************************************************/
// ECMAScript 5 shim
!function(IS_ENUMERABLE, Empty, _classof, $PROTO){
if(!DESC){
getOwnDescriptor = function(O, P){
if(has(O, P))return descriptor(!ObjectProto[IS_ENUMERABLE].call(O, P), O[P]);
};
defineProperty = function(O, P, Attributes){
if('value' in Attributes)assertObject(O)[P] = Attributes.value;
return O;
};
defineProperties = function(O, Properties){
assertObject(O);
var keys = getKeys(Properties)
, length = keys.length
, i = 0
, P, Attributes;
while(length > i){
P = keys[i++];
Attributes = Properties[P];
if('value' in Attributes)O[P] = Attributes.value;
}
return O;
};
}
$define(STATIC + FORCED * !DESC, OBJECT, {
// 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: getOwnDescriptor,
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
defineProperty: defineProperty,
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
defineProperties: defineProperties
});
// IE 8- don't enum bug keys
var keys1 = [CONSTRUCTOR, HAS_OWN, 'isPrototypeOf', IS_ENUMERABLE, TO_LOCALE, TO_STRING, 'valueOf']
// Additional keys for getOwnPropertyNames
, keys2 = keys1.concat('length', PROTOTYPE)
, keysLen1 = keys1.length;
// Create object with `null` prototype: use iframe Object with cleared prototype
function createDict(){
// Thrash, waste and sodomy: IE GC bug
var iframe = document[CREATE_ELEMENT]('iframe')
, i = keysLen1
, iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
iframe.src = 'javascript:';
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script>');
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][keys1[i]];
return createDict();
}
function createGetKeys(names, length, isNames){
return function(object){
var O = toObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != $PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(length > i)if(has(O, key = names[i++])){
~indexOf.call(result, key) || result.push(key);
}
return result;
}
}
function isPrimitive(it){ return !isObject(it) }
$define(STATIC, OBJECT, {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
getPrototypeOf: getPrototypeOf = getPrototypeOf || function(O){
O = Object(assertDefined(O));
if(has(O, $PROTO))return O[$PROTO];
if(isFunction(O[CONSTRUCTOR]) && O instanceof O[CONSTRUCTOR]){
return O[CONSTRUCTOR][PROTOTYPE];
} return O instanceof Object ? ObjectProto : null;
},
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
getOwnPropertyNames: getNames = getNames || createGetKeys(keys2, keys2.length, true),
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
create: create = create || function(O, /*?*/Properties){
var result
if(O !== null){
Empty[PROTOTYPE] = assertObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf shim
result[$PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : defineProperties(result, Properties);
},
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
keys: getKeys = getKeys || createGetKeys(keys1, keysLen1, false),
// 19.1.2.17 / 15.2.3.8 Object.seal(O)
seal: returnIt, // <- cap
// 19.1.2.5 / 15.2.3.9 Object.freeze(O)
freeze: returnIt, // <- cap
// 19.1.2.15 / 15.2.3.10 Object.preventExtensions(O)
preventExtensions: returnIt, // <- cap
// 19.1.2.13 / 15.2.3.11 Object.isSealed(O)
isSealed: isPrimitive, // <- cap
// 19.1.2.12 / 15.2.3.12 Object.isFrozen(O)
isFrozen: isFrozen = isFrozen || isPrimitive, // <- cap
// 19.1.2.11 / 15.2.3.13 Object.isExtensible(O)
isExtensible: isObject // <- cap
});
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
$define(PROTO, FUNCTION, {
bind: function(that /*, args... */){
var fn = assertFunction(this)
, partArgs = slice.call(arguments, 1);
function bound(/* args... */){
var args = partArgs.concat(slice.call(arguments));
return this instanceof bound ? construct(fn, args) : invoke(fn, args, that);
}
return bound;
}
});
// Fix for not array-like ES3 string
function arrayMethodFix(fn){
return function(){
return fn.apply(ES5Object(this), arguments);
}
}
if(!(0 in Object(DOT) && DOT[0] == DOT)){
ES5Object = function(it){
return cof(it) == STRING ? it.split('') : Object(it);
}
slice = arrayMethodFix(slice);
}
$define(PROTO + FORCED * (ES5Object != Object), ARRAY, {
slice: slice,
join: arrayMethodFix(ArrayProto.join)
});
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
$define(STATIC, ARRAY, {
isArray: function(arg){
return cof(arg) == ARRAY
}
});
function createArrayReduce(isRight){
return function(callbackfn, memo){
assertFunction(callbackfn);
var O = toObject(this)
, length = toLength(O.length)
, index = isRight ? length - 1 : 0
, i = isRight ? -1 : 1;
if(2 > arguments.length)for(;;){
if(index in O){
memo = O[index];
index += i;
break;
}
index += i;
assert(isRight ? index >= 0 : length > index, REDUCE_ERROR);
}
for(;isRight ? index >= 0 : length > index; index += i)if(index in O){
memo = callbackfn(memo, O[index], index, this);
}
return memo;
}
}
$define(PROTO, ARRAY, {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: forEach = forEach || createArrayMethod(0),
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: createArrayMethod(1),
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: createArrayMethod(2),
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: createArrayMethod(3),
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: createArrayMethod(4),
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: createArrayReduce(false),
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: createArrayReduce(true),
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: indexOf = indexOf || createArrayContains(false),
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function(el, fromIndex /* = @[*-1] */){
var O = toObject(this)
, length = toLength(O.length)
, index = length - 1;
if(arguments.length > 1)index = min(index, toInteger(fromIndex));
if(index < 0)index = toLength(length + index);
for(;index >= 0; index--)if(index in O)if(O[index] === el)return index;
return -1;
}
});
// 21.1.3.25 / 15.5.4.20 String.prototype.trim()
$define(PROTO, STRING, {trim: createReplacer(/^\s*([\s\S]*\S)?\s*$/, '$1')});
// 20.3.3.1 / 15.9.4.4 Date.now()
$define(STATIC, DATE, {now: function(){
return +new Date;
}});
if(_classof(function(){return arguments}()) == OBJECT)classof = function(it){
var cof = _classof(it);
return cof == OBJECT && isFunction(it.callee) ? ARGUMENTS : cof;
}
}('propertyIsEnumerable', function(){}, classof, safeSymbol(PROTOTYPE));
/******************************************************************************
* Module : es6.symbol *
******************************************************************************/
// ECMAScript 6 symbols shim
!function(TAG, SymbolRegistry, AllSymbols, setter){
// 19.4.1.1 Symbol([description])
if(!isNative(Symbol)){
Symbol = function(description){
assert(!(this instanceof Symbol), SYMBOL + ' is not a ' + CONSTRUCTOR);
var tag = uid(description)
, sym = set(create(Symbol[PROTOTYPE]), TAG, tag);
AllSymbols[tag] = sym;
DESC && setter && defineProperty(ObjectProto, tag, {
configurable: true,
set: function(value){
hidden(this, tag, value);
}
});
return sym;
}
hidden(Symbol[PROTOTYPE], TO_STRING, function(){
return this[TAG];
});
}
$define(GLOBAL + WRAP, {Symbol: Symbol});
var symbolStatics = {
// 19.4.2.1 Symbol.for(key)
'for': function(key){
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = Symbol(key);
},
// 19.4.2.4 Symbol.iterator
iterator: SYMBOL_ITERATOR,
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: part.call(keyOf, SymbolRegistry),
// 19.4.2.10 Symbol.species
species: SYMBOL_SPECIES,
// 19.4.2.13 Symbol.toStringTag
toStringTag: SYMBOL_TAG = getWellKnownSymbol(TO_STRING_TAG, true),
// 19.4.2.14 Symbol.unscopables
unscopables: SYMBOL_UNSCOPABLES,
pure: safeSymbol,
set: set,
useSetter: function(){setter = true},
useSimple: function(){setter = false}
};
// 19.4.2.2 Symbol.hasInstance
// 19.4.2.3 Symbol.isConcatSpreadable
// 19.4.2.6 Symbol.match
// 19.4.2.8 Symbol.replace
// 19.4.2.9 Symbol.search
// 19.4.2.11 Symbol.split
// 19.4.2.12 Symbol.toPrimitive
forEach.call(array('hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive'),
function(it){
symbolStatics[it] = getWellKnownSymbol(it);
}
);
$define(STATIC, SYMBOL, symbolStatics);
setToStringTag(Symbol, SYMBOL);
$define(STATIC + FORCED * !isNative(Symbol), OBJECT, {
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: function(it){
var names = getNames(toObject(it)), result = [], key, i = 0;
while(names.length > i)has(AllSymbols, key = names[i++]) || result.push(key);
return result;
},
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: function(it){
var names = getNames(toObject(it)), result = [], key, i = 0;
while(names.length > i)has(AllSymbols, key = names[i++]) && result.push(AllSymbols[key]);
return result;
}
});
}(safeSymbol('tag'), {}, {}, true);
/******************************************************************************
* Module : es6.object *
******************************************************************************/
!function(tmp){
var objectStatic = {
// 19.1.3.1 Object.assign(target, source)
assign: assign,
// 19.1.3.10 Object.is(value1, value2)
is: function(x, y){
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
}
};
// 19.1.3.19 Object.setPrototypeOf(O, proto)
// Works with __proto__ only. Old v8 can't works with null proto objects.
'__proto__' in ObjectProto && function(buggy, set){
try {
set = ctx(call, getOwnDescriptor(ObjectProto, '__proto__').set, 2);
set({}, ArrayProto);
} catch(e){ buggy = true }
objectStatic.setPrototypeOf = setPrototypeOf = setPrototypeOf || function(O, proto){
assertObject(O);
assert(proto === null || isObject(proto), proto, ": can't set as prototype!");
if(buggy)O.__proto__ = proto;
else set(O, proto);
return O;
}
}();
$define(STATIC, OBJECT, objectStatic);
if(framework){
// 19.1.3.6 Object.prototype.toString()
tmp[SYMBOL_TAG] = DOT;
if(cof(tmp) != DOT)hidden(ObjectProto, TO_STRING, function(){
return '[object ' + classof(this) + ']';
});
}
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, MATH, true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
}({});
/******************************************************************************
* Module : es6.object.statics-accept-primitives *
******************************************************************************/
!function(){
// Object static methods accept primitives
function wrapObjectMethod(key, MODE){
var fn = Object[key]
, exp = core[OBJECT][key]
, f = 0
, o = {};
if(!exp || isNative(exp)){
o[key] = MODE == 1 ? function(it){
return isObject(it) ? fn(it) : it;
} : MODE == 2 ? function(it){
return isObject(it) ? fn(it) : true;
} : MODE == 3 ? function(it){
return isObject(it) ? fn(it) : false;
} : MODE == 4 ? function(it, key){
return fn(toObject(it), key);
} : function(it){
return fn(toObject(it));
};
try { fn(DOT) }
catch(e){ f = 1 }
$define(STATIC + FORCED * f, OBJECT, o);
}
}
wrapObjectMethod('freeze', 1);
wrapObjectMethod('seal', 1);
wrapObjectMethod('preventExtensions', 1);
wrapObjectMethod('isFrozen', 2);
wrapObjectMethod('isSealed', 2);
wrapObjectMethod('isExtensible', 3);
wrapObjectMethod('getOwnPropertyDescriptor', 4);
wrapObjectMethod('getPrototypeOf');
wrapObjectMethod('keys');
wrapObjectMethod('getOwnPropertyNames');
}();
/******************************************************************************
* Module : es6.number *
******************************************************************************/
!function(isInteger){
$define(STATIC, NUMBER, {
// 20.1.2.1 Number.EPSILON
EPSILON: pow(2, -52),
// 20.1.2.2 Number.isFinite(number)
isFinite: function(it){
return typeof it == 'number' && isFinite(it);
},
// 20.1.2.3 Number.isInteger(number)
isInteger: isInteger,
// 20.1.2.4 Number.isNaN(number)
isNaN: sameNaN,
// 20.1.2.5 Number.isSafeInteger(number)
isSafeInteger: function(number){
return isInteger(number) && abs(number) <= MAX_SAFE_INTEGER;
},
// 20.1.2.6 Number.MAX_SAFE_INTEGER
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER,
// 20.1.2.10 Number.MIN_SAFE_INTEGER
MIN_SAFE_INTEGER: -MAX_SAFE_INTEGER,
// 20.1.2.12 Number.parseFloat(string)
parseFloat: parseFloat,
// 20.1.2.13 Number.parseInt(string, radix)
parseInt: parseInt
});
// 20.1.2.3 Number.isInteger(number)
}(Number.isInteger || function(it){
return !isObject(it) && isFinite(it) && floor(it) === it;
});
/******************************************************************************
* Module : es6.math *
******************************************************************************/
// ECMAScript 6 shim
!function(){
// 20.2.2.28 Math.sign(x)
var E = Math.E
, exp = Math.exp
, log = Math.log
, sqrt = Math.sqrt
, sign = Math.sign || function(x){
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
// 20.2.2.5 Math.asinh(x)
function asinh(x){
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
}
// 20.2.2.14 Math.expm1(x)
function expm1(x){
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
}
$define(STATIC, MATH, {
// 20.2.2.3 Math.acosh(x)
acosh: function(x){
return (x = +x) < 1 ? NaN : isFinite(x) ? log(x / E + sqrt(x + 1) * sqrt(x - 1) / E) + 1 : x;
},
// 20.2.2.5 Math.asinh(x)
asinh: asinh,
// 20.2.2.7 Math.atanh(x)
atanh: function(x){
return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
},
// 20.2.2.9 Math.cbrt(x)
cbrt: function(x){
return sign(x = +x) * pow(abs(x), 1 / 3);
},
// 20.2.2.11 Math.clz32(x)
clz32: function(x){
return (x >>>= 0) ? 32 - x[TO_STRING](2).length : 32;
},
// 20.2.2.12 Math.cosh(x)
cosh: function(x){
return (exp(x = +x) + exp(-x)) / 2;
},
// 20.2.2.14 Math.expm1(x)
expm1: expm1,
// 20.2.2.16 Math.fround(x)
// TODO: fallback for IE9-
fround: function(x){
return new Float32Array([x])[0];
},
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
hypot: function(value1, value2){
var sum = 0
, len1 = arguments.length
, len2 = len1
, args = Array(len1)
, larg = -Infinity
, arg;
while(len1--){
arg = args[len1] = +arguments[len1];
if(arg == Infinity || arg == -Infinity)return Infinity;
if(arg > larg)larg = arg;
}
larg = arg || 1;
while(len2--)sum += pow(args[len2] / larg, 2);
return larg * sqrt(sum);
},
// 20.2.2.18 Math.imul(x, y)
imul: function(x, y){
var UInt16 = 0xffff
, xn = +x
, yn = +y
, xl = UInt16 & xn
, yl = UInt16 & yn;
return 0 | xl * yl + ((UInt16 & xn >>> 16) * yl + xl * (UInt16 & yn >>> 16) << 16 >>> 0);
},
// 20.2.2.20 Math.log1p(x)
log1p: function(x){
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
},
// 20.2.2.21 Math.log10(x)
log10: function(x){
return log(x) / Math.LN10;
},
// 20.2.2.22 Math.log2(x)
log2: function(x){
return log(x) / Math.LN2;
},
// 20.2.2.28 Math.sign(x)
sign: sign,
// 20.2.2.30 Math.sinh(x)
sinh: function(x){
return (abs(x = +x) < 1) ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
},
// 20.2.2.33 Math.tanh(x)
tanh: function(x){
var a = expm1(x = +x)
, b = expm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
},
// 20.2.2.34 Math.trunc(x)
trunc: trunc
});
}();
/******************************************************************************
* Module : es6.string *
******************************************************************************/
!function(RangeError, fromCharCode){
function assertNotRegExp(it){
if(cof(it) == REGEXP)throw TypeError();
}
$define(STATIC, STRING, {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function(x){
var res = []
, len = arguments.length
, i = 0
, code
while(len > i){
code = +arguments[i++];
if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
},
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function(callSite){
var raw = toObject(callSite.raw)
, len = toLength(raw.length)
, sln = arguments.length
, res = []
, i = 0;
while(len > i){
res.push(String(raw[i++]));
if(i < sln)res.push(String(arguments[i]));
} return res.join('');
}
});
$define(PROTO, STRING, {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: createPointAt(false),
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
endsWith: function(searchString /*, endPosition = @length */){
assertNotRegExp(searchString);
var that = String(assertDefined(this))
, endPosition = arguments[1]
, len = toLength(that.length)
, end = endPosition === undefined ? len : min(toLength(endPosition), len);
searchString += '';
return that.slice(end - searchString.length, end) === searchString;
},
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
includes: function(searchString /*, position = 0 */){
assertNotRegExp(searchString);
return !!~String(assertDefined(this)).indexOf(searchString, arguments[1]);
},
// 21.1.3.13 String.prototype.repeat(count)
repeat: function(count){
var str = String(assertDefined(this))
, res = ''
, n = toInteger(count);
if(0 > n || n == Infinity)throw RangeError("Count can't be negative");
for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
return res;
},
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
startsWith: function(searchString /*, position = 0 */){
assertNotRegExp(searchString);
var that = String(assertDefined(this))
, index = toLength(min(arguments[1], that.length));
searchString += '';
return that.slice(index, index + searchString.length) === searchString;
}
});
}(global.RangeError, String.fromCharCode);
/******************************************************************************
* Module : es6.array *
******************************************************************************/
!function(){
$define(STATIC, ARRAY, {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
var O = Object(assertDefined(arrayLike))
, mapfn = arguments[1]
, mapping = mapfn !== undefined
, f = mapping ? ctx(mapfn, arguments[2], 2) : undefined
, index = 0
, length, result, iter, step;
if(isIterable(O))for(iter = getIterator(O), result = new (generic(this, Array)); !(step = iter.next()).done; index++){
result[index] = mapping ? f(step.value, index) : step.value;
} else for(result = new (generic(this, Array))(length = toLength(O.length)); length > index; index++){
result[index] = mapping ? f(O[index], index) : O[index];
}
result.length = index;
return result;
},
// 22.1.2.3 Array.of( ...items)
of: function(/* ...args */){
var index = 0
, length = arguments.length
, result = new (generic(this, Array))(length);
while(length > index)result[index] = arguments[index++];
result.length = length;
return result;
}
});
$define(PROTO, ARRAY, {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
copyWithin: function(target /* = 0 */, start /* = 0, end = @length */){
var O = Object(assertDefined(this))
, len = toLength(O.length)
, to = toIndex(target, len)
, from = toIndex(start, len)
, end = arguments[2]
, fin = end === undefined ? len : toIndex(end, len)
, count = min(fin - from, len - to)
, inc = 1;
if(from < to && to < from + count){
inc = -1;
from = from + count - 1;
to = to + count - 1;
}
while(count-- > 0){
if(from in O)O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
},
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
fill: function(value /*, start = 0, end = @length */){
var O = Object(assertDefined(this))
, length = toLength(O.length)
, index = toIndex(arguments[1], length)
, end = arguments[2]
, endPos = end === undefined ? length : toIndex(end, length);
while(endPos > index)O[index++] = value;
return O;
},
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
find: createArrayMethod(5),
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
findIndex: createArrayMethod(6)
});
if(framework){
// 22.1.3.31 Array.prototype[@@unscopables]
forEach.call(array('find,findIndex,fill,copyWithin,entries,keys,values'), function(it){
ArrayUnscopables[it] = true;
});
SYMBOL_UNSCOPABLES in ArrayProto || hidden(ArrayProto, SYMBOL_UNSCOPABLES, ArrayUnscopables);
}
setSpecies(Array);
}();
/******************************************************************************
* Module : es6.iterators *
******************************************************************************/
!function(at){
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
defineStdIterators(Array, ARRAY, function(iterated, kind){
set(this, ITER, {o: toObject(iterated), i: 0, k: kind});
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function(){
var iter = this[ITER]
, O = iter.o
, kind = iter.k
, index = iter.i++;
if(!O || index >= O.length){
iter.o = undefined;
return iterResult(1);
}
if(kind == KEY) return iterResult(0, index);
if(kind == VALUE)return iterResult(0, O[index]);
return iterResult(0, [index, O[index]]);
}, VALUE);
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators[ARGUMENTS] = Iterators[ARRAY];
// 21.1.3.27 String.prototype[@@iterator]()
defineStdIterators(String, STRING, function(iterated){
set(this, ITER, {o: String(iterated), i: 0});
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function(){
var iter = this[ITER]
, O = iter.o
, index = iter.i
, point;
if(index >= O.length)return iterResult(1);
point = at.call(O, index);
iter.i += point.length;
return iterResult(0, point);
});
}(createPointAt(true));
/******************************************************************************
* Module : web.immediate *
******************************************************************************/
// setImmediate shim
// Node.js 0.9+ & IE10+ has setImmediate, else:
isFunction(setImmediate) && isFunction(clearImmediate) || function(ONREADYSTATECHANGE){
var postMessage = global.postMessage
, addEventListener = global.addEventListener
, MessageChannel = global.MessageChannel
, counter = 0
, queue = {}
, defer, channel, port;
setImmediate = function(fn){
var args = [], i = 1;
while(arguments.length > i)args.push(arguments[i++]);
queue[++counter] = function(){
invoke(isFunction(fn) ? fn : Function(fn), args);
}
defer(counter);
return counter;
}
clearImmediate = function(id){
delete queue[id];
}
function run(id){
if(has(queue, id)){
var fn = queue[id];
delete queue[id];
fn();
}
}
function listner(event){
run(event.data);
}
// Node.js 0.8-
if(NODE){
defer = function(id){
nextTick(part.call(run, id));
}
// Modern browsers, skip implementation for WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is object
} else if(addEventListener && isFunction(postMessage) && !global.importScripts){
defer = function(id){
postMessage(id, '*');
}
addEventListener('message', listner, false);
// WebWorkers
} else if(isFunction(MessageChannel)){
channel = new MessageChannel;
port = channel.port2;
channel.port1.onmessage = listner;
defer = ctx(port.postMessage, port, 1);
// IE8-
} else if(document && ONREADYSTATECHANGE in document[CREATE_ELEMENT]('script')){
defer = function(id){
html.appendChild(document[CREATE_ELEMENT]('script'))[ONREADYSTATECHANGE] = function(){
html.removeChild(this);
run(id);
}
}
// Rest old browsers
} else {
defer = function(id){
setTimeout(run, 0, id);
}
}
}('onreadystatechange');
$define(GLOBAL + BIND, {
setImmediate: setImmediate,
clearImmediate: clearImmediate
});
/******************************************************************************
* Module : es6.promise *
******************************************************************************/
// ES6 promises shim
// Based on https://github.com/getify/native-promise-only/
!function(Promise, test){
isFunction(Promise) && isFunction(Promise.resolve)
&& Promise.resolve(test = new Promise(function(){})) == test
|| function(asap, DEF){
function isThenable(o){
var then;
if(isObject(o))then = o.then;
return isFunction(then) ? then : false;
}
function notify(def){
var chain = def.chain;
chain.length && asap(function(){
var msg = def.msg
, ok = def.state == 1
, i = 0;
while(chain.length > i)!function(react){
var cb = ok ? react.ok : react.fail
, ret, then;
try {
if(cb){
ret = cb === true ? msg : cb(msg);
if(ret === react.P){
react.rej(TypeError(PROMISE + '-chain cycle'));
} else if(then = isThenable(ret)){
then.call(ret, react.res, react.rej);
} else react.res(ret);
} else react.rej(msg);
} catch(err){
react.rej(err);
}
}(chain[i++]);
chain.length = 0;
});
}
function resolve(msg){
var def = this
, then, wrapper;
if(def.done)return;
def.done = true;
def = def.def || def; // unwrap
try {
if(then = isThenable(msg)){
wrapper = {def: def, done: false}; // wrap
then.call(msg, ctx(resolve, wrapper, 1), ctx(reject, wrapper, 1));
} else {
def.msg = msg;
def.state = 1;
notify(def);
}
} catch(err){
reject.call(wrapper || {def: def, done: false}, err); // wrap
}
}
function reject(msg){
var def = this;
if(def.done)return;
def.done = true;
def = def.def || def; // unwrap
def.msg = msg;
def.state = 2;
notify(def);
}
function getConstructor(C){
var S = assertObject(C)[SYMBOL_SPECIES];
return S != undefined ? S : C;
}
// 25.4.3.1 Promise(executor)
Promise = function(executor){
assertFunction(executor);
assertInstance(this, Promise, PROMISE);
var def = {chain: [], state: 0, done: false, msg: undefined};
hidden(this, DEF, def);
try {
executor(ctx(resolve, def, 1), ctx(reject, def, 1));
} catch(err){
reject.call(def, err);
}
}
assignHidden(Promise[PROTOTYPE], {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function(onFulfilled, onRejected){
var S = assertObject(assertObject(this)[CONSTRUCTOR])[SYMBOL_SPECIES];
var react = {
ok: isFunction(onFulfilled) ? onFulfilled : true,
fail: isFunction(onRejected) ? onRejected : false
} , P = react.P = new (S != undefined ? S : Promise)(function(resolve, reject){
react.res = assertFunction(resolve);
react.rej = assertFunction(reject);
}), def = this[DEF];
def.chain.push(react);
def.state && notify(def);
return P;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function(onRejected){
return this.then(undefined, onRejected);
}
});
assignHidden(Promise, {
// 25.4.4.1 Promise.all(iterable)
all: function(iterable){
var Promise = getConstructor(this)
, values = [];
return new Promise(function(resolve, reject){
forOf(iterable, false, push, values);
var remaining = values.length
, results = Array(remaining);
if(remaining)forEach.call(values, function(promise, index){
Promise.resolve(promise).then(function(value){
results[index] = value;
--remaining || resolve(results);
}, reject);
});
else resolve(results);
});
},
// 25.4.4.4 Promise.race(iterable)
race: function(iterable){
var Promise = getConstructor(this);
return new Promise(function(resolve, reject){
forOf(iterable, false, function(promise){
Promise.resolve(promise).then(resolve, reject);
});
});
},
// 25.4.4.5 Promise.reject(r)
reject: function(r){
return new (getConstructor(this))(function(resolve, reject){
reject(r);
});
},
// 25.4.4.6 Promise.resolve(x)
resolve: function(x){
return isObject(x) && DEF in x && getPrototypeOf(x) === this[PROTOTYPE]
? x : new (getConstructor(this))(function(resolve, reject){
resolve(x);
});
}
});
}(nextTick || setImmediate, safeSymbol('def'));
setToStringTag(Promise, PROMISE);
setSpecies(Promise);
$define(GLOBAL + FORCED * !isNative(Promise), {Promise: Promise});
}(global[PROMISE]);
/******************************************************************************
* Module : es6.collections *
******************************************************************************/
// ECMAScript 6 collections shim
!function(){
var UID = safeSymbol('uid')
, O1 = safeSymbol('O1')
, WEAK = safeSymbol('weak')
, LEAK = safeSymbol('leak')
, LAST = safeSymbol('last')
, FIRST = safeSymbol('first')
, SIZE = DESC ? safeSymbol('size') : 'size'
, uid = 0
, tmp = {};
function getCollection(C, NAME, methods, commonMethods, isMap, isWeak){
var ADDER = isMap ? 'set' : 'add'
, proto = C && C[PROTOTYPE]
, O = {};
function initFromIterable(that, iterable){
if(iterable != undefined)forOf(iterable, isMap, that[ADDER], that);
return that;
}
function fixSVZ(key, chain){
var method = proto[key];
if(framework)proto[key] = function(a, b){
var result = method.call(this, a === 0 ? 0 : a, b);
return chain ? this : result;
};
}
if(!isNative(C) || !(isWeak || (!BUGGY_ITERATORS && has(proto, FOR_EACH) && has(proto, 'entries')))){
// create collection constructor
C = isWeak
? function(iterable){
assertInstance(this, C, NAME);
set(this, UID, uid++);
initFromIterable(this, iterable);
}
: function(iterable){
var that = this;
assertInstance(that, C, NAME);
set(that, O1, create(null));
set(that, SIZE, 0);
set(that, LAST, undefined);
set(that, FIRST, undefined);
initFromIterable(that, iterable);
};
assignHidden(assignHidden(C[PROTOTYPE], methods), commonMethods);
isWeak || defineProperty(C[PROTOTYPE], 'size', {get: function(){
return assertDefined(this[SIZE]);
}});
} else {
var Native = C
, inst = new C
, chain = inst[ADDER](isWeak ? {} : -0, 1)
, buggyZero;
// wrap to init collections from iterable
if(!NATIVE_ITERATORS || !C.length){
C = function(iterable){
assertInstance(this, C, NAME);
return initFromIterable(new Native, iterable);
}
C[PROTOTYPE] = proto;
if(framework)proto[CONSTRUCTOR] = C;
}
isWeak || inst[FOR_EACH](function(val, key){
buggyZero = 1 / key === -Infinity;
});
// fix converting -0 key to +0
if(buggyZero){
fixSVZ('delete');
fixSVZ('has');
isMap && fixSVZ('get');
}
// + fix .add & .set for chaining
if(buggyZero || chain !== inst)fixSVZ(ADDER, true);
}
setToStringTag(C, NAME);
setSpecies(C);
O[NAME] = C;
$define(GLOBAL + WRAP + FORCED * !isNative(C), O);
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
isWeak || defineStdIterators(C, NAME, function(iterated, kind){
set(this, ITER, {o: iterated, k: kind});
}, function(){
var iter = this[ITER]
, kind = iter.k
, entry = iter.l;
// revert to the last existing entry
while(entry && entry.r)entry = entry.p;
// get next entry
if(!iter.o || !(iter.l = entry = entry ? entry.n : iter.o[FIRST])){
// or finish the iteration
iter.o = undefined;
return iterResult(1);
}
// return step by kind
if(kind == KEY) return iterResult(0, entry.k);
if(kind == VALUE)return iterResult(0, entry.v);
return iterResult(0, [entry.k, entry.v]);
}, isMap ? KEY+VALUE : VALUE, !isMap);
return C;
}
function fastKey(it, create){
// return primitive with prefix
if(!isObject(it))return (typeof it == 'string' ? 'S' : 'P') + it;
// can't set id to frozen object
if(isFrozen(it))return 'F';
if(!has(it, UID)){
// not necessary to add id
if(!create)return 'E';
// add missing object id
hidden(it, UID, ++uid);
// return object id with prefix
} return 'O' + it[UID];
}
function getEntry(that, key){
// fast case
var index = fastKey(key), entry;
if(index != 'F')return that[O1][index];
// frozen object case
for(entry = that[FIRST]; entry; entry = entry.n){
if(entry.k == key)return entry;
}
}
function def(that, key, value){
var entry = getEntry(that, key)
, prev, index;
// change existing entry
if(entry)entry.v = value;
// create new entry
else {
that[LAST] = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that[LAST], // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if(!that[FIRST])that[FIRST] = entry;
if(prev)prev.n = entry;
that[SIZE]++;
// add to index
if(index != 'F')that[O1][index] = entry;
} return that;
}
var collectionMethods = {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function(){
for(var that = this, data = that[O1], entry = that[FIRST]; entry; entry = entry.n){
entry.r = true;
if(entry.p)entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that[FIRST] = that[LAST] = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function(key){
var that = this
, entry = getEntry(that, key);
if(entry){
var next = entry.n
, prev = entry.p;
delete that[O1][entry.i];
entry.r = true;
if(prev)prev.n = next;
if(next)next.p = prev;
if(that[FIRST] == entry)that[FIRST] = next;
if(that[LAST] == entry)that[LAST] = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function(callbackfn /*, that = undefined */){
var f = ctx(callbackfn, arguments[1], 3)
, entry;
while(entry = entry ? entry.n : this[FIRST]){
f(entry.v, entry.k, this);
// revert to the last existing entry
while(entry && entry.r)entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function(key){
return !!getEntry(this, key);
}
}
// 23.1 Map Objects
Map = getCollection(Map, MAP, {
// 23.1.3.6 Map.prototype.get(key)
get: function(key){
var entry = getEntry(this, key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function(key, value){
return def(this, key === 0 ? 0 : key, value);
}
}, collectionMethods, true);
// 23.2 Set Objects
Set = getCollection(Set, SET, {
// 23.2.3.1 Set.prototype.add(value)
add: function(value){
return def(this, value = value === 0 ? 0 : value, value);
}
}, collectionMethods);
function defWeak(that, key, value){
if(isFrozen(assertObject(key)))leakStore(that).set(key, value);
else {
has(key, WEAK) || hidden(key, WEAK, {});
key[WEAK][that[UID]] = value;
} return that;
}
function leakStore(that){
return that[LEAK] || hidden(that, LEAK, new Map)[LEAK];
}
var weakMethods = {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function(key){
if(!isObject(key))return false;
if(isFrozen(key))return leakStore(this)['delete'](key);
return has(key, WEAK) && has(key[WEAK], this[UID]) && delete key[WEAK][this[UID]];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function(key){
if(!isObject(key))return false;
if(isFrozen(key))return leakStore(this).has(key);
return has(key, WEAK) && has(key[WEAK], this[UID]);
}
};
// 23.3 WeakMap Objects
WeakMap = getCollection(WeakMap, WEAKMAP, {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function(key){
if(isObject(key)){
if(isFrozen(key))return leakStore(this).get(key);
if(has(key, WEAK))return key[WEAK][this[UID]];
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function(key, value){
return defWeak(this, key, value);
}
}, weakMethods, true, true);
// IE11 WeakMap frozen keys fix
if(framework && new WeakMap().set(Object.freeze(tmp), 7).get(tmp) != 7){
forEach.call(array('delete,has,get,set'), function(key){
var method = WeakMap[PROTOTYPE][key];
WeakMap[PROTOTYPE][key] = function(a, b){
// store frozen objects on leaky map
if(isObject(a) && isFrozen(a)){
var result = leakStore(this)[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
};
});
}
// 23.4 WeakSet Objects
WeakSet = getCollection(WeakSet, WEAKSET, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function(value){
return defWeak(this, value, true);
}
}, weakMethods, false, true);
}();
/******************************************************************************
* Module : es6.reflect *
******************************************************************************/
!function(){
function Enumerate(iterated){
var keys = [], key;
for(key in iterated)keys.push(key);
set(this, ITER, {o: iterated, a: keys, i: 0});
}
createIterator(Enumerate, OBJECT, function(){
var iter = this[ITER]
, keys = iter.a
, key;
do {
if(iter.i >= keys.length)return iterResult(1);
} while(!((key = keys[iter.i++]) in iter.o));
return iterResult(0, key);
});
function wrap(fn){
return function(it){
assertObject(it);
try {
return fn.apply(undefined, arguments), true;
} catch(e){
return false;
}
}
}
function reflectGet(target, propertyKey/*, receiver*/){
var receiver = arguments.length < 3 ? target : arguments[2]
, desc = getOwnDescriptor(assertObject(target), propertyKey), proto;
if(desc)return has(desc, 'value')
? desc.value
: desc.get === undefined
? undefined
: desc.get.call(receiver);
return isObject(proto = getPrototypeOf(target))
? reflectGet(proto, propertyKey, receiver)
: undefined;
}
function reflectSet(target, propertyKey, V/*, receiver*/){
var receiver = arguments.length < 4 ? target : arguments[3]
, ownDesc = getOwnDescriptor(assertObject(target), propertyKey)
, existingDescriptor, proto;
if(!ownDesc){
if(isObject(proto = getPrototypeOf(target))){
return reflectSet(proto, propertyKey, V, receiver);
}
ownDesc = descriptor(0);
}
if(has(ownDesc, 'value')){
if(ownDesc.writable === false || !isObject(receiver))return false;
existingDescriptor = getOwnDescriptor(receiver, propertyKey) || descriptor(0);
existingDescriptor.value = V;
return defineProperty(receiver, propertyKey, existingDescriptor), true;
}
return ownDesc.set === undefined
? false
: (ownDesc.set.call(receiver, V), true);
}
var isExtensible = Object.isExtensible || returnIt;
var reflect = {
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
apply: ctx(call, apply, 3),
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
construct: construct,
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
defineProperty: wrap(defineProperty),
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
deleteProperty: function(target, propertyKey){
var desc = getOwnDescriptor(assertObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
},
// 26.1.5 Reflect.enumerate(target)
enumerate: function(target){
return new Enumerate(assertObject(target));
},
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
get: reflectGet,
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
getOwnPropertyDescriptor: function(target, propertyKey){
return getOwnDescriptor(assertObject(target), propertyKey);
},
// 26.1.8 Reflect.getPrototypeOf(target)
getPrototypeOf: function(target){
return getPrototypeOf(assertObject(target));
},
// 26.1.9 Reflect.has(target, propertyKey)
has: function(target, propertyKey){
return propertyKey in target;
},
// 26.1.10 Reflect.isExtensible(target)
isExtensible: function(target){
return !!isExtensible(assertObject(target));
},
// 26.1.11 Reflect.ownKeys(target)
ownKeys: ownKeys,
// 26.1.12 Reflect.preventExtensions(target)
preventExtensions: wrap(Object.preventExtensions || returnIt),
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
set: reflectSet
}
// 26.1.14 Reflect.setPrototypeOf(target, proto)
if(setPrototypeOf)reflect.setPrototypeOf = function(target, proto){
return setPrototypeOf(assertObject(target), proto), true;
};
$define(GLOBAL, {Reflect: {}});
$define(STATIC, 'Reflect', reflect);
}();
/******************************************************************************
* Module : es7.proposals *
******************************************************************************/
!function(){
$define(PROTO, ARRAY, {
// https://github.com/domenic/Array.prototype.includes
includes: createArrayContains(true)
});
$define(PROTO, STRING, {
// https://github.com/mathiasbynens/String.prototype.at
at: createPointAt(true)
});
function createObjectToArray(isEntries){
return function(object){
var O = toObject(object)
, keys = getKeys(object)
, length = keys.length
, i = 0
, result = Array(length)
, key;
if(isEntries)while(length > i)result[i] = [key = keys[i++], O[key]];
else while(length > i)result[i] = O[keys[i++]];
return result;
}
}
$define(STATIC, OBJECT, {
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-04/apr-9.md#51-objectentries-objectvalues
values: createObjectToArray(false),
entries: createObjectToArray(true)
});
$define(STATIC, REGEXP, {
// https://gist.github.com/kangax/9698100
escape: createReplacer(/([\\\-[\]{}()*+?.,^$|])/g, '\\$1', true)
});
}();
/******************************************************************************
* Module : es7.abstract-refs *
******************************************************************************/
// https://github.com/zenparsing/es-abstract-refs
!function(REFERENCE){
REFERENCE_GET = getWellKnownSymbol(REFERENCE+'Get', true);
var REFERENCE_SET = getWellKnownSymbol(REFERENCE+SET, true)
, REFERENCE_DELETE = getWellKnownSymbol(REFERENCE+'Delete', true);
$define(STATIC, SYMBOL, {
referenceGet: REFERENCE_GET,
referenceSet: REFERENCE_SET,
referenceDelete: REFERENCE_DELETE
});
hidden(FunctionProto, REFERENCE_GET, returnThis);
function setMapMethods(Constructor){
if(Constructor){
var MapProto = Constructor[PROTOTYPE];
hidden(MapProto, REFERENCE_GET, MapProto.get);
hidden(MapProto, REFERENCE_SET, MapProto.set);
hidden(MapProto, REFERENCE_DELETE, MapProto['delete']);
}
}
setMapMethods(Map);
setMapMethods(WeakMap);
}('reference');
/******************************************************************************
* Module : core.dict *
******************************************************************************/
!function(DICT){
Dict = function(iterable){
var dict = create(null);
if(iterable != undefined){
if(isIterable(iterable)){
for(var iter = getIterator(iterable), step, value; !(step = iter.next()).done;){
value = step.value;
dict[value[0]] = value[1];
}
} else assign(dict, iterable);
}
return dict;
}
Dict[PROTOTYPE] = null;
function DictIterator(iterated, kind){
set(this, ITER, {o: toObject(iterated), a: getKeys(iterated), i: 0, k: kind});
}
createIterator(DictIterator, DICT, function(){
var iter = this[ITER]
, O = iter.o
, keys = iter.a
, kind = iter.k
, key;
do {
if(iter.i >= keys.length){
iter.o = undefined;
return iterResult(1);
}
} while(!has(O, key = keys[iter.i++]));
if(kind == KEY) return iterResult(0, key);
if(kind == VALUE)return iterResult(0, O[key]);
return iterResult(0, [key, O[key]]);
});
function createDictIter(kind){
return function(it){
return new DictIterator(it, kind);
}
}
/*
* 0 -> forEach
* 1 -> map
* 2 -> filter
* 3 -> some
* 4 -> every
* 5 -> find
* 6 -> findKey
* 7 -> mapPairs
*/
function createDictMethod(type){
var isMap = type == 1
, isEvery = type == 4;
return function(object, callbackfn, that /* = undefined */){
var f = ctx(callbackfn, that, 3)
, O = toObject(object)
, result = isMap || type == 7 || type == 2 ? new (generic(this, Dict)) : undefined
, key, val, res;
for(key in O)if(has(O, key)){
val = O[key];
res = f(val, key, object);
if(type){
if(isMap)result[key] = res; // map
else if(res)switch(type){
case 2: result[key] = val; break // filter
case 3: return true; // some
case 5: return val; // find
case 6: return key; // findKey
case 7: result[res[0]] = res[1]; // mapPairs
} else if(isEvery)return false; // every
}
}
return type == 3 || isEvery ? isEvery : result;
}
}
function createDictReduce(isTurn){
return function(object, mapfn, init){
assertFunction(mapfn);
var O = toObject(object)
, keys = getKeys(O)
, length = keys.length
, i = 0
, memo, key, result;
if(isTurn)memo = init == undefined ? new (generic(this, Dict)) : Object(init);
else if(arguments.length < 3){
assert(length, REDUCE_ERROR);
memo = O[keys[i++]];
} else memo = Object(init);
while(length > i)if(has(O, key = keys[i++])){
result = mapfn(memo, O[key], key, object);
if(isTurn){
if(result === false)break;
} else memo = result;
}
return memo;
}
}
var findKey = createDictMethod(6);
function includes(object, el){
return (el == el ? keyOf(object, el) : findKey(object, sameNaN)) !== undefined;
}
var dictMethods = {
keys: createDictIter(KEY),
values: createDictIter(VALUE),
entries: createDictIter(KEY+VALUE),
forEach: createDictMethod(0),
map: createDictMethod(1),
filter: createDictMethod(2),
some: createDictMethod(3),
every: createDictMethod(4),
find: createDictMethod(5),
findKey: findKey,
mapPairs:createDictMethod(7),
reduce: createDictReduce(false),
turn: createDictReduce(true),
keyOf: keyOf,
includes:includes,
// Has / get / set own property
has: has,
get: get,
set: createDefiner(0),
isDict: function(it){
return isObject(it) && getPrototypeOf(it) === Dict[PROTOTYPE];
}
};
if(REFERENCE_GET)for(var key in dictMethods)!function(fn){
function method(){
for(var args = [this], i = 0; i < arguments.length;)args.push(arguments[i++]);
return invoke(fn, args);
}
fn[REFERENCE_GET] = function(){
return method;
}
}(dictMethods[key]);
$define(GLOBAL + FORCED, {Dict: assignHidden(Dict, dictMethods)});
}('Dict');
/******************************************************************************
* Module : core.$for *
******************************************************************************/
!function(ENTRIES, FN){
function $for(iterable, entries){
if(!(this instanceof $for))return new $for(iterable, entries);
this[ITER] = getIterator(iterable);
this[ENTRIES] = !!entries;
}
createIterator($for, 'Wrapper', function(){
return this[ITER].next();
});
var $forProto = $for[PROTOTYPE];
setIterator($forProto, function(){
return this[ITER]; // unwrap
});
function createChainIterator(next){
function Iter(I, fn, that){
this[ITER] = getIterator(I);
this[ENTRIES] = I[ENTRIES];
this[FN] = ctx(fn, that, I[ENTRIES] ? 2 : 1);
}
createIterator(Iter, 'Chain', next, $forProto);
setIterator(Iter[PROTOTYPE], returnThis); // override $forProto iterator
return Iter;
}
var MapIter = createChainIterator(function(){
var step = this[ITER].next();
return step.done ? step : iterResult(0, stepCall(this[FN], step.value, this[ENTRIES]));
});
var FilterIter = createChainIterator(function(){
for(;;){
var step = this[ITER].next();
if(step.done || stepCall(this[FN], step.value, this[ENTRIES]))return step;
}
});
assignHidden($forProto, {
of: function(fn, that){
forOf(this, this[ENTRIES], fn, that);
},
array: function(fn, that){
var result = [];
forOf(fn != undefined ? this.map(fn, that) : this, false, push, result);
return result;
},
filter: function(fn, that){
return new FilterIter(this, fn, that);
},
map: function(fn, that){
return new MapIter(this, fn, that);
}
});
$for.isIterable = isIterable;
$for.getIterator = getIterator;
$define(GLOBAL + FORCED, {$for: $for});
}('entries', safeSymbol('fn'));
/******************************************************************************
* Module : core.delay *
******************************************************************************/
// https://esdiscuss.org/topic/promise-returning-delay-function
$define(GLOBAL + FORCED, {
delay: function(time){
return new Promise(function(resolve){
setTimeout(resolve, time, true);
});
}
});
/******************************************************************************
* Module : core.binding *
******************************************************************************/
!function(_, toLocaleString){
// Placeholder
core._ = path._ = path._ || {};
$define(PROTO + FORCED, FUNCTION, {
part: part,
only: function(numberArguments, that /* = @ */){
var fn = assertFunction(this)
, n = toLength(numberArguments)
, isThat = arguments.length > 1;
return function(/* ...args */){
var length = min(n, arguments.length)
, args = Array(length)
, i = 0;
while(length > i)args[i] = arguments[i++];
return invoke(fn, args, isThat ? that : this);
}
}
});
function tie(key){
var that = this
, bound = {};
return hidden(that, _, function(key){
if(key === undefined || !(key in that))return toLocaleString.call(that);
return has(bound, key) ? bound[key] : (bound[key] = ctx(that[key], that, -1));
})[_](key);
}
hidden(path._, TO_STRING, function(){
return _;
});
hidden(ObjectProto, _, tie);
DESC || hidden(ArrayProto, _, tie);
// IE8- dirty hack - redefined toLocaleString is not enumerable
}(DESC ? uid('tie') : TO_LOCALE, ObjectProto[TO_LOCALE]);
/******************************************************************************
* Module : core.object *
******************************************************************************/
!function(){
function define(target, mixin){
var keys = ownKeys(toObject(mixin))
, length = keys.length
, i = 0, key;
while(length > i)defineProperty(target, key = keys[i++], getOwnDescriptor(mixin, key));
return target;
};
$define(STATIC + FORCED, OBJECT, {
isObject: isObject,
classof: classof,
define: define,
make: function(proto, mixin){
return define(create(proto), mixin);
}
});
}();
/******************************************************************************
* Module : core.array *
******************************************************************************/
$define(PROTO + FORCED, ARRAY, {
turn: function(fn, target /* = [] */){
assertFunction(fn);
var memo = target == undefined ? [] : Object(target)
, O = ES5Object(this)
, length = toLength(O.length)
, index = 0;
while(length > index)if(fn(memo, O[index], index++, this) === false)break;
return memo;
}
});
if(framework)ArrayUnscopables.turn = true;
/******************************************************************************
* Module : core.number *
******************************************************************************/
!function(numberMethods){
function NumberIterator(iterated){
set(this, ITER, {l: toLength(iterated), i: 0});
}
createIterator(NumberIterator, NUMBER, function(){
var iter = this[ITER]
, i = iter.i++;
return i < iter.l ? iterResult(0, i) : iterResult(1);
});
defineIterator(Number, NUMBER, function(){
return new NumberIterator(this);
});
numberMethods.random = function(lim /* = 0 */){
var a = +this
, b = lim == undefined ? 0 : +lim
, m = min(a, b);
return random() * (max(a, b) - m) + m;
};
forEach.call(array(
// ES3:
'round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,' +
// ES6:
'acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc'
), function(key){
var fn = Math[key];
if(fn)numberMethods[key] = function(/* ...args */){
// ie9- dont support strict mode & convert `this` to object -> convert it to number
var args = [+this]
, i = 0;
while(arguments.length > i)args.push(arguments[i++]);
return invoke(fn, args);
}
}
);
$define(PROTO + FORCED, NUMBER, numberMethods);
}({});
/******************************************************************************
* Module : core.string *
******************************************************************************/
!function(){
var escapeHTMLDict = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
}, unescapeHTMLDict = {}, key;
for(key in escapeHTMLDict)unescapeHTMLDict[escapeHTMLDict[key]] = key;
$define(PROTO + FORCED, STRING, {
escapeHTML: createReplacer(/[&<>"']/g, escapeHTMLDict),
unescapeHTML: createReplacer(/&(?:amp|lt|gt|quot|apos);/g, unescapeHTMLDict)
});
}();
/******************************************************************************
* Module : core.date *
******************************************************************************/
!function(formatRegExp, flexioRegExp, locales, current, SECONDS, MINUTES, HOURS, MONTH, YEAR){
function createFormat(prefix){
return function(template, locale /* = current */){
var that = this
, dict = locales[has(locales, locale) ? locale : current];
function get(unit){
return that[prefix + unit]();
}
return String(template).replace(formatRegExp, function(part){
switch(part){
case 's' : return get(SECONDS); // Seconds : 0-59
case 'ss' : return lz(get(SECONDS)); // Seconds : 00-59
case 'm' : return get(MINUTES); // Minutes : 0-59
case 'mm' : return lz(get(MINUTES)); // Minutes : 00-59
case 'h' : return get(HOURS); // Hours : 0-23
case 'hh' : return lz(get(HOURS)); // Hours : 00-23
case 'D' : return get(DATE); // Date : 1-31
case 'DD' : return lz(get(DATE)); // Date : 01-31
case 'W' : return dict[0][get('Day')]; // Day : Понедельник
case 'N' : return get(MONTH) + 1; // Month : 1-12
case 'NN' : return lz(get(MONTH) + 1); // Month : 01-12
case 'M' : return dict[2][get(MONTH)]; // Month : Январь
case 'MM' : return dict[1][get(MONTH)]; // Month : Января
case 'Y' : return get(YEAR); // Year : 2014
case 'YY' : return lz(get(YEAR) % 100); // Year : 14
} return part;
});
}
}
function lz(num){
return num > 9 ? num : '0' + num;
}
function addLocale(lang, locale){
function split(index){
var result = [];
forEach.call(array(locale.months), function(it){
result.push(it.replace(flexioRegExp, '$' + index));
});
return result;
}
locales[lang] = [array(locale.weekdays), split(1), split(2)];
return core;
}
$define(PROTO + FORCED, DATE, {
format: createFormat('get'),
formatUTC: createFormat('getUTC')
});
addLocale(current, {
weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday',
months: 'January,February,March,April,May,June,July,August,September,October,November,December'
});
addLocale('ru', {
weekdays: 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота',
months: 'Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,' +
'Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь'
});
core.locale = function(locale){
return has(locales, locale) ? current = locale : current;
};
core.addLocale = addLocale;
}(/\b\w\w?\b/g, /:(.*)\|(.*)$/, {}, 'en', 'Seconds', 'Minutes', 'Hours', 'Month', 'FullYear');
/******************************************************************************
* Module : core.global *
******************************************************************************/
$define(GLOBAL + FORCED, {global: global});
/******************************************************************************
* Module : js.array.statics *
******************************************************************************/
// JavaScript 1.6 / Strawman array statics shim
!function(arrayStatics){
function setArrayStatics(keys, length){
forEach.call(array(keys), function(key){
if(key in ArrayProto)arrayStatics[key] = ctx(call, ArrayProto[key], length);
});
}
setArrayStatics('pop,reverse,shift,keys,values,entries', 1);
setArrayStatics('indexOf,every,some,forEach,map,filter,find,findIndex,includes', 3);
setArrayStatics('join,slice,concat,push,splice,unshift,sort,lastIndexOf,' +
'reduce,reduceRight,copyWithin,fill,turn');
$define(STATIC, ARRAY, arrayStatics);
}({});
/******************************************************************************
* Module : web.dom.itarable *
******************************************************************************/
!function(NodeList){
if(framework && NodeList && !(SYMBOL_ITERATOR in NodeList[PROTOTYPE])){
hidden(NodeList[PROTOTYPE], SYMBOL_ITERATOR, Iterators[ARRAY]);
}
Iterators.NodeList = Iterators[ARRAY];
}(global.NodeList);
/******************************************************************************
* Module : web.timers *
******************************************************************************/
// ie9- setTimeout & setInterval additional parameters fix
!function(MSIE){
function wrap(set){
return MSIE ? function(fn, time /*, ...args */){
return set(invoke(part, slice.call(arguments, 2), isFunction(fn) ? fn : Function(fn)), time);
} : set;
}
$define(GLOBAL + BIND + FORCED * MSIE, {
setTimeout: setTimeout = wrap(setTimeout),
setInterval: wrap(setInterval)
});
// ie9- dirty check
}(!!navigator && /MSIE .\./.test(navigator.userAgent));
/******************************************************************************
* Module : web.console *
******************************************************************************/
!function(cap){
forEach.call(array(CONSOLE_METHODS), function(key){
cap[key] = function(){};
});
$define(GLOBAL, {console: {}});
$define(STATIC, 'console', cap);
}({});
/******************************************************************************
* Module : core.log *
******************************************************************************/
!function(log, console, enabled){
forEach.call(array(CONSOLE_METHODS), function(key){
log[key] = function(){
if(enabled && key in console)return apply.call(console[key], console, arguments);
};
});
$define(GLOBAL + FORCED, {log: assign(log.log, log, {
enable: function(){
enabled = true;
},
disable: function(){
enabled = false;
}
})});
}({}, global.console || {}, true);
}(typeof self != 'undefined' && self.Math === Math ? self : Function('return this')(), false); |
todo-list/src/tasks/TaskList.js | kristijan-pajtasev/react-todo-app | import React, { Component } from 'react';
import Task from './Task';
import TaskStore from "./TaskStore";
import EventEmitter from "../EventEmitter";
import TaskActions from "./TaskActions";
import "./TaskList.css";
class TaskList extends Component {
constructor() {
super();
this.state = { tasks: [], filter: "" };
};
componentDidMount() {
EventEmitter.subscribe("TASKS_ADDED", () => {
var tasks = TaskStore.getAll();
this.setState({tasks: tasks})
});
TaskActions.getTasks();
};
filterByStatus = (status) => {
let tasks = [];
switch(status) {
case "":
tasks = TaskStore.getAll();
break;
case "DONE":
tasks = TaskStore.getDone();
break;
case "NOT_DONE":
tasks = TaskStore.getNotDone();
break;
default:
break;
}
this.setState({tasks: tasks, filter: status});
};
getClass(filter) {
return "btn btn-primary " + (this.state.filter === filter ? "active" : "");
}
render() {
return <div>
<div className="taskListFilter btn-group">
<button className={this.getClass("")} onClick={this.filterByStatus.bind(this, "")}>All</button>
<button className={this.getClass("DONE")} onClick={this.filterByStatus.bind(this, "DONE")}>Done</button>
<button className={this.getClass("NOT_DONE")} onClick={this.filterByStatus.bind(this, "NOT_DONE")}>Not done</button>
</div>
<ul className="taskList">
{this.state.tasks.map((t, i) => <Task key={i} task={t} />)}
</ul>
</div>;
};
}
export default TaskList; |
sandbox-react-redux/src/components/pages/PageBar.js | ohtomi/sandbox | import React from 'react'
import HeaderContainer from '../organisms/HeaderContainer'
import CountContainer from '../organisms/CountContainer'
import CalcContainer from '../organisms/CalcContainer'
import Link from '../atoms/Link'
const PageBar = ({ state: { misc: { locked }, routing: { pathname } }, actions }) => {
return (
<div className={locked ? 'App App-locked' : 'App'}>
<HeaderContainer />
<p className="App-intro">
<CountContainer />
</p>
<p className="App-intro">
<CalcContainer />
</p>
<p className="App-intro">
[ {pathname} ]
[ <Link to="/" {...actions.routing}>go to root</Link> ]
[ <Link to="/foo/12345" {...actions.routing}>go to foo</Link> ]
</p>
</div>
)
}
export default PageBar
|
docs/src/pages/demos/dialogs/FullScreenDialog.js | Kagami/material-ui | import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import ListItemText from '@material-ui/core/ListItemText';
import ListItem from '@material-ui/core/ListItem';
import List from '@material-ui/core/List';
import Divider from '@material-ui/core/Divider';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import IconButton from '@material-ui/core/IconButton';
import Typography from '@material-ui/core/Typography';
import CloseIcon from '@material-ui/icons/Close';
import Slide from '@material-ui/core/Slide';
const styles = {
appBar: {
position: 'relative',
},
flex: {
flex: 1,
},
};
function Transition(props) {
return <Slide direction="up" {...props} />;
}
class FullScreenDialog extends React.Component {
state = {
open: false,
};
handleClickOpen = () => {
this.setState({ open: true });
};
handleClose = () => {
this.setState({ open: false });
};
render() {
const { classes } = this.props;
return (
<div>
<Button variant="outlined" color="primary" onClick={this.handleClickOpen}>
Open full-screen dialog
</Button>
<Dialog
fullScreen
open={this.state.open}
onClose={this.handleClose}
TransitionComponent={Transition}
>
<AppBar className={classes.appBar}>
<Toolbar>
<IconButton color="inherit" onClick={this.handleClose} aria-label="Close">
<CloseIcon />
</IconButton>
<Typography variant="h6" color="inherit" className={classes.flex}>
Sound
</Typography>
<Button color="inherit" onClick={this.handleClose}>
save
</Button>
</Toolbar>
</AppBar>
<List>
<ListItem button>
<ListItemText primary="Phone ringtone" secondary="Titania" />
</ListItem>
<Divider />
<ListItem button>
<ListItemText primary="Default notification ringtone" secondary="Tethys" />
</ListItem>
</List>
</Dialog>
</div>
);
}
}
FullScreenDialog.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(FullScreenDialog);
|
src/components/UrlList.js | jonniebigodes/freecodecampApiChallenges | import React, {Component} from 'react'
import Axios from 'axios'
import Footer from './Footer'
import Header from './Header'
import '../Assets/styleSheets/base.scss'
class Urlist extends Component {
state = {
shortUrls: [],
isError: false
}
componentDidMount() {
setTimeout(() => {
this.fetchList()
}, 500)
}
fetchList() {
Axios.get(
process.env.NODE_ENV !== 'production'
? 'http://localhost:5000/api/short'
: 'https://freecodecampapichallenges.herokuapp.com/api/short'
)
.then(result => {
this.setState({shortUrls: result.data})
})
.catch(err => {
console.log(
`ERROR GETTING LIST URLS DATA=>${JSON.stringify(
err.response,
null,
2
)}`
)
this.setState({isError: true})
})
}
render() {
const {isError, shortUrls} = this.state
const datalist = shortUrls.map(item => (
<li key={item.shortid}>
<a href={item.destination} target="_noopener" rel="nofollow">
{process.env.NODE_ENV !== 'production'
? `http://localhost:5000/api/short/${item.shortid}`
: `https://freecodecampapichallenges.herokuapp.com/api/short/${
item.shortid
}`}
</a>
</li>
))
if (isError) {
return (
<div key="ErrorView">
<Header />
<div>
Well now that's awkward looks like something bad happened
</div>
<Footer />
</div>
)
}
return (
<div>
<Header />
<div className="containerProjects">
<div className="titles">
Supercalifragilistic API url shortener microservice
</div>
<div className="exercisesInfoText">list of urls in system:</div>
<div className="exercisesInfoText">
<ul>{datalist}</ul>
</div>
</div>
<Footer />
</div>
)
}
}
export default Urlist
|
packages/showcase/showcase-components/showcase-button.js | uber/react-vis | // Copyright (c) 2016 - 2017 Uber Technologies, Inc.
//
// 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.
import React from 'react';
import PropTypes from 'prop-types';
function ShowcaseButton(props) {
const {buttonContent, onClick} = props;
return (
<button className="showcase-button" onClick={onClick}>
{buttonContent}
</button>
);
}
ShowcaseButton.propTypes = {
buttonContent: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired
};
export default ShowcaseButton;
|
ecodes/sites/all/modules/ctools/js/dependent.js | csepuser/EthicsPublicHtmlTest | /**
* @file
* Provides dependent visibility for form items in CTools' ajax forms.
*
* To your $form item definition add:
* - '#process' => array('ctools_process_dependency'),
* - '#dependency' => array('id-of-form-item' => array(list, of, values, that,
* make, this, item, show),
*
* Special considerations:
* - Radios are harder. Because Drupal doesn't give radio groups individual IDs,
* use 'radio:name-of-radio'.
*
* - Checkboxes don't have their own id, so you need to add one in a div
* around the checkboxes via #prefix and #suffix. You actually need to add TWO
* divs because it's the parent that gets hidden. Also be sure to retain the
* 'expand_checkboxes' in the #process array, because the CTools process will
* override it.
*/
(function ($) {
Drupal.CTools = Drupal.CTools || {};
Drupal.CTools.dependent = {};
Drupal.CTools.dependent.bindings = {};
Drupal.CTools.dependent.activeBindings = {};
Drupal.CTools.dependent.activeTriggers = [];
Drupal.CTools.dependent.inArray = function(array, search_term) {
var i = array.length;
while (i--) {
if (array[i] == search_term) {
return true;
}
}
return false;
}
Drupal.CTools.dependent.autoAttach = function() {
// Clear active bindings and triggers.
for (i in Drupal.CTools.dependent.activeTriggers) {
$(Drupal.CTools.dependent.activeTriggers[i]).unbind('change.ctools-dependent');
}
Drupal.CTools.dependent.activeTriggers = [];
Drupal.CTools.dependent.activeBindings = {};
Drupal.CTools.dependent.bindings = {};
if (!Drupal.settings.CTools) {
return;
}
// Iterate through all relationships
for (id in Drupal.settings.CTools.dependent) {
// Test to make sure the id even exists; this helps clean up multiple
// AJAX calls with multiple forms.
// Drupal.CTools.dependent.activeBindings[id] is a boolean,
// whether the binding is active or not. Defaults to no.
Drupal.CTools.dependent.activeBindings[id] = 0;
// Iterate through all possible values
for(bind_id in Drupal.settings.CTools.dependent[id].values) {
// This creates a backward relationship. The bind_id is the ID
// of the element which needs to change in order for the id to hide or become shown.
// The id is the ID of the item which will be conditionally hidden or shown.
// Here we're setting the bindings for the bind
// id to be an empty array if it doesn't already have bindings to it
if (!Drupal.CTools.dependent.bindings[bind_id]) {
Drupal.CTools.dependent.bindings[bind_id] = [];
}
// Add this ID
Drupal.CTools.dependent.bindings[bind_id].push(id);
// Big long if statement.
// Drupal.settings.CTools.dependent[id].values[bind_id] holds the possible values
if (bind_id.substring(0, 6) == 'radio:') {
var trigger_id = "input[name='" + bind_id.substring(6) + "']";
}
else {
var trigger_id = '#' + bind_id;
}
Drupal.CTools.dependent.activeTriggers.push(trigger_id);
if ($(trigger_id).attr('type') == 'checkbox') {
$(trigger_id).siblings('label').addClass('hidden-options');
}
var getValue = function(item, trigger) {
if ($(trigger).size() == 0) {
return null;
}
if (item.substring(0, 6) == 'radio:') {
var val = $(trigger + ':checked').val();
}
else {
switch ($(trigger).attr('type')) {
case 'checkbox':
var val = $(trigger).attr('checked') ? true : false;
if (val) {
$(trigger).siblings('label').removeClass('hidden-options').addClass('expanded-options');
}
else {
$(trigger).siblings('label').removeClass('expanded-options').addClass('hidden-options');
}
break;
default:
var val = $(trigger).val();
}
}
return val;
}
var setChangeTrigger = function(trigger_id, bind_id) {
// Triggered when change() is clicked.
var changeTrigger = function() {
var val = getValue(bind_id, trigger_id);
if (val == null) {
return;
}
for (i in Drupal.CTools.dependent.bindings[bind_id]) {
var id = Drupal.CTools.dependent.bindings[bind_id][i];
// Fix numerous errors
if (typeof id != 'string') {
continue;
}
// This bit had to be rewritten a bit because two properties on the
// same set caused the counter to go up and up and up.
if (!Drupal.CTools.dependent.activeBindings[id]) {
Drupal.CTools.dependent.activeBindings[id] = {};
}
if (val != null && Drupal.CTools.dependent.inArray(Drupal.settings.CTools.dependent[id].values[bind_id], val)) {
Drupal.CTools.dependent.activeBindings[id][bind_id] = 'bind';
}
else {
delete Drupal.CTools.dependent.activeBindings[id][bind_id];
}
var len = 0;
for (i in Drupal.CTools.dependent.activeBindings[id]) {
len++;
}
var object = $('#' + id + '-wrapper');
if (!object.size()) {
// Some elements can't use the parent() method or they can
// damage things. They are guaranteed to have wrappers but
// only if dependent.inc provided them. This check prevents
// problems when multiple AJAX calls cause settings to build
// up.
var $original = $('#' + id);
if ($original.is('fieldset') || $original.is('textarea')) {
continue;
}
object = $('#' + id).parent();
}
if (Drupal.settings.CTools.dependent[id].type == 'disable') {
if (Drupal.settings.CTools.dependent[id].num <= len) {
// Show if the element if criteria is matched
object.attr('disabled', false);
object.addClass('dependent-options');
object.children().attr('disabled', false);
}
else {
// Otherwise hide. Use css rather than hide() because hide()
// does not work if the item is already hidden, for example,
// in a collapsed fieldset.
object.attr('disabled', true);
object.children().attr('disabled', true);
}
}
else {
if (Drupal.settings.CTools.dependent[id].num <= len) {
// Show if the element if criteria is matched
object.show(0);
object.addClass('dependent-options');
}
else {
// Otherwise hide. Use css rather than hide() because hide()
// does not work if the item is already hidden, for example,
// in a collapsed fieldset.
object.css('display', 'none');
}
}
}
}
$(trigger_id).bind('change.ctools-dependent', function() {
// Trigger the internal change function
// the attr('id') is used because closures are more confusing
changeTrigger(trigger_id, bind_id);
});
// Trigger initial reaction
changeTrigger(trigger_id, bind_id);
}
setChangeTrigger(trigger_id, bind_id);
}
}
}
Drupal.behaviors.CToolsDependent = {
attach: function (context) {
Drupal.CTools.dependent.autoAttach();
// Really large sets of fields are too slow with the above method, so this
// is a sort of hacked one that's faster but much less flexible.
$("select.ctools-master-dependent")
.once('ctools-dependent')
.bind('change.ctools-dependent', function() {
var val = $(this).val();
if (val == 'all') {
$('.ctools-dependent-all').show(0);
}
else {
$('.ctools-dependent-all').hide(0);
$('.ctools-dependent-' + val).show(0);
}
})
.trigger('change.ctools-dependent');
}
}
})(jQuery);
|
webapp-src/src/hutch.js | babelouest/hutch | /**
*
* Hutch front-end application
*
* Copyright 2021 Nicolas Mora <[email protected]>
*
* License AGPL
*
*/
import React from 'react';
import ReactDOM from 'react-dom';
import i18next from 'i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { importJWK, jwtVerify } from 'jose-browser-runtime';
import App from './Hutch/App';
import storage from './lib/Storage';
import messageDispatcher from './lib/MessageDispatcher';
import apiManager from './lib/APIManager';
import oidcConnector from './lib/OIDCConnector';
import ErrorConfig from './lib/ErrorConfig';
function getServerConfig(rootUrl) {
var backendConfig = {};
return apiManager.request(rootUrl+"/.well-known/hutch-configuration", "GET", false, "application/jwt")
.then((serverConfig) => {
var serverConfigHeader = JSON.parse(atob(serverConfig.split(".")[0].replace(/-/g, '+').replace(/_/g, '/')));
backendConfig.config = JSON.parse(atob(serverConfig.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
return apiManager.request(backendConfig.config.jwks_uri, "GET", false, "application/jwt")
.then((backendJwks) => {
var backendJwksHeader = JSON.parse(atob(backendJwks.split(".")[0].replace(/-/g, '+').replace(/_/g, '/')));
backendConfig.jwks = JSON.parse(atob(backendJwks.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
return importJWK(backendConfig.jwks.keys[0], backendConfig.jwks.keys[0].alg)
.then((publicKey) => {
return jwtVerify(serverConfig, publicKey)
.then(() => {
return jwtVerify(backendJwks, publicKey)
.then(() => {
return backendConfig;
});
});
});
});
});
}
var initApp = () => {
const urlParams = new URLSearchParams(window.location.search);
apiManager.request("config.json")
.then((frontEndConfig) => {
if (!frontEndConfig.lang) {
frontEndConfig.lang = ["en","fr"];
}
storage.setStorageType(frontEndConfig.storageType);
getServerConfig(frontEndConfig.hutchRootUrl)
.then((backendConfig) => {
var config = {
oidc: {
status: "connecting"
},
frontend: frontEndConfig,
backend: backendConfig.config,
jwks: backendConfig.jwks,
profile_endpoint: frontEndConfig.profile_endpoint || backendConfig.config.profile_endpoint,
safe_endpoint: frontEndConfig.safe_endpoint || backendConfig.config.safe_endpoint,
oidc_server_remote_config: frontEndConfig.oidc.oidc_server_remote_config || backendConfig.config.oidc_server_remote_config,
scope: frontEndConfig.oidc.scope || backendConfig.config.scope
}
oidcConnector.init({
storagePrefix: "hutchOidc",
storageType: storage.storageType,
responseType: storage.getValue("longSession")?"code":"token id_token",
openidConfigUrl: config.oidc_server_remote_config,
authUrl: frontEndConfig.oidc.authUrl,
tokenUrl: frontEndConfig.oidc.tokenUrl,
clientId: frontEndConfig.oidc.clientId,
redirectUri: frontEndConfig.oidc.redirectUri,
usePkce: frontEndConfig.oidc.usePkce,
scope: config.scope,
userinfoUrl: frontEndConfig.oidc.userinfoUrl,
refreshTokenLoop: frontEndConfig.oidc.refreshTokenLoop,
changeStatusCb: function (newStatus, token, expires_in, profile) {
messageDispatcher.sendMessage('OIDC', {status: newStatus, token: token, expires_in: expires_in, profile: profile});
}
});
apiManager.setConfig(frontEndConfig.APIUrl);
ReactDOM.render(<App config={config} />, document.getElementById('root'));
})
.fail((error) => {
ReactDOM.render(<ErrorConfig message={"Error getting hutch backend config"}/>, document.getElementById('root'));
});
})
.fail((error) => {
ReactDOM.render(<ErrorConfig message={"Error getting hutch frontend config"}/>, document.getElementById('root'));
});
}
try {
i18next
.use(Backend)
.use(LanguageDetector)
.init({
fallbackLng: 'en',
ns: ['translations'],
defaultNS: 'translations',
backend: {
loadPath: 'locales/{{lng}}/{{ns}}.json'
}
})
.then(() => {
initApp();
});
} catch (e) {
$("#root").html('<div class="alert alert-danger" role="alert">' +
'<i class="fas fa-exclamation-triangle"></i>' +
'<span class="btn-icon-right">You must use a browser compatible with Hutch</span>' +
'</div>');
}
|
src/BackgroundWrapper.js | martynasj/react-big-calendar | import React from 'react';
import PropTypes from 'prop-types';
class BackgroundWrapper extends React.Component {
render() {
return this.props.children;
}
}
BackgroundWrapper.propTypes = {
children: PropTypes.element,
value: PropTypes.instanceOf(Date),
range: PropTypes.arrayOf(PropTypes.instanceOf(Date))
}
export default BackgroundWrapper;
|
ajax/libs/react-router/1.0.0-rc4/ReactRouter.js | honestree/cdnjs | (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["ReactRouter"] = factory(require("react"));
else
root["ReactRouter"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/* components */
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Router2 = __webpack_require__(26);
var _Router3 = _interopRequireDefault(_Router2);
exports.Router = _Router3['default'];
var _Link2 = __webpack_require__(13);
var _Link3 = _interopRequireDefault(_Link2);
exports.Link = _Link3['default'];
var _IndexLink2 = __webpack_require__(20);
var _IndexLink3 = _interopRequireDefault(_IndexLink2);
exports.IndexLink = _IndexLink3['default'];
/* components (configuration) */
var _IndexRedirect2 = __webpack_require__(21);
var _IndexRedirect3 = _interopRequireDefault(_IndexRedirect2);
exports.IndexRedirect = _IndexRedirect3['default'];
var _IndexRoute2 = __webpack_require__(22);
var _IndexRoute3 = _interopRequireDefault(_IndexRoute2);
exports.IndexRoute = _IndexRoute3['default'];
var _Redirect2 = __webpack_require__(14);
var _Redirect3 = _interopRequireDefault(_Redirect2);
exports.Redirect = _Redirect3['default'];
var _Route2 = __webpack_require__(24);
var _Route3 = _interopRequireDefault(_Route2);
exports.Route = _Route3['default'];
/* mixins */
var _History2 = __webpack_require__(19);
var _History3 = _interopRequireDefault(_History2);
exports.History = _History3['default'];
var _Lifecycle2 = __webpack_require__(23);
var _Lifecycle3 = _interopRequireDefault(_Lifecycle2);
exports.Lifecycle = _Lifecycle3['default'];
var _RouteContext2 = __webpack_require__(25);
var _RouteContext3 = _interopRequireDefault(_RouteContext2);
exports.RouteContext = _RouteContext3['default'];
/* utils */
var _useRoutes2 = __webpack_require__(9);
var _useRoutes3 = _interopRequireDefault(_useRoutes2);
exports.useRoutes = _useRoutes3['default'];
var _RouteUtils = __webpack_require__(4);
exports.createRoutes = _RouteUtils.createRoutes;
var _RoutingContext2 = __webpack_require__(15);
var _RoutingContext3 = _interopRequireDefault(_RoutingContext2);
exports.RoutingContext = _RoutingContext3['default'];
var _PropTypes2 = __webpack_require__(5);
var _PropTypes3 = _interopRequireDefault(_PropTypes2);
exports.PropTypes = _PropTypes3['default'];
var _match2 = __webpack_require__(32);
var _match3 = _interopRequireDefault(_match2);
exports.match = _match3['default'];
var _Router4 = _interopRequireDefault(_Router2);
exports['default'] = _Router4['default'];
/***/ },
/* 1 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule invariant
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var invariant = function(condition, format, a, b, c, d, e, f) {
if (false) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
}
if (!condition) {
var error;
if (format === undefined) {
error = new Error(
'Minified exception occurred; use the non-minified dev environment ' +
'for the full error message and additional helpful warnings.'
);
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(
'Invariant Violation: ' +
format.replace(/%s/g, function() { return args[argIndex++]; })
);
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
};
module.exports = invariant;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (false) {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.isReactChildren = isReactChildren;
exports.createRouteFromReactElement = createRouteFromReactElement;
exports.createRoutesFromReactChildren = createRoutesFromReactChildren;
exports.createRoutes = createRoutes;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
function isValidChild(object) {
return object == null || _react2['default'].isValidElement(object);
}
function isReactChildren(object) {
return isValidChild(object) || Array.isArray(object) && object.every(isValidChild);
}
function checkPropTypes(componentName, propTypes, props) {
componentName = componentName || 'UnknownComponent';
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](props, propName, componentName);
/* istanbul ignore if: error logging */
if (error instanceof Error) false ? _warning2['default'](false, error.message) : undefined;
}
}
}
function createRoute(defaultProps, props) {
return _extends({}, defaultProps, props);
}
function createRouteFromReactElement(element) {
var type = element.type;
var route = createRoute(type.defaultProps, element.props);
if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route);
if (route.children) {
var childRoutes = createRoutesFromReactChildren(route.children, route);
if (childRoutes.length) route.childRoutes = childRoutes;
delete route.children;
}
return route;
}
/**
* Creates and returns a routes object from the given ReactChildren. JSX
* provides a convenient way to visualize how routes in the hierarchy are
* nested.
*
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
* const routes = createRoutesFromReactChildren(
* <Route component={App}>
* <Route path="home" component={Dashboard}/>
* <Route path="news" component={NewsFeed}/>
* </Route>
* )
*
* Note: This method is automatically used when you provide <Route> children
* to a <Router> component.
*/
function createRoutesFromReactChildren(children, parentRoute) {
var routes = [];
_react2['default'].Children.forEach(children, function (element) {
if (_react2['default'].isValidElement(element)) {
// Component classes may have a static create* method.
if (element.type.createRouteFromReactElement) {
var route = element.type.createRouteFromReactElement(element, parentRoute);
if (route) routes.push(route);
} else {
routes.push(createRouteFromReactElement(element));
}
}
});
return routes;
}
/**
* Creates and returns an array of routes from the given object which
* may be a JSX route, a plain object route, or an array of either.
*/
function createRoutes(routes) {
if (isReactChildren(routes)) {
routes = createRoutesFromReactChildren(routes);
} else if (routes && !Array.isArray(routes)) {
routes = [routes];
}
return routes;
}
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.falsy = falsy;
var _react = __webpack_require__(1);
var func = _react.PropTypes.func;
var object = _react.PropTypes.object;
var arrayOf = _react.PropTypes.arrayOf;
var oneOfType = _react.PropTypes.oneOfType;
var element = _react.PropTypes.element;
var shape = _react.PropTypes.shape;
var string = _react.PropTypes.string;
function falsy(props, propName, componentName) {
if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop');
}
var history = shape({
listen: func.isRequired,
pushState: func.isRequired,
replaceState: func.isRequired,
go: func.isRequired
});
exports.history = history;
var location = shape({
pathname: string.isRequired,
search: string.isRequired,
state: object,
action: string.isRequired,
key: string
});
exports.location = location;
var component = oneOfType([func, string]);
exports.component = component;
var components = oneOfType([component, object]);
exports.components = components;
var route = oneOfType([object, element]);
exports.route = route;
var routes = oneOfType([route, arrayOf(route)]);
exports.routes = routes;
exports['default'] = {
falsy: falsy,
history: history,
location: location,
component: component,
components: components,
route: route
};
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.compilePattern = compilePattern;
exports.matchPattern = matchPattern;
exports.getParamNames = getParamNames;
exports.getParams = getParams;
exports.formatPattern = formatPattern;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function escapeSource(string) {
return escapeRegExp(string).replace(/\/+/g, '/+');
}
function _compilePattern(pattern) {
var regexpSource = '';
var paramNames = [];
var tokens = [];
var match = undefined,
lastIndex = 0,
matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;
while (match = matcher.exec(pattern)) {
if (match.index !== lastIndex) {
tokens.push(pattern.slice(lastIndex, match.index));
regexpSource += escapeSource(pattern.slice(lastIndex, match.index));
}
if (match[1]) {
regexpSource += '([^/?#]+)';
paramNames.push(match[1]);
} else if (match[0] === '**') {
regexpSource += '([\\s\\S]*)';
paramNames.push('splat');
} else if (match[0] === '*') {
regexpSource += '([\\s\\S]*?)';
paramNames.push('splat');
} else if (match[0] === '(') {
regexpSource += '(?:';
} else if (match[0] === ')') {
regexpSource += ')?';
}
tokens.push(match[0]);
lastIndex = matcher.lastIndex;
}
if (lastIndex !== pattern.length) {
tokens.push(pattern.slice(lastIndex, pattern.length));
regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length));
}
return {
pattern: pattern,
regexpSource: regexpSource,
paramNames: paramNames,
tokens: tokens
};
}
var CompiledPatternsCache = {};
function compilePattern(pattern) {
if (!(pattern in CompiledPatternsCache)) CompiledPatternsCache[pattern] = _compilePattern(pattern);
return CompiledPatternsCache[pattern];
}
/**
* Attempts to match a pattern on the given pathname. Patterns may use
* the following special characters:
*
* - :paramName Matches a URL segment up to the next /, ?, or #. The
* captured string is considered a "param"
* - () Wraps a segment of the URL that is optional
* - * Consumes (non-greedy) all characters up to the next
* character in the pattern, or to the end of the URL if
* there is none
* - ** Consumes (greedy) all characters up to the next character
* in the pattern, or to the end of the URL if there is none
*
* The return value is an object with the following properties:
*
* - remainingPathname
* - paramNames
* - paramValues
*/
function matchPattern(pattern, pathname) {
// Make leading slashes consistent between pattern and pathname.
if (pattern.charAt(0) !== '/') {
pattern = '/' + pattern;
}
if (pathname.charAt(0) !== '/') {
pathname = '/' + pathname;
}
var _compilePattern2 = compilePattern(pattern);
var regexpSource = _compilePattern2.regexpSource;
var paramNames = _compilePattern2.paramNames;
var tokens = _compilePattern2.tokens;
regexpSource += '/*'; // Capture path separators
// Special-case patterns like '*' for catch-all routes.
var captureRemaining = tokens[tokens.length - 1] !== '*';
if (captureRemaining) {
// This will match newlines in the remaining path.
regexpSource += '([\\s\\S]*?)';
}
var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'));
var remainingPathname = undefined,
paramValues = undefined;
if (match != null) {
if (captureRemaining) {
remainingPathname = match.pop();
var matchedPath = match[0].substr(0, match[0].length - remainingPathname.length);
// If we didn't match the entire pathname, then make sure that the match
// we did get ends at a path separator (potentially the one we added
// above at the beginning of the path, if the actual match was empty).
if (remainingPathname && matchedPath.charAt(matchedPath.length - 1) !== '/') {
return {
remainingPathname: null,
paramNames: paramNames,
paramValues: null
};
}
} else {
// If this matched at all, then the match was the entire pathname.
remainingPathname = '';
}
paramValues = match.slice(1).map(function (v) {
return v != null ? decodeURIComponent(v) : v;
});
} else {
remainingPathname = paramValues = null;
}
return {
remainingPathname: remainingPathname,
paramNames: paramNames,
paramValues: paramValues
};
}
function getParamNames(pattern) {
return compilePattern(pattern).paramNames;
}
function getParams(pattern, pathname) {
var _matchPattern = matchPattern(pattern, pathname);
var paramNames = _matchPattern.paramNames;
var paramValues = _matchPattern.paramValues;
if (paramValues != null) {
return paramNames.reduce(function (memo, paramName, index) {
memo[paramName] = paramValues[index];
return memo;
}, {});
}
return null;
}
/**
* Returns a version of the given pattern with params interpolated. Throws
* if there is a dynamic segment of the pattern for which there is no param.
*/
function formatPattern(pattern, params) {
params = params || {};
var _compilePattern3 = compilePattern(pattern);
var tokens = _compilePattern3.tokens;
var parenCount = 0,
pathname = '',
splatIndex = 0;
var token = undefined,
paramName = undefined,
paramValue = undefined;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
if (token === '*' || token === '**') {
paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat;
!(paramValue != null || parenCount > 0) ? false ? _invariant2['default'](false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : _invariant2['default'](false) : undefined;
if (paramValue != null) pathname += encodeURI(paramValue);
} else if (token === '(') {
parenCount += 1;
} else if (token === ')') {
parenCount -= 1;
} else if (token.charAt(0) === ':') {
paramName = token.substring(1);
paramValue = params[paramName];
!(paramValue != null || parenCount > 0) ? false ? _invariant2['default'](false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : _invariant2['default'](false) : undefined;
if (paramValue != null) pathname += encodeURIComponent(paramValue);
} else {
pathname += token;
}
}
return pathname.replace(/\/+/g, '/');
}
/***/ },
/* 7 */
/***/ function(module, exports) {
/**
* Indicates that navigation was caused by a call to history.push.
*/
'use strict';
exports.__esModule = true;
var PUSH = 'PUSH';
exports.PUSH = PUSH;
/**
* Indicates that navigation was caused by a call to history.replace.
*/
var REPLACE = 'REPLACE';
exports.REPLACE = REPLACE;
/**
* Indicates that navigation was caused by some other action such
* as using a browser's back/forward buttons and/or manually manipulating
* the URL in a browser's location bar. This is the default.
*
* See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate
* for more information.
*/
var POP = 'POP';
exports.POP = POP;
exports['default'] = {
PUSH: PUSH,
REPLACE: REPLACE,
POP: POP
};
/***/ },
/* 8 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.loopAsync = loopAsync;
exports.mapAsync = mapAsync;
function loopAsync(turns, work, callback) {
var currentTurn = 0,
isDone = false;
function done() {
isDone = true;
callback.apply(this, arguments);
}
function next() {
if (isDone) return;
if (currentTurn < turns) {
work.call(this, currentTurn++, next, done);
} else {
done.apply(this, arguments);
}
}
next();
}
function mapAsync(array, work, callback) {
var length = array.length;
var values = [];
if (length === 0) return callback(null, values);
var isDone = false,
doneCount = 0;
function done(index, error, value) {
if (isDone) return;
if (error) {
isDone = true;
callback(error);
} else {
values[index] = value;
isDone = ++doneCount === length;
if (isDone) callback(null, values);
}
}
array.forEach(function (item, index) {
work(item, index, function (error, value) {
done(index, error, value);
});
});
}
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _historyLibActions = __webpack_require__(7);
var _historyLibUseQueries = __webpack_require__(42);
var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries);
var _computeChangedRoutes2 = __webpack_require__(28);
var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2);
var _TransitionUtils = __webpack_require__(27);
var _isActive2 = __webpack_require__(31);
var _isActive3 = _interopRequireDefault(_isActive2);
var _getComponents = __webpack_require__(29);
var _getComponents2 = _interopRequireDefault(_getComponents);
var _matchRoutes = __webpack_require__(33);
var _matchRoutes2 = _interopRequireDefault(_matchRoutes);
function hasAnyProperties(object) {
for (var p in object) {
if (object.hasOwnProperty(p)) return true;
}return false;
}
/**
* Returns a new createHistory function that may be used to create
* history objects that know about routing.
*
* Enhances history objects with the following methods:
*
* - listen((error, nextState) => {})
* - listenBeforeLeavingRoute(route, (nextLocation) => {})
* - match(location, (error, redirectLocation, nextState) => {})
* - isActive(pathname, query, indexOnly=false)
*/
function useRoutes(createHistory) {
return function () {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var routes = options.routes;
var historyOptions = _objectWithoutProperties(options, ['routes']);
var history = _historyLibUseQueries2['default'](createHistory)(historyOptions);
var state = {};
function isActive(pathname, query) {
var indexOnly = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
return _isActive3['default'](pathname, query, indexOnly, state.location, state.routes, state.params);
}
function createLocationFromRedirectInfo(_ref) {
var pathname = _ref.pathname;
var query = _ref.query;
var state = _ref.state;
return history.createLocation(history.createPath(pathname, query), state, _historyLibActions.REPLACE);
}
var partialNextState = undefined;
function match(location, callback) {
if (partialNextState && partialNextState.location === location) {
// Continue from where we left off.
finishMatch(partialNextState, callback);
} else {
_matchRoutes2['default'](routes, location, function (error, nextState) {
if (error) {
callback(error);
} else if (nextState) {
finishMatch(_extends({}, nextState, { location: location }), callback);
} else {
callback();
}
});
}
}
function finishMatch(nextState, callback) {
var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState);
var leaveRoutes = _computeChangedRoutes.leaveRoutes;
var enterRoutes = _computeChangedRoutes.enterRoutes;
_TransitionUtils.runLeaveHooks(leaveRoutes);
_TransitionUtils.runEnterHooks(enterRoutes, nextState, function (error, redirectInfo) {
if (error) {
callback(error);
} else if (redirectInfo) {
callback(null, createLocationFromRedirectInfo(redirectInfo));
} else {
// TODO: Fetch components after state is updated.
_getComponents2['default'](nextState, function (error, components) {
if (error) {
callback(error);
} else {
// TODO: Make match a pure function and have some other API
// for "match and update state".
callback(null, null, state = _extends({}, nextState, { components: components }));
}
});
}
});
}
var RouteGuid = 1;
function getRouteID(route) {
return route.__id__ || (route.__id__ = RouteGuid++);
}
var RouteHooks = {};
function getRouteHooksForRoutes(routes) {
return routes.reduce(function (hooks, route) {
hooks.push.apply(hooks, RouteHooks[getRouteID(route)]);
return hooks;
}, []);
}
function transitionHook(location, callback) {
_matchRoutes2['default'](routes, location, function (error, nextState) {
if (nextState == null) {
// TODO: We didn't actually match anything, but hang
// onto error/nextState so we don't have to matchRoutes
// again in the listen callback.
callback();
return;
}
// Cache some state here so we don't have to
// matchRoutes() again in the listen callback.
partialNextState = _extends({}, nextState, { location: location });
var hooks = getRouteHooksForRoutes(_computeChangedRoutes3['default'](state, partialNextState).leaveRoutes);
var result = undefined;
for (var i = 0, len = hooks.length; result == null && i < len; ++i) {
// Passing the location arg here indicates to
// the user that this is a transition hook.
result = hooks[i](location);
}
callback(result);
});
}
function beforeUnloadHook() {
// Synchronously check to see if any route hooks want
// to prevent the current window/tab from closing.
if (state.routes) {
var hooks = getRouteHooksForRoutes(state.routes);
var message = undefined;
for (var i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) {
// Passing no args indicates to the user that this is a
// beforeunload hook. We don't know the next location.
message = hooks[i]();
}
return message;
}
}
var unlistenBefore = undefined,
unlistenBeforeUnload = undefined;
/**
* Registers the given hook function to run before leaving the given route.
*
* During a normal transition, the hook function receives the next location
* as its only argument and must return either a) a prompt message to show
* the user, to make sure they want to leave the page or b) false, to prevent
* the transition.
*
* During the beforeunload event (in browsers) the hook receives no arguments.
* In this case it must return a prompt message to prevent the transition.
*
* Returns a function that may be used to unbind the listener.
*/
function listenBeforeLeavingRoute(route, hook) {
// TODO: Warn if they register for a route that isn't currently
// active. They're probably doing something wrong, like re-creating
// route objects on every location change.
var routeID = getRouteID(route);
var hooks = RouteHooks[routeID];
if (hooks == null) {
var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks);
hooks = RouteHooks[routeID] = [hook];
if (thereWereNoRouteHooks) {
// setup transition & beforeunload hooks
unlistenBefore = history.listenBefore(transitionHook);
if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook);
}
} else if (hooks.indexOf(hook) === -1) {
hooks.push(hook);
}
return function () {
var hooks = RouteHooks[routeID];
if (hooks != null) {
var newHooks = hooks.filter(function (item) {
return item !== hook;
});
if (newHooks.length === 0) {
delete RouteHooks[routeID];
if (!hasAnyProperties(RouteHooks)) {
// teardown transition & beforeunload hooks
if (unlistenBefore) {
unlistenBefore();
unlistenBefore = null;
}
if (unlistenBeforeUnload) {
unlistenBeforeUnload();
unlistenBeforeUnload = null;
}
}
} else {
RouteHooks[routeID] = newHooks;
}
}
};
}
/**
* This is the API for stateful environments. As the location
* changes, we update state and call the listener. We can also
* gracefully handle errors and redirects.
*/
function listen(listener) {
// TODO: Only use a single history listener. Otherwise we'll
// end up with multiple concurrent calls to match.
return history.listen(function (location) {
if (state.location === location) {
listener(null, state);
} else {
match(location, function (error, redirectLocation, nextState) {
if (error) {
listener(error);
} else if (redirectLocation) {
history.transitionTo(redirectLocation);
} else if (nextState) {
listener(null, nextState);
} else {
false ? _warning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : undefined;
}
});
}
});
}
return _extends({}, history, {
isActive: isActive,
match: match,
listenBeforeLeavingRoute: listenBeforeLeavingRoute,
listen: listen
});
};
}
exports['default'] = useRoutes;
module.exports = exports['default'];
/***/ },
/* 10 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
exports.canUseDOM = canUseDOM;
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
function extractPath(string) {
var match = string.match(/^https?:\/\/[^\/]*/);
if (match == null) return string;
_warning2['default'](false, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', string);
return string.substring(match[0].length);
}
function parsePath(path) {
var pathname = extractPath(path);
var search = '';
var hash = '';
var hashIndex = pathname.indexOf('#');
if (hashIndex !== -1) {
hash = pathname.substring(hashIndex);
pathname = pathname.substring(0, hashIndex);
}
var searchIndex = pathname.indexOf('?');
if (searchIndex !== -1) {
search = pathname.substring(searchIndex);
pathname = pathname.substring(0, searchIndex);
}
if (pathname === '') pathname = '/';
return {
pathname: pathname,
search: search,
hash: hash
};
}
exports['default'] = parsePath;
module.exports = exports['default'];
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
function runTransitionHook(hook, location, callback) {
var result = hook(location, callback);
if (hook.length < 2) {
// Assume the hook runs synchronously and automatically
// call the callback with the return value.
callback(result);
} else {
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead');
}
}
exports['default'] = runTransitionHook;
module.exports = exports['default'];
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _React$PropTypes = _react2['default'].PropTypes;
var bool = _React$PropTypes.bool;
var object = _React$PropTypes.object;
var string = _React$PropTypes.string;
var func = _React$PropTypes.func;
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
function isEmptyObject(object) {
for (var p in object) {
if (object.hasOwnProperty(p)) return false;
}return true;
}
/**
* A <Link> is used to create an <a> element that links to a route.
* When that route is active, the link gets the value of its
* `activeClassName` prop
*
* For example, assuming you have the following route:
*
* <Route path="/posts/:postID" component={Post} />
*
* You could use the following component to link to that route:
*
* <Link to={`/posts/${post.id}`} />
*
* Links may pass along location state and/or query string parameters
* in the state/query props, respectively.
*
* <Link ... query={{ show: true }} state={{ the: 'state' }} />
*/
var Link = (function (_Component) {
_inherits(Link, _Component);
function Link() {
_classCallCheck(this, Link);
_Component.apply(this, arguments);
}
Link.prototype.handleClick = function handleClick(event) {
var allowTransition = true;
if (this.props.onClick) this.props.onClick(event);
if (isModifiedEvent(event) || !isLeftClickEvent(event)) return;
if (event.defaultPrevented === true) allowTransition = false;
// If target prop is set (e.g. to "_blank") let browser handle link.
if (this.props.target) {
if (!allowTransition) event.preventDefault();
return;
}
event.preventDefault();
if (allowTransition) {
var _props = this.props;
var state = _props.state;
var to = _props.to;
var query = _props.query;
var hash = _props.hash;
if (hash) to += hash;
this.context.history.pushState(state, to, query);
}
};
Link.prototype.render = function render() {
var _this = this;
var _props2 = this.props;
var to = _props2.to;
var query = _props2.query;
var hash = _props2.hash;
var state = _props2.state;
var activeClassName = _props2.activeClassName;
var activeStyle = _props2.activeStyle;
var onlyActiveOnIndex = _props2.onlyActiveOnIndex;
var props = _objectWithoutProperties(_props2, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']);
// Manually override onClick.
props.onClick = function (e) {
return _this.handleClick(e);
};
// Ignore if rendered outside the context of history, simplifies unit testing.
var history = this.context.history;
if (history) {
props.href = history.createHref(to, query);
if (hash) props.href += hash;
if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) {
if (history.isActive(to, query, onlyActiveOnIndex)) {
if (activeClassName) props.className += props.className === '' ? activeClassName : ' ' + activeClassName;
if (activeStyle) props.style = _extends({}, props.style, activeStyle);
}
}
}
return _react2['default'].createElement('a', props);
};
_createClass(Link, null, [{
key: 'contextTypes',
value: {
history: object
},
enumerable: true
}, {
key: 'propTypes',
value: {
to: string.isRequired,
query: object,
hash: string,
state: object,
activeStyle: object,
activeClassName: string,
onlyActiveOnIndex: bool.isRequired,
onClick: func
},
enumerable: true
}, {
key: 'defaultProps',
value: {
onlyActiveOnIndex: false,
className: '',
style: {}
},
enumerable: true
}]);
return Link;
})(_react.Component);
exports['default'] = Link;
module.exports = exports['default'];
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _RouteUtils = __webpack_require__(4);
var _PatternUtils = __webpack_require__(6);
var _PropTypes = __webpack_require__(5);
var _React$PropTypes = _react2['default'].PropTypes;
var string = _React$PropTypes.string;
var object = _React$PropTypes.object;
/**
* A <Redirect> is used to declare another URL path a client should
* be sent to when they request a given URL.
*
* Redirects are placed alongside routes in the route configuration
* and are traversed in the same manner.
*/
var Redirect = (function (_Component) {
_inherits(Redirect, _Component);
function Redirect() {
_classCallCheck(this, Redirect);
_Component.apply(this, arguments);
}
Redirect.createRouteFromReactElement = function createRouteFromReactElement(element) {
var route = _RouteUtils.createRouteFromReactElement(element);
if (route.from) route.path = route.from;
route.onEnter = function (nextState, replaceState) {
var location = nextState.location;
var params = nextState.params;
var pathname = undefined;
if (route.to.charAt(0) === '/') {
pathname = _PatternUtils.formatPattern(route.to, params);
} else if (!route.to) {
pathname = location.pathname;
} else {
var routeIndex = nextState.routes.indexOf(route);
var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1);
var pattern = parentPattern.replace(/\/*$/, '/') + route.to;
pathname = _PatternUtils.formatPattern(pattern, params);
}
replaceState(route.state || location.state, pathname, route.query || location.query);
};
return route;
};
Redirect.getRoutePattern = function getRoutePattern(routes, routeIndex) {
var parentPattern = '';
for (var i = routeIndex; i >= 0; i--) {
var route = routes[i];
var pattern = route.path || '';
parentPattern = pattern.replace(/\/*$/, '/') + parentPattern;
if (pattern.indexOf('/') === 0) break;
}
return '/' + parentPattern;
};
/* istanbul ignore next: sanity check */
Redirect.prototype.render = function render() {
true ? false ? _invariant2['default'](false, '<Redirect> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
};
_createClass(Redirect, null, [{
key: 'propTypes',
value: {
path: string,
from: string, // Alias for path
to: string.isRequired,
query: object,
state: object,
onEnter: _PropTypes.falsy,
children: _PropTypes.falsy
},
enumerable: true
}]);
return Redirect;
})(_react.Component);
exports['default'] = Redirect;
module.exports = exports['default'];
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _RouteUtils = __webpack_require__(4);
var _getRouteParams = __webpack_require__(30);
var _getRouteParams2 = _interopRequireDefault(_getRouteParams);
var _React$PropTypes = _react2['default'].PropTypes;
var array = _React$PropTypes.array;
var func = _React$PropTypes.func;
var object = _React$PropTypes.object;
/**
* A <RoutingContext> renders the component tree for a given router state
* and sets the history object and the current location in context.
*/
var RoutingContext = (function (_Component) {
_inherits(RoutingContext, _Component);
function RoutingContext() {
_classCallCheck(this, RoutingContext);
_Component.apply(this, arguments);
}
RoutingContext.prototype.getChildContext = function getChildContext() {
var _props = this.props;
var history = _props.history;
var location = _props.location;
return { history: history, location: location };
};
RoutingContext.prototype.createElement = function createElement(component, props) {
return component == null ? null : this.props.createElement(component, props);
};
RoutingContext.prototype.render = function render() {
var _this = this;
var _props2 = this.props;
var history = _props2.history;
var location = _props2.location;
var routes = _props2.routes;
var params = _props2.params;
var components = _props2.components;
var element = null;
if (components) {
element = components.reduceRight(function (element, components, index) {
if (components == null) return element; // Don't create new children; use the grandchildren.
var route = routes[index];
var routeParams = _getRouteParams2['default'](route, params);
var props = {
history: history,
location: location,
params: params,
route: route,
routeParams: routeParams,
routes: routes
};
if (_RouteUtils.isReactChildren(element)) {
props.children = element;
} else if (element) {
for (var prop in element) {
if (element.hasOwnProperty(prop)) props[prop] = element[prop];
}
}
if (typeof components === 'object') {
var elements = {};
for (var key in components) {
if (components.hasOwnProperty(key)) elements[key] = _this.createElement(components[key], props);
}return elements;
}
return _this.createElement(components, props);
}, element);
}
!(element === null || element === false || _react2['default'].isValidElement(element)) ? false ? _invariant2['default'](false, 'The root route must render a single element') : _invariant2['default'](false) : undefined;
return element;
};
_createClass(RoutingContext, null, [{
key: 'propTypes',
value: {
history: object.isRequired,
createElement: func.isRequired,
location: object.isRequired,
routes: array.isRequired,
params: object.isRequired,
components: array.isRequired
},
enumerable: true
}, {
key: 'defaultProps',
value: {
createElement: _react2['default'].createElement
},
enumerable: true
}, {
key: 'childContextTypes',
value: {
history: object.isRequired,
location: object.isRequired
},
enumerable: true
}]);
return RoutingContext;
})(_react.Component);
exports['default'] = RoutingContext;
module.exports = exports['default'];
/***/ },
/* 16 */
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports.addEventListener = addEventListener;
exports.removeEventListener = removeEventListener;
exports.getHashPath = getHashPath;
exports.replaceHashPath = replaceHashPath;
exports.getWindowPath = getWindowPath;
exports.go = go;
exports.getUserConfirmation = getUserConfirmation;
exports.supportsHistory = supportsHistory;
exports.supportsGoWithoutReloadUsingHash = supportsGoWithoutReloadUsingHash;
function addEventListener(node, event, listener) {
if (node.addEventListener) {
node.addEventListener(event, listener, false);
} else {
node.attachEvent('on' + event, listener);
}
}
function removeEventListener(node, event, listener) {
if (node.removeEventListener) {
node.removeEventListener(event, listener, false);
} else {
node.detachEvent('on' + event, listener);
}
}
function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
return window.location.href.split('#')[1] || '';
}
function replaceHashPath(path) {
window.location.replace(window.location.pathname + window.location.search + '#' + path);
}
function getWindowPath() {
return window.location.pathname + window.location.search + window.location.hash;
}
function go(n) {
if (n) window.history.go(n);
}
function getUserConfirmation(message, callback) {
callback(window.confirm(message));
}
/**
* Returns true if the HTML5 history API is supported. Taken from modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586
*/
function supportsHistory() {
var ua = navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {
return false;
}
return window.history && 'pushState' in window.history;
}
/**
* Returns false if using go(n) with hash history causes a full page reload.
*/
function supportsGoWithoutReloadUsingHash() {
var ua = navigator.userAgent;
return ua.indexOf('Firefox') === -1;
}
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _deepEqual = __webpack_require__(43);
var _deepEqual2 = _interopRequireDefault(_deepEqual);
var _AsyncUtils = __webpack_require__(34);
var _Actions = __webpack_require__(7);
var _createLocation2 = __webpack_require__(38);
var _createLocation3 = _interopRequireDefault(_createLocation2);
var _runTransitionHook = __webpack_require__(12);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _deprecate = __webpack_require__(40);
var _deprecate2 = _interopRequireDefault(_deprecate);
function createRandomKey(length) {
return Math.random().toString(36).substr(2, length);
}
function locationsAreEqual(a, b) {
return a.pathname === b.pathname && a.search === b.search &&
//a.action === b.action && // Different action !== location change.
a.key === b.key && _deepEqual2['default'](a.state, b.state);
}
var DefaultKeyLength = 6;
function createHistory() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var getCurrentLocation = options.getCurrentLocation;
var finishTransition = options.finishTransition;
var saveState = options.saveState;
var go = options.go;
var keyLength = options.keyLength;
var getUserConfirmation = options.getUserConfirmation;
if (typeof keyLength !== 'number') keyLength = DefaultKeyLength;
var transitionHooks = [];
function listenBefore(hook) {
transitionHooks.push(hook);
return function () {
transitionHooks = transitionHooks.filter(function (item) {
return item !== hook;
});
};
}
var allKeys = [];
var changeListeners = [];
var location = undefined;
function getCurrent() {
if (pendingLocation && pendingLocation.action === _Actions.POP) {
return allKeys.indexOf(pendingLocation.key);
} else if (location) {
return allKeys.indexOf(location.key);
} else {
return -1;
}
}
function updateLocation(newLocation) {
var current = getCurrent();
location = newLocation;
if (location.action === _Actions.PUSH) {
allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]);
} else if (location.action === _Actions.REPLACE) {
allKeys[current] = location.key;
}
changeListeners.forEach(function (listener) {
listener(location);
});
}
function listen(listener) {
changeListeners.push(listener);
if (location) {
listener(location);
} else {
var _location = getCurrentLocation();
allKeys = [_location.key];
updateLocation(_location);
}
return function () {
changeListeners = changeListeners.filter(function (item) {
return item !== listener;
});
};
}
function confirmTransitionTo(location, callback) {
_AsyncUtils.loopAsync(transitionHooks.length, function (index, next, done) {
_runTransitionHook2['default'](transitionHooks[index], location, function (result) {
if (result != null) {
done(result);
} else {
next();
}
});
}, function (message) {
if (getUserConfirmation && typeof message === 'string') {
getUserConfirmation(message, function (ok) {
callback(ok !== false);
});
} else {
callback(message !== false);
}
});
}
var pendingLocation = undefined;
function transitionTo(nextLocation) {
if (location && locationsAreEqual(location, nextLocation)) return; // Nothing to do.
pendingLocation = nextLocation;
confirmTransitionTo(nextLocation, function (ok) {
if (pendingLocation !== nextLocation) return; // Transition was interrupted.
if (ok) {
if (finishTransition(nextLocation) !== false) updateLocation(nextLocation);
} else if (location && nextLocation.action === _Actions.POP) {
var prevIndex = allKeys.indexOf(location.key);
var nextIndex = allKeys.indexOf(nextLocation.key);
if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL.
}
});
}
function pushState(state, path) {
transitionTo(createLocation(path, state, _Actions.PUSH, createKey()));
}
function replaceState(state, path) {
transitionTo(createLocation(path, state, _Actions.REPLACE, createKey()));
}
function goBack() {
go(-1);
}
function goForward() {
go(1);
}
function createKey() {
return createRandomKey(keyLength);
}
function createPath(path) {
if (path == null || typeof path === 'string') return path;
var pathname = path.pathname;
var search = path.search;
var hash = path.hash;
var result = pathname;
if (search) result += search;
if (hash) result += hash;
return result;
}
function createHref(path) {
return createPath(path);
}
function createLocation(path, state, action) {
var key = arguments.length <= 3 || arguments[3] === undefined ? createKey() : arguments[3];
return _createLocation3['default'](path, state, action, key);
}
// deprecated
function setState(state) {
if (location) {
updateLocationState(location, state);
updateLocation(location);
} else {
updateLocationState(getCurrentLocation(), state);
}
}
function updateLocationState(location, state) {
location.state = _extends({}, location.state, state);
saveState(location.key, location.state);
}
// deprecated
function registerTransitionHook(hook) {
if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook);
}
// deprecated
function unregisterTransitionHook(hook) {
transitionHooks = transitionHooks.filter(function (item) {
return item !== hook;
});
}
return {
listenBefore: listenBefore,
listen: listen,
transitionTo: transitionTo,
pushState: pushState,
replaceState: replaceState,
go: go,
goBack: goBack,
goForward: goForward,
createKey: createKey,
createPath: createPath,
createHref: createHref,
createLocation: createLocation,
setState: _deprecate2['default'](setState, 'setState is deprecated; use location.key to save state instead'),
registerTransitionHook: _deprecate2['default'](registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'),
unregisterTransitionHook: _deprecate2['default'](unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead')
};
}
exports['default'] = createHistory;
module.exports = exports['default'];
/***/ },
/* 18 */
/***/ function(module, exports) {
// Load modules
// Declare internals
var internals = {};
internals.hexTable = new Array(256);
for (var h = 0; h < 256; ++h) {
internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
}
exports.arrayToObject = function (source, options) {
var obj = options.plainObjects ? Object.create(null) : {};
for (var i = 0, il = source.length; i < il; ++i) {
if (typeof source[i] !== 'undefined') {
obj[i] = source[i];
}
}
return obj;
};
exports.merge = function (target, source, options) {
if (!source) {
return target;
}
if (typeof source !== 'object') {
if (Array.isArray(target)) {
target.push(source);
}
else if (typeof target === 'object') {
target[source] = true;
}
else {
target = [target, source];
}
return target;
}
if (typeof target !== 'object') {
target = [target].concat(source);
return target;
}
if (Array.isArray(target) &&
!Array.isArray(source)) {
target = exports.arrayToObject(target, options);
}
var keys = Object.keys(source);
for (var k = 0, kl = keys.length; k < kl; ++k) {
var key = keys[k];
var value = source[key];
if (!Object.prototype.hasOwnProperty.call(target, key)) {
target[key] = value;
}
else {
target[key] = exports.merge(target[key], value, options);
}
}
return target;
};
exports.decode = function (str) {
try {
return decodeURIComponent(str.replace(/\+/g, ' '));
} catch (e) {
return str;
}
};
exports.encode = function (str) {
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
// It has been adapted here for stricter adherence to RFC 3986
if (str.length === 0) {
return str;
}
if (typeof str !== 'string') {
str = '' + str;
}
var out = '';
for (var i = 0, il = str.length; i < il; ++i) {
var c = str.charCodeAt(i);
if (c === 0x2D || // -
c === 0x2E || // .
c === 0x5F || // _
c === 0x7E || // ~
(c >= 0x30 && c <= 0x39) || // 0-9
(c >= 0x41 && c <= 0x5A) || // a-z
(c >= 0x61 && c <= 0x7A)) { // A-Z
out += str[i];
continue;
}
if (c < 0x80) {
out += internals.hexTable[c];
continue;
}
if (c < 0x800) {
out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
continue;
}
if (c < 0xD800 || c >= 0xE000) {
out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
continue;
}
++i;
c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
}
return out;
};
exports.compact = function (obj, refs) {
if (typeof obj !== 'object' ||
obj === null) {
return obj;
}
refs = refs || [];
var lookup = refs.indexOf(obj);
if (lookup !== -1) {
return refs[lookup];
}
refs.push(obj);
if (Array.isArray(obj)) {
var compacted = [];
for (var i = 0, il = obj.length; i < il; ++i) {
if (typeof obj[i] !== 'undefined') {
compacted.push(obj[i]);
}
}
return compacted;
}
var keys = Object.keys(obj);
for (i = 0, il = keys.length; i < il; ++i) {
var key = keys[i];
obj[key] = exports.compact(obj[key], refs);
}
return obj;
};
exports.isRegExp = function (obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
};
exports.isBuffer = function (obj) {
if (obj === null ||
typeof obj === 'undefined') {
return false;
}
return !!(obj.constructor &&
obj.constructor.isBuffer &&
obj.constructor.isBuffer(obj));
};
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PropTypes = __webpack_require__(5);
/**
* A mixin that adds the "history" instance variable to components.
*/
var History = {
contextTypes: {
history: _PropTypes.history
},
componentWillMount: function componentWillMount() {
this.history = this.context.history;
}
};
exports['default'] = History;
module.exports = exports['default'];
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _Link = __webpack_require__(13);
var _Link2 = _interopRequireDefault(_Link);
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
var IndexLink = (function (_Component) {
_inherits(IndexLink, _Component);
function IndexLink() {
_classCallCheck(this, IndexLink);
_Component.apply(this, arguments);
}
IndexLink.prototype.render = function render() {
return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true }));
};
return IndexLink;
})(_react.Component);
exports['default'] = IndexLink;
module.exports = exports['default'];
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _Redirect = __webpack_require__(14);
var _Redirect2 = _interopRequireDefault(_Redirect);
var _PropTypes = __webpack_require__(5);
var _React$PropTypes = _react2['default'].PropTypes;
var string = _React$PropTypes.string;
var object = _React$PropTypes.object;
/**
* An <IndexRedirect> is used to redirect from an indexRoute.
*/
var IndexRedirect = (function (_Component) {
_inherits(IndexRedirect, _Component);
function IndexRedirect() {
_classCallCheck(this, IndexRedirect);
_Component.apply(this, arguments);
}
IndexRedirect.createRouteFromReactElement = function createRouteFromReactElement(element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = _Redirect2['default'].createRouteFromReactElement(element);
} else {
false ? _warning2['default'](false, 'An <IndexRedirect> does not make sense at the root of your route config') : undefined;
}
};
/* istanbul ignore next: sanity check */
IndexRedirect.prototype.render = function render() {
true ? false ? _invariant2['default'](false, '<IndexRedirect> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
};
_createClass(IndexRedirect, null, [{
key: 'propTypes',
value: {
to: string.isRequired,
query: object,
state: object,
onEnter: _PropTypes.falsy,
children: _PropTypes.falsy
},
enumerable: true
}]);
return IndexRedirect;
})(_react.Component);
exports['default'] = IndexRedirect;
module.exports = exports['default'];
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _RouteUtils = __webpack_require__(4);
var _PropTypes = __webpack_require__(5);
var _React$PropTypes = _react2['default'].PropTypes;
var bool = _React$PropTypes.bool;
var func = _React$PropTypes.func;
/**
* An <IndexRoute> is used to specify its parent's <Route indexRoute> in
* a JSX route config.
*/
var IndexRoute = (function (_Component) {
_inherits(IndexRoute, _Component);
function IndexRoute() {
_classCallCheck(this, IndexRoute);
_Component.apply(this, arguments);
}
IndexRoute.createRouteFromReactElement = function createRouteFromReactElement(element, parentRoute) {
/* istanbul ignore else: sanity check */
if (parentRoute) {
parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element);
} else {
false ? _warning2['default'](false, 'An <IndexRoute> does not make sense at the root of your route config') : undefined;
}
};
/* istanbul ignore next: sanity check */
IndexRoute.prototype.render = function render() {
true ? false ? _invariant2['default'](false, '<IndexRoute> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
};
_createClass(IndexRoute, null, [{
key: 'propTypes',
value: {
path: _PropTypes.falsy,
ignoreScrollBehavior: bool,
component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
enumerable: true
}]);
return IndexRoute;
})(_react.Component);
exports['default'] = IndexRoute;
module.exports = exports['default'];
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var object = _react2['default'].PropTypes.object;
/**
* The Lifecycle mixin adds the routerWillLeave lifecycle method to a
* component that may be used to cancel a transition or prompt the user
* for confirmation.
*
* On standard transitions, routerWillLeave receives a single argument: the
* location we're transitioning to. To cancel the transition, return false.
* To prompt the user for confirmation, return a prompt message (string).
*
* During the beforeunload event (assuming you're using the useBeforeUnload
* history enhancer), routerWillLeave does not receive a location object
* because it isn't possible for us to know the location we're transitioning
* to. In this case routerWillLeave must return a prompt message to prevent
* the user from closing the window/tab.
*/
var Lifecycle = {
contextTypes: {
history: object.isRequired,
// Nested children receive the route as context, either
// set by the route component using the RouteContext mixin
// or by some other ancestor.
route: object
},
propTypes: {
// Route components receive the route object as a prop.
route: object
},
componentDidMount: function componentDidMount() {
!this.routerWillLeave ? false ? _invariant2['default'](false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : _invariant2['default'](false) : undefined;
var route = this.props.route || this.context.route;
!route ? false ? _invariant2['default'](false, 'The Lifecycle mixin must be used on either a) a <Route component> or ' + 'b) a descendant of a <Route component> that uses the RouteContext mixin') : _invariant2['default'](false) : undefined;
this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave);
},
componentWillUnmount: function componentWillUnmount() {
if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute();
}
};
exports['default'] = Lifecycle;
module.exports = exports['default'];
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _RouteUtils = __webpack_require__(4);
var _PropTypes = __webpack_require__(5);
var _React$PropTypes = _react2['default'].PropTypes;
var string = _React$PropTypes.string;
var bool = _React$PropTypes.bool;
var func = _React$PropTypes.func;
/**
* A <Route> is used to declare which components are rendered to the
* page when the URL matches a given pattern.
*
* Routes are arranged in a nested tree structure. When a new URL is
* requested, the tree is searched depth-first to find a route whose
* path matches the URL. When one is found, all routes in the tree
* that lead to it are considered "active" and their components are
* rendered into the DOM, nested in the same order as in the tree.
*/
var Route = (function (_Component) {
_inherits(Route, _Component);
function Route() {
_classCallCheck(this, Route);
_Component.apply(this, arguments);
}
/* istanbul ignore next: sanity check */
Route.prototype.render = function render() {
true ? false ? _invariant2['default'](false, '<Route> elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined;
};
_createClass(Route, null, [{
key: 'createRouteFromReactElement',
value: _RouteUtils.createRouteFromReactElement,
enumerable: true
}, {
key: 'propTypes',
value: {
path: string,
ignoreScrollBehavior: bool,
component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
enumerable: true
}]);
return Route;
})(_react.Component);
exports['default'] = Route;
module.exports = exports['default'];
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var object = _react2['default'].PropTypes.object;
/**
* The RouteContext mixin provides a convenient way for route
* components to set the route in context. This is needed for
* routes that render elements that want to use the Lifecycle
* mixin to prevent transitions.
*/
var RouteContext = {
propTypes: {
route: object.isRequired
},
childContextTypes: {
route: object.isRequired
},
getChildContext: function getChildContext() {
return {
route: this.props.route
};
}
};
exports['default'] = RouteContext;
module.exports = exports['default'];
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _react = __webpack_require__(1);
var _react2 = _interopRequireDefault(_react);
var _historyLibCreateHashHistory = __webpack_require__(37);
var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory);
var _RouteUtils = __webpack_require__(4);
var _RoutingContext = __webpack_require__(15);
var _RoutingContext2 = _interopRequireDefault(_RoutingContext);
var _useRoutes = __webpack_require__(9);
var _useRoutes2 = _interopRequireDefault(_useRoutes);
var _PropTypes = __webpack_require__(5);
var _React$PropTypes = _react2['default'].PropTypes;
var func = _React$PropTypes.func;
var object = _React$PropTypes.object;
/**
* A <Router> is a high-level API for automatically setting up
* a router that renders a <RoutingContext> with all the props
* it needs each time the URL changes.
*/
var Router = (function (_Component) {
_inherits(Router, _Component);
_createClass(Router, null, [{
key: 'propTypes',
value: {
history: object,
children: _PropTypes.routes,
routes: _PropTypes.routes, // alias for children
RoutingContext: func.isRequired,
createElement: func,
onError: func,
onUpdate: func,
parseQueryString: func,
stringifyQuery: func
},
enumerable: true
}, {
key: 'defaultProps',
value: {
RoutingContext: _RoutingContext2['default']
},
enumerable: true
}]);
function Router(props, context) {
_classCallCheck(this, Router);
_Component.call(this, props, context);
this.state = {
location: null,
routes: null,
params: null,
components: null
};
}
Router.prototype.handleError = function handleError(error) {
if (this.props.onError) {
this.props.onError.call(this, error);
} else {
// Throw errors by default so we don't silently swallow them!
throw error; // This error probably occurred in getChildRoutes or getComponents.
}
};
Router.prototype.componentWillMount = function componentWillMount() {
var _this = this;
var _props = this.props;
var history = _props.history;
var children = _props.children;
var routes = _props.routes;
var parseQueryString = _props.parseQueryString;
var stringifyQuery = _props.stringifyQuery;
var createHistory = history ? function () {
return history;
} : _historyLibCreateHashHistory2['default'];
this.history = _useRoutes2['default'](createHistory)({
routes: _RouteUtils.createRoutes(routes || children),
parseQueryString: parseQueryString,
stringifyQuery: stringifyQuery
});
this._unlisten = this.history.listen(function (error, state) {
if (error) {
_this.handleError(error);
} else {
_this.setState(state, _this.props.onUpdate);
}
});
};
/* istanbul ignore next: sanity check */
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
false ? _warning2['default'](nextProps.history === this.props.history, 'You cannot change <Router history>; it will be ignored') : undefined;
};
Router.prototype.componentWillUnmount = function componentWillUnmount() {
if (this._unlisten) this._unlisten();
};
Router.prototype.render = function render() {
var _state = this.state;
var location = _state.location;
var routes = _state.routes;
var params = _state.params;
var components = _state.components;
var _props2 = this.props;
var RoutingContext = _props2.RoutingContext;
var createElement = _props2.createElement;
var props = _objectWithoutProperties(_props2, ['RoutingContext', 'createElement']);
if (location == null) return null; // Async match
// Only forward non-Router-specific props to routing context, as those are
// the only ones that might be custom routing context props.
Object.keys(Router.propTypes).forEach(function (propType) {
return delete props[propType];
});
return _react2['default'].createElement(RoutingContext, _extends({}, props, {
history: this.history,
createElement: createElement,
location: location,
routes: routes,
params: params,
components: components
}));
};
return Router;
})(_react.Component);
exports['default'] = Router;
module.exports = exports['default'];
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.runEnterHooks = runEnterHooks;
exports.runLeaveHooks = runLeaveHooks;
var _AsyncUtils = __webpack_require__(8);
function createEnterHook(hook, route) {
return function (a, b, callback) {
hook.apply(route, arguments);
if (hook.length < 3) {
// Assume hook executes synchronously and
// automatically call the callback.
callback();
}
};
}
function getEnterHooks(routes) {
return routes.reduce(function (hooks, route) {
if (route.onEnter) hooks.push(createEnterHook(route.onEnter, route));
return hooks;
}, []);
}
/**
* Runs all onEnter hooks in the given array of routes in order
* with onEnter(nextState, replaceState, callback) and calls
* callback(error, redirectInfo) when finished. The first hook
* to use replaceState short-circuits the loop.
*
* If a hook needs to run asynchronously, it may use the callback
* function. However, doing so will cause the transition to pause,
* which could lead to a non-responsive UI if the hook is slow.
*/
function runEnterHooks(routes, nextState, callback) {
var hooks = getEnterHooks(routes);
if (!hooks.length) {
callback();
return;
}
var redirectInfo = undefined;
function replaceState(state, pathname, query) {
redirectInfo = { pathname: pathname, query: query, state: state };
}
_AsyncUtils.loopAsync(hooks.length, function (index, next, done) {
hooks[index](nextState, replaceState, function (error) {
if (error || redirectInfo) {
done(error, redirectInfo); // No need to continue.
} else {
next();
}
});
}, callback);
}
/**
* Runs all onLeave hooks in the given array of routes in order.
*/
function runLeaveHooks(routes) {
for (var i = 0, len = routes.length; i < len; ++i) {
if (routes[i].onLeave) routes[i].onLeave.call(routes[i]);
}
}
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PatternUtils = __webpack_require__(6);
function routeParamsChanged(route, prevState, nextState) {
if (!route.path) return false;
var paramNames = _PatternUtils.getParamNames(route.path);
return paramNames.some(function (paramName) {
return prevState.params[paramName] !== nextState.params[paramName];
});
}
/**
* Returns an object of { leaveRoutes, enterRoutes } determined by
* the change from prevState to nextState. We leave routes if either
* 1) they are not in the next state or 2) they are in the next state
* but their params have changed (i.e. /users/123 => /users/456).
*
* leaveRoutes are ordered starting at the leaf route of the tree
* we're leaving up to the common parent route. enterRoutes are ordered
* from the top of the tree we're entering down to the leaf route.
*/
function computeChangedRoutes(prevState, nextState) {
var prevRoutes = prevState && prevState.routes;
var nextRoutes = nextState.routes;
var leaveRoutes = undefined,
enterRoutes = undefined;
if (prevRoutes) {
leaveRoutes = prevRoutes.filter(function (route) {
return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState);
});
// onLeave hooks start at the leaf route.
leaveRoutes.reverse();
enterRoutes = nextRoutes.filter(function (route) {
return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1;
});
} else {
leaveRoutes = [];
enterRoutes = nextRoutes;
}
return {
leaveRoutes: leaveRoutes,
enterRoutes: enterRoutes
};
}
exports['default'] = computeChangedRoutes;
module.exports = exports['default'];
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _AsyncUtils = __webpack_require__(8);
function getComponentsForRoute(location, route, callback) {
if (route.component || route.components) {
callback(null, route.component || route.components);
} else if (route.getComponent) {
route.getComponent(location, callback);
} else if (route.getComponents) {
route.getComponents(location, callback);
} else {
callback();
}
}
/**
* Asynchronously fetches all components needed for the given router
* state and calls callback(error, components) when finished.
*
* Note: This operation may finish synchronously if no routes have an
* asynchronous getComponents method.
*/
function getComponents(nextState, callback) {
_AsyncUtils.mapAsync(nextState.routes, function (route, index, callback) {
getComponentsForRoute(nextState.location, route, callback);
}, callback);
}
exports['default'] = getComponents;
module.exports = exports['default'];
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PatternUtils = __webpack_require__(6);
/**
* Extracts an object of params the given route cares about from
* the given params object.
*/
function getRouteParams(route, params) {
var routeParams = {};
if (!route.path) return routeParams;
var paramNames = _PatternUtils.getParamNames(route.path);
for (var p in params) {
if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];
}return routeParams;
}
exports['default'] = getRouteParams;
module.exports = exports['default'];
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _PatternUtils = __webpack_require__(6);
function deepEqual(a, b) {
if (a == b) return true;
if (a == null || b == null) return false;
if (Array.isArray(a)) {
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return deepEqual(item, b[index]);
});
}
if (typeof a === 'object') {
for (var p in a) {
if (!a.hasOwnProperty(p)) {
continue;
}
if (a[p] === undefined) {
if (b[p] !== undefined) {
return false;
}
} else if (!b.hasOwnProperty(p)) {
return false;
} else if (!deepEqual(a[p], b[p])) {
return false;
}
}
return true;
}
return String(a) === String(b);
}
function paramsAreActive(paramNames, paramValues, activeParams) {
// FIXME: This doesn't work on repeated params in activeParams.
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(activeParams[paramName]);
});
}
function getMatchingRouteIndex(pathname, activeRoutes, activeParams) {
var remainingPathname = pathname,
paramNames = [],
paramValues = [];
for (var i = 0, len = activeRoutes.length; i < len; ++i) {
var route = activeRoutes[i];
var pattern = route.path || '';
if (pattern.charAt(0) === '/') {
remainingPathname = pathname;
paramNames = [];
paramValues = [];
}
if (remainingPathname !== null) {
var matched = _PatternUtils.matchPattern(pattern, remainingPathname);
remainingPathname = matched.remainingPathname;
paramNames = [].concat(paramNames, matched.paramNames);
paramValues = [].concat(paramValues, matched.paramValues);
}
if (remainingPathname === '' && route.path && paramsAreActive(paramNames, paramValues, activeParams)) return i;
}
return null;
}
/**
* Returns true if the given pathname matches the active routes
* and params.
*/
function routeIsActive(pathname, routes, params, indexOnly) {
var i = getMatchingRouteIndex(pathname, routes, params);
if (i === null) {
// No match.
return false;
} else if (!indexOnly) {
// Any match is good enough.
return true;
}
// If any remaining routes past the match index have paths, then we can't
// be on the index route.
return routes.slice(i + 1).every(function (route) {
return !route.path;
});
}
/**
* Returns true if all key/value pairs in the given query are
* currently active.
*/
function queryIsActive(query, activeQuery) {
if (activeQuery == null) return query == null;
if (query == null) return true;
return deepEqual(query, activeQuery);
}
/**
* Returns true if a <Link> to the given pathname/query combination is
* currently active.
*/
function isActive(pathname, query, indexOnly, location, routes, params) {
if (location == null) return false;
if (!routeIsActive(pathname, routes, params, indexOnly)) return false;
return queryIsActive(query, location.query);
}
exports['default'] = isActive;
module.exports = exports['default'];
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _historyLibCreateMemoryHistory = __webpack_require__(39);
var _historyLibCreateMemoryHistory2 = _interopRequireDefault(_historyLibCreateMemoryHistory);
var _historyLibUseBasename = __webpack_require__(41);
var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename);
var _RouteUtils = __webpack_require__(4);
var _useRoutes = __webpack_require__(9);
var _useRoutes2 = _interopRequireDefault(_useRoutes);
var createHistory = _useRoutes2['default'](_historyLibUseBasename2['default'](_historyLibCreateMemoryHistory2['default']));
/**
* A high-level API to be used for server-side rendering.
*
* This function matches a location to a set of routes and calls
* callback(error, redirectLocation, renderProps) when finished.
*
* Note: You probably don't want to use this in a browser. Use
* the history.listen API instead.
*/
function match(_ref, callback) {
var routes = _ref.routes;
var location = _ref.location;
var parseQueryString = _ref.parseQueryString;
var stringifyQuery = _ref.stringifyQuery;
var basename = _ref.basename;
!location ? false ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;
var history = createHistory({
routes: _RouteUtils.createRoutes(routes),
parseQueryString: parseQueryString,
stringifyQuery: stringifyQuery,
basename: basename
});
// Allow match({ location: '/the/path', ... })
if (typeof location === 'string') location = history.createLocation(location);
history.match(location, function (error, redirectLocation, nextState) {
callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));
});
}
exports['default'] = match;
module.exports = exports['default'];
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _AsyncUtils = __webpack_require__(8);
var _PatternUtils = __webpack_require__(6);
var _RouteUtils = __webpack_require__(4);
function getChildRoutes(route, location, callback) {
if (route.childRoutes) {
callback(null, route.childRoutes);
} else if (route.getChildRoutes) {
route.getChildRoutes(location, function (error, childRoutes) {
callback(error, !error && _RouteUtils.createRoutes(childRoutes));
});
} else {
callback();
}
}
function getIndexRoute(route, location, callback) {
if (route.indexRoute) {
callback(null, route.indexRoute);
} else if (route.getIndexRoute) {
route.getIndexRoute(location, function (error, indexRoute) {
callback(error, !error && _RouteUtils.createRoutes(indexRoute)[0]);
});
} else if (route.childRoutes) {
(function () {
var pathless = route.childRoutes.filter(function (obj) {
return !obj.hasOwnProperty('path');
});
_AsyncUtils.loopAsync(pathless.length, function (index, next, done) {
getIndexRoute(pathless[index], location, function (error, indexRoute) {
if (error || indexRoute) {
var routes = [pathless[index]].concat(Array.isArray(indexRoute) ? indexRoute : [indexRoute]);
done(error, routes);
} else {
next();
}
});
}, function (err, routes) {
callback(null, routes);
});
})();
} else {
callback();
}
}
function assignParams(params, paramNames, paramValues) {
return paramNames.reduce(function (params, paramName, index) {
var paramValue = paramValues && paramValues[index];
if (Array.isArray(params[paramName])) {
params[paramName].push(paramValue);
} else if (paramName in params) {
params[paramName] = [params[paramName], paramValue];
} else {
params[paramName] = paramValue;
}
return params;
}, params);
}
function createParams(paramNames, paramValues) {
return assignParams({}, paramNames, paramValues);
}
function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) {
var pattern = route.path || '';
if (pattern.charAt(0) === '/') {
remainingPathname = location.pathname;
paramNames = [];
paramValues = [];
}
if (remainingPathname !== null) {
var matched = _PatternUtils.matchPattern(pattern, remainingPathname);
remainingPathname = matched.remainingPathname;
paramNames = [].concat(paramNames, matched.paramNames);
paramValues = [].concat(paramValues, matched.paramValues);
if (remainingPathname === '' && route.path) {
var _ret2 = (function () {
var match = {
routes: [route],
params: createParams(paramNames, paramValues)
};
getIndexRoute(route, location, function (error, indexRoute) {
if (error) {
callback(error);
} else {
if (Array.isArray(indexRoute)) {
var _match$routes;
false ? _warning2['default'](indexRoute.every(function (route) {
return !route.path;
}), 'Index routes should not have paths') : undefined;
(_match$routes = match.routes).push.apply(_match$routes, indexRoute);
} else if (indexRoute) {
false ? _warning2['default'](!indexRoute.path, 'Index routes should not have paths') : undefined;
match.routes.push(indexRoute);
}
callback(null, match);
}
});
return {
v: undefined
};
})();
if (typeof _ret2 === 'object') return _ret2.v;
}
}
if (remainingPathname != null || route.childRoutes) {
// Either a) this route matched at least some of the path or b)
// we don't have to load this route's children asynchronously. In
// either case continue checking for matches in the subtree.
getChildRoutes(route, location, function (error, childRoutes) {
if (error) {
callback(error);
} else if (childRoutes) {
// Check the child routes to see if any of them match.
matchRoutes(childRoutes, location, function (error, match) {
if (error) {
callback(error);
} else if (match) {
// A child route matched! Augment the match and pass it up the stack.
match.routes.unshift(route);
callback(null, match);
} else {
callback();
}
}, remainingPathname, paramNames, paramValues);
} else {
callback();
}
});
} else {
callback();
}
}
/**
* Asynchronously matches the given location to a set of routes and calls
* callback(error, state) when finished. The state object will have the
* following properties:
*
* - routes An array of routes that matched, in hierarchical order
* - params An object of URL parameters
*
* Note: This operation may finish synchronously if no routes have an
* asynchronous getChildRoutes method.
*/
function matchRoutes(routes, location, callback) {
var remainingPathname = arguments.length <= 3 || arguments[3] === undefined ? location.pathname : arguments[3];
var paramNames = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4];
var paramValues = arguments.length <= 5 || arguments[5] === undefined ? [] : arguments[5];
return (function () {
_AsyncUtils.loopAsync(routes.length, function (index, next, done) {
matchRouteDeep(routes[index], location, remainingPathname, paramNames, paramValues, function (error, match) {
if (error || match) {
done(error, match);
} else {
next();
}
});
}, callback);
})();
}
exports['default'] = matchRoutes;
module.exports = exports['default'];
/***/ },
/* 34 */
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.loopAsync = loopAsync;
function loopAsync(turns, work, callback) {
var currentTurn = 0;
var isDone = false;
function done() {
isDone = true;
callback.apply(this, arguments);
}
function next() {
if (isDone) return;
if (currentTurn < turns) {
work.call(this, currentTurn++, next, done);
} else {
done.apply(this, arguments);
}
}
next();
}
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
/*eslint-disable no-empty */
'use strict';
exports.__esModule = true;
exports.saveState = saveState;
exports.readState = readState;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var KeyPrefix = '@@History/';
var QuotaExceededError = 'QuotaExceededError';
function createKey(key) {
return KeyPrefix + key;
}
function saveState(key, state) {
try {
window.sessionStorage.setItem(createKey(key), JSON.stringify(state));
} catch (error) {
if (error.name === QuotaExceededError || window.sessionStorage.length === 0) {
// Probably in Safari "private mode" where sessionStorage quota is 0. #42
_warning2['default'](false, '[history] Unable to save state; sessionStorage is not available in Safari private mode');
return;
}
throw error;
}
}
function readState(key) {
var json = window.sessionStorage.getItem(createKey(key));
if (json) {
try {
return JSON.parse(json);
} catch (error) {
// Ignore invalid JSON.
}
}
return null;
}
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _ExecutionEnvironment = __webpack_require__(10);
var _DOMUtils = __webpack_require__(16);
var _createHistory = __webpack_require__(17);
var _createHistory2 = _interopRequireDefault(_createHistory);
function createDOMHistory(options) {
var history = _createHistory2['default'](_extends({
getUserConfirmation: _DOMUtils.getUserConfirmation
}, options, {
go: _DOMUtils.go
}));
function listen(listener) {
_invariant2['default'](_ExecutionEnvironment.canUseDOM, 'DOM history needs a DOM');
return history.listen(listener);
}
return _extends({}, history, {
listen: listen
});
}
exports['default'] = createDOMHistory;
module.exports = exports['default'];
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _Actions = __webpack_require__(7);
var _ExecutionEnvironment = __webpack_require__(10);
var _DOMUtils = __webpack_require__(16);
var _DOMStateStorage = __webpack_require__(35);
var _createDOMHistory = __webpack_require__(36);
var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory);
function isAbsolutePath(path) {
return typeof path === 'string' && path.charAt(0) === '/';
}
function ensureSlash() {
var path = _DOMUtils.getHashPath();
if (isAbsolutePath(path)) return true;
_DOMUtils.replaceHashPath('/' + path);
return false;
}
function addQueryStringValueToPath(path, key, value) {
return path + (path.indexOf('?') === -1 ? '?' : '&') + (key + '=' + value);
}
function stripQueryStringValueFromPath(path, key) {
return path.replace(new RegExp('[?&]?' + key + '=[a-zA-Z0-9]+'), '');
}
function getQueryStringValueFromPath(path, key) {
var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b'));
return match && match[1];
}
var DefaultQueryKey = '_k';
function createHashHistory() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
_invariant2['default'](_ExecutionEnvironment.canUseDOM, 'Hash history needs a DOM');
var queryKey = options.queryKey;
if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey;
function getCurrentLocation() {
var path = _DOMUtils.getHashPath();
var key = undefined,
state = undefined;
if (queryKey) {
key = getQueryStringValueFromPath(path, queryKey);
path = stripQueryStringValueFromPath(path, queryKey);
if (key) {
state = _DOMStateStorage.readState(key);
} else {
state = null;
key = history.createKey();
_DOMUtils.replaceHashPath(addQueryStringValueToPath(path, queryKey, key));
}
} else {
key = state = null;
}
return history.createLocation(path, state, undefined, key);
}
function startHashChangeListener(_ref) {
var transitionTo = _ref.transitionTo;
function hashChangeListener() {
if (!ensureSlash()) return; // Always make sure hashes are preceeded with a /.
transitionTo(getCurrentLocation());
}
ensureSlash();
_DOMUtils.addEventListener(window, 'hashchange', hashChangeListener);
return function () {
_DOMUtils.removeEventListener(window, 'hashchange', hashChangeListener);
};
}
function finishTransition(location) {
var basename = location.basename;
var pathname = location.pathname;
var search = location.search;
var state = location.state;
var action = location.action;
var key = location.key;
if (action === _Actions.POP) return; // Nothing to do.
var path = (basename || '') + pathname + search;
if (queryKey) path = addQueryStringValueToPath(path, queryKey, key);
if (path === _DOMUtils.getHashPath()) {
_warning2['default'](false, 'You cannot %s the same path using hash history', action);
} else {
if (queryKey) {
_DOMStateStorage.saveState(key, state);
} else {
// Drop key and state.
location.key = location.state = null;
}
if (action === _Actions.PUSH) {
window.location.hash = path;
} else {
// REPLACE
_DOMUtils.replaceHashPath(path);
}
}
}
var history = _createDOMHistory2['default'](_extends({}, options, {
getCurrentLocation: getCurrentLocation,
finishTransition: finishTransition,
saveState: _DOMStateStorage.saveState
}));
var listenerCount = 0,
stopHashChangeListener = undefined;
function listenBefore(listener) {
if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
var unlisten = history.listenBefore(listener);
return function () {
unlisten();
if (--listenerCount === 0) stopHashChangeListener();
};
}
function listen(listener) {
if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
var unlisten = history.listen(listener);
return function () {
unlisten();
if (--listenerCount === 0) stopHashChangeListener();
};
}
function pushState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');
history.pushState(state, path);
}
function replaceState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');
history.replaceState(state, path);
}
var goIsSupportedWithoutReload = _DOMUtils.supportsGoWithoutReloadUsingHash();
function go(n) {
_warning2['default'](goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
history.go(n);
}
function createHref(path) {
return '#' + history.createHref(path);
}
// deprecated
function registerTransitionHook(hook) {
if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history);
history.registerTransitionHook(hook);
}
// deprecated
function unregisterTransitionHook(hook) {
history.unregisterTransitionHook(hook);
if (--listenerCount === 0) stopHashChangeListener();
}
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,
pushState: pushState,
replaceState: replaceState,
go: go,
createHref: createHref,
registerTransitionHook: registerTransitionHook,
unregisterTransitionHook: unregisterTransitionHook
});
}
exports['default'] = createHashHistory;
module.exports = exports['default'];
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _Actions = __webpack_require__(7);
var _parsePath = __webpack_require__(11);
var _parsePath2 = _interopRequireDefault(_parsePath);
function createLocation() {
var path = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];
var state = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
var action = arguments.length <= 2 || arguments[2] === undefined ? _Actions.POP : arguments[2];
var key = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3];
if (typeof path === 'string') path = _parsePath2['default'](path);
var pathname = path.pathname || '/';
var search = path.search || '';
var hash = path.hash || '';
return {
pathname: pathname,
search: search,
hash: hash,
state: state,
action: action,
key: key
};
}
exports['default'] = createLocation;
module.exports = exports['default'];
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = __webpack_require__(2);
var _invariant2 = _interopRequireDefault(_invariant);
var _Actions = __webpack_require__(7);
var _createHistory = __webpack_require__(17);
var _createHistory2 = _interopRequireDefault(_createHistory);
function createStateStorage(entries) {
return entries.filter(function (entry) {
return entry.state;
}).reduce(function (memo, entry) {
memo[entry.key] = entry.state;
return memo;
}, {});
}
function createMemoryHistory() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
if (Array.isArray(options)) {
options = { entries: options };
} else if (typeof options === 'string') {
options = { entries: [options] };
}
var history = _createHistory2['default'](_extends({}, options, {
getCurrentLocation: getCurrentLocation,
finishTransition: finishTransition,
saveState: saveState,
go: go
}));
var _options = options;
var entries = _options.entries;
var current = _options.current;
if (typeof entries === 'string') {
entries = [entries];
} else if (!Array.isArray(entries)) {
entries = ['/'];
}
entries = entries.map(function (entry) {
var key = history.createKey();
if (typeof entry === 'string') return { pathname: entry, key: key };
if (typeof entry === 'object' && entry) return _extends({}, entry, { key: key });
_invariant2['default'](false, 'Unable to create history entry from %s', entry);
});
if (current == null) {
current = entries.length - 1;
} else {
_invariant2['default'](current >= 0 && current < entries.length, 'Current index must be >= 0 and < %s, was %s', entries.length, current);
}
var storage = createStateStorage(entries);
function saveState(key, state) {
storage[key] = state;
}
function readState(key) {
return storage[key];
}
function getCurrentLocation() {
var entry = entries[current];
var key = entry.key;
var basename = entry.basename;
var pathname = entry.pathname;
var search = entry.search;
var path = (basename || '') + pathname + (search || '');
var state = undefined;
if (key) {
state = readState(key);
} else {
state = null;
key = history.createKey();
entry.key = key;
}
return history.createLocation(path, state, undefined, key);
}
function canGo(n) {
var index = current + n;
return index >= 0 && index < entries.length;
}
function go(n) {
if (n) {
_invariant2['default'](canGo(n), 'Cannot go(%s) there is not enough history', n);
current += n;
var currentLocation = getCurrentLocation();
// change action to POP
history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP }));
}
}
function finishTransition(location) {
switch (location.action) {
case _Actions.PUSH:
current += 1;
// if we are not on the top of stack
// remove rest and push new
if (current < entries.length) entries.splice(current);
entries.push(location);
saveState(location.key, location.state);
break;
case _Actions.REPLACE:
entries[current] = location;
saveState(location.key, location.state);
break;
}
}
return history;
}
exports['default'] = createMemoryHistory;
module.exports = exports['default'];
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = __webpack_require__(3);
var _warning2 = _interopRequireDefault(_warning);
function deprecate(fn, message) {
return function () {
_warning2['default'](false, '[history] ' + message);
return fn.apply(this, arguments);
};
}
exports['default'] = deprecate;
module.exports = exports['default'];
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var _ExecutionEnvironment = __webpack_require__(10);
var _runTransitionHook = __webpack_require__(12);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _parsePath = __webpack_require__(11);
var _parsePath2 = _interopRequireDefault(_parsePath);
function useBasename(createHistory) {
return function () {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var basename = options.basename;
var historyOptions = _objectWithoutProperties(options, ['basename']);
var history = createHistory(historyOptions);
// Automatically use the value of <base href> in HTML
// documents as basename if it's not explicitly given.
if (basename == null && _ExecutionEnvironment.canUseDOM) {
var base = document.getElementsByTagName('base')[0];
if (base) basename = base.href;
}
function addBasename(location) {
if (basename && location.basename == null) {
if (location.pathname.indexOf(basename) === 0) {
location.pathname = location.pathname.substring(basename.length);
location.basename = basename;
if (location.pathname === '') location.pathname = '/';
} else {
location.basename = '';
}
}
return location;
}
function prependBasename(path) {
if (!basename) return path;
if (typeof path === 'string') path = _parsePath2['default'](path);
var pname = path.pathname;
var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/';
var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname;
var pathname = normalizedBasename + normalizedPathname;
return _extends({}, path, {
pathname: pathname
});
}
// Override all read methods with basename-aware versions.
function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
_runTransitionHook2['default'](hook, addBasename(location), callback);
});
}
function listen(listener) {
return history.listen(function (location) {
listener(addBasename(location));
});
}
// Override all write methods with basename-aware versions.
function pushState(state, path) {
history.pushState(state, prependBasename(path));
}
function replaceState(state, path) {
history.replaceState(state, prependBasename(path));
}
function createPath(path) {
return history.createPath(prependBasename(path));
}
function createHref(path) {
return history.createHref(prependBasename(path));
}
function createLocation() {
return addBasename(history.createLocation.apply(history, arguments));
}
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,
pushState: pushState,
replaceState: replaceState,
createPath: createPath,
createHref: createHref,
createLocation: createLocation
});
};
}
exports['default'] = useBasename;
module.exports = exports['default'];
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var _qs = __webpack_require__(46);
var _qs2 = _interopRequireDefault(_qs);
var _runTransitionHook = __webpack_require__(12);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _parsePath = __webpack_require__(11);
var _parsePath2 = _interopRequireDefault(_parsePath);
function defaultStringifyQuery(query) {
return _qs2['default'].stringify(query, { arrayFormat: 'brackets' });
}
function defaultParseQueryString(queryString) {
return _qs2['default'].parse(queryString);
}
/**
* Returns a new createHistory function that may be used to create
* history objects that know how to handle URL queries.
*/
function useQueries(createHistory) {
return function () {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var stringifyQuery = options.stringifyQuery;
var parseQueryString = options.parseQueryString;
var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']);
var history = createHistory(historyOptions);
if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery;
if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString;
function addQuery(location) {
if (location.query == null) location.query = parseQueryString(location.search.substring(1));
return location;
}
function appendQuery(path, query) {
var queryString = undefined;
if (!query || (queryString = stringifyQuery(query)) === '') return path;
if (typeof path === 'string') path = _parsePath2['default'](path);
var search = path.search + (path.search ? '&' : '?') + queryString;
return _extends({}, path, {
search: search
});
}
// Override all read methods with query-aware versions.
function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
_runTransitionHook2['default'](hook, addQuery(location), callback);
});
}
function listen(listener) {
return history.listen(function (location) {
listener(addQuery(location));
});
}
// Override all write methods with query-aware versions.
function pushState(state, path, query) {
return history.pushState(state, appendQuery(path, query));
}
function replaceState(state, path, query) {
return history.replaceState(state, appendQuery(path, query));
}
function createPath(path, query) {
return history.createPath(appendQuery(path, query));
}
function createHref(path, query) {
return history.createHref(appendQuery(path, query));
}
function createLocation() {
return addQuery(history.createLocation.apply(history, arguments));
}
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,
pushState: pushState,
replaceState: replaceState,
createPath: createPath,
createHref: createHref,
createLocation: createLocation
});
};
}
exports['default'] = useQueries;
module.exports = exports['default'];
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
var pSlice = Array.prototype.slice;
var objectKeys = __webpack_require__(45);
var isArguments = __webpack_require__(44);
var deepEqual = module.exports = function (actual, expected, opts) {
if (!opts) opts = {};
// 7.1. All identical values are equivalent, as determined by ===.
if (actual === expected) {
return true;
} else if (actual instanceof Date && expected instanceof Date) {
return actual.getTime() === expected.getTime();
// 7.3. Other pairs that do not both pass typeof value == 'object',
// equivalence is determined by ==.
} else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
return opts.strict ? actual === expected : actual == expected;
// 7.4. For all other Object pairs, including Array objects, equivalence is
// determined by having the same number of owned properties (as verified
// with Object.prototype.hasOwnProperty.call), the same set of keys
// (although not necessarily the same order), equivalent values for every
// corresponding key, and an identical 'prototype' property. Note: this
// accounts for both named and indexed properties on Arrays.
} else {
return objEquiv(actual, expected, opts);
}
}
function isUndefinedOrNull(value) {
return value === null || value === undefined;
}
function isBuffer (x) {
if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
return false;
}
if (x.length > 0 && typeof x[0] !== 'number') return false;
return true;
}
function objEquiv(a, b, opts) {
var i, key;
if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
return false;
// an identical 'prototype' property.
if (a.prototype !== b.prototype) return false;
//~~~I've managed to break Object.keys through screwy arguments passing.
// Converting to array solves the problem.
if (isArguments(a)) {
if (!isArguments(b)) {
return false;
}
a = pSlice.call(a);
b = pSlice.call(b);
return deepEqual(a, b, opts);
}
if (isBuffer(a)) {
if (!isBuffer(b)) {
return false;
}
if (a.length !== b.length) return false;
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false;
}
return true;
}
try {
var ka = objectKeys(a),
kb = objectKeys(b);
} catch (e) {//happens when one is a string literal and the other isn't
return false;
}
// having the same number of owned properties (keys incorporates
// hasOwnProperty)
if (ka.length != kb.length)
return false;
//the same set of keys (although not necessarily the same order),
ka.sort();
kb.sort();
//~~~cheap key test
for (i = ka.length - 1; i >= 0; i--) {
if (ka[i] != kb[i])
return false;
}
//equivalent values for every corresponding key, and
//~~~possibly expensive deep test
for (i = ka.length - 1; i >= 0; i--) {
key = ka[i];
if (!deepEqual(a[key], b[key], opts)) return false;
}
return typeof a === typeof b;
}
/***/ },
/* 44 */
/***/ function(module, exports) {
var supportsArgumentsClass = (function(){
return Object.prototype.toString.call(arguments)
})() == '[object Arguments]';
exports = module.exports = supportsArgumentsClass ? supported : unsupported;
exports.supported = supported;
function supported(object) {
return Object.prototype.toString.call(object) == '[object Arguments]';
};
exports.unsupported = unsupported;
function unsupported(object){
return object &&
typeof object == 'object' &&
typeof object.length == 'number' &&
Object.prototype.hasOwnProperty.call(object, 'callee') &&
!Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
false;
};
/***/ },
/* 45 */
/***/ function(module, exports) {
exports = module.exports = typeof Object.keys === 'function'
? Object.keys : shim;
exports.shim = shim;
function shim (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
}
/***/ },
/* 46 */
/***/ function(module, exports, __webpack_require__) {
// Load modules
var Stringify = __webpack_require__(48);
var Parse = __webpack_require__(47);
// Declare internals
var internals = {};
module.exports = {
stringify: Stringify,
parse: Parse
};
/***/ },
/* 47 */
/***/ function(module, exports, __webpack_require__) {
// Load modules
var Utils = __webpack_require__(18);
// Declare internals
var internals = {
delimiter: '&',
depth: 5,
arrayLimit: 20,
parameterLimit: 1000,
strictNullHandling: false,
plainObjects: false,
allowPrototypes: false
};
internals.parseValues = function (str, options) {
var obj = {};
var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
for (var i = 0, il = parts.length; i < il; ++i) {
var part = parts[i];
var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
if (pos === -1) {
obj[Utils.decode(part)] = '';
if (options.strictNullHandling) {
obj[Utils.decode(part)] = null;
}
}
else {
var key = Utils.decode(part.slice(0, pos));
var val = Utils.decode(part.slice(pos + 1));
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
obj[key] = val;
}
else {
obj[key] = [].concat(obj[key]).concat(val);
}
}
}
return obj;
};
internals.parseObject = function (chain, val, options) {
if (!chain.length) {
return val;
}
var root = chain.shift();
var obj;
if (root === '[]') {
obj = [];
obj = obj.concat(internals.parseObject(chain, val, options));
}
else {
obj = options.plainObjects ? Object.create(null) : {};
var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
var index = parseInt(cleanRoot, 10);
var indexString = '' + index;
if (!isNaN(index) &&
root !== cleanRoot &&
indexString === cleanRoot &&
index >= 0 &&
(options.parseArrays &&
index <= options.arrayLimit)) {
obj = [];
obj[index] = internals.parseObject(chain, val, options);
}
else {
obj[cleanRoot] = internals.parseObject(chain, val, options);
}
}
return obj;
};
internals.parseKeys = function (key, val, options) {
if (!key) {
return;
}
// Transform dot notation to bracket notation
if (options.allowDots) {
key = key.replace(/\.([^\.\[]+)/g, '[$1]');
}
// The regex chunks
var parent = /^([^\[\]]*)/;
var child = /(\[[^\[\]]*\])/g;
// Get the parent
var segment = parent.exec(key);
// Stash the parent if it exists
var keys = [];
if (segment[1]) {
// If we aren't using plain objects, optionally prefix keys
// that would overwrite object prototype properties
if (!options.plainObjects &&
Object.prototype.hasOwnProperty(segment[1])) {
if (!options.allowPrototypes) {
return;
}
}
keys.push(segment[1]);
}
// Loop through children appending to the array until we hit depth
var i = 0;
while ((segment = child.exec(key)) !== null && i < options.depth) {
++i;
if (!options.plainObjects &&
Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
if (!options.allowPrototypes) {
continue;
}
}
keys.push(segment[1]);
}
// If there's a remainder, just add whatever is left
if (segment) {
keys.push('[' + key.slice(segment.index) + ']');
}
return internals.parseObject(keys, val, options);
};
module.exports = function (str, options) {
options = options || {};
options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
options.parseArrays = options.parseArrays !== false;
options.allowDots = options.allowDots !== false;
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects;
options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes;
options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
if (str === '' ||
str === null ||
typeof str === 'undefined') {
return options.plainObjects ? Object.create(null) : {};
}
var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
var obj = options.plainObjects ? Object.create(null) : {};
// Iterate over the keys and setup the new object
var keys = Object.keys(tempObj);
for (var i = 0, il = keys.length; i < il; ++i) {
var key = keys[i];
var newObj = internals.parseKeys(key, tempObj[key], options);
obj = Utils.merge(obj, newObj, options);
}
return Utils.compact(obj);
};
/***/ },
/* 48 */
/***/ function(module, exports, __webpack_require__) {
// Load modules
var Utils = __webpack_require__(18);
// Declare internals
var internals = {
delimiter: '&',
arrayPrefixGenerators: {
brackets: function (prefix, key) {
return prefix + '[]';
},
indices: function (prefix, key) {
return prefix + '[' + key + ']';
},
repeat: function (prefix, key) {
return prefix;
}
},
strictNullHandling: false
};
internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, filter) {
if (typeof filter === 'function') {
obj = filter(prefix, obj);
}
else if (Utils.isBuffer(obj)) {
obj = obj.toString();
}
else if (obj instanceof Date) {
obj = obj.toISOString();
}
else if (obj === null) {
if (strictNullHandling) {
return Utils.encode(prefix);
}
obj = '';
}
if (typeof obj === 'string' ||
typeof obj === 'number' ||
typeof obj === 'boolean') {
return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
}
var values = [];
if (typeof obj === 'undefined') {
return values;
}
var objKeys = Array.isArray(filter) ? filter : Object.keys(obj);
for (var i = 0, il = objKeys.length; i < il; ++i) {
var key = objKeys[i];
if (Array.isArray(obj)) {
values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, filter));
}
else {
values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, filter));
}
}
return values;
};
module.exports = function (obj, options) {
options = options || {};
var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
filter = options.filter;
obj = filter('', obj);
}
else if (Array.isArray(options.filter)) {
objKeys = filter = options.filter;
}
var keys = [];
if (typeof obj !== 'object' ||
obj === null) {
return '';
}
var arrayFormat;
if (options.arrayFormat in internals.arrayPrefixGenerators) {
arrayFormat = options.arrayFormat;
}
else if ('indices' in options) {
arrayFormat = options.indices ? 'indices' : 'repeat';
}
else {
arrayFormat = 'indices';
}
var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
if (!objKeys) {
objKeys = Object.keys(obj);
}
for (var i = 0, il = objKeys.length; i < il; ++i) {
var key = objKeys[i];
keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, filter));
}
return keys.join(delimiter);
};
/***/ }
/******/ ])
});
; |
src/svg-icons/places/free-breakfast.js | ngbrown/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let PlacesFreeBreakfast = (props) => (
<SvgIcon {...props}>
<path d="M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"/>
</SvgIcon>
);
PlacesFreeBreakfast = pure(PlacesFreeBreakfast);
PlacesFreeBreakfast.displayName = 'PlacesFreeBreakfast';
PlacesFreeBreakfast.muiName = 'SvgIcon';
export default PlacesFreeBreakfast;
|
www/components/fb-profile-picture.js | capaj/postuj-hovna | import React from 'react'
export default class FbProfilePicture extends React.Component {
constructor(...props) {
super(...props)
}
render() {
let style = Object.assign({maxWidth: '100%', display: 'inline-block'}, this.props.style)
let size = 55
if (this.props.type === 'small') {
size = 25
}
return <div style={style}>
<img style={{marginLeft: 6, marginRight: 2, borderRadius: '50%'}}
src={`https://graph.facebook.com/${this.props.id}/picture?width=${size}&height=${size}`}/>
</div>
}
}
|
admin/client/App/elemental/Modal/body.js | giovanniRodighiero/cms | import React from 'react';
import { css } from 'glamor';
import theme from '../../../theme';
function ModalBody ({
className,
...props
}) {
return (
<div
className={css(classes.body, className)}
{...props}
/>
);
};
const classes = {
body: {
paddingBottom: theme.modal.padding.body.vertical,
paddingLeft: theme.modal.padding.body.horizontal,
paddingRight: theme.modal.padding.body.horizontal,
paddingTop: theme.modal.padding.body.vertical,
},
};
module.exports = ModalBody;
|
app/react-icons/fa/gift.js | scampersand/sonos-front | import React from 'react';
import IconBase from 'react-icon-base';
export default class FaGift extends React.Component {
render() {
return (
<IconBase viewBox="0 0 40 40" {...this.props}>
<g><path d="m23.7 30.3v-16h-7.1v16q0 0.5 0.4 0.8t1 0.3h4.3q0.6 0 1-0.3t0.4-0.8z m-10.2-18.9h4.4l-2.8-3.6q-0.6-0.7-1.6-0.7-0.9 0-1.5 0.7t-0.6 1.5 0.6 1.5 1.5 0.6z m15.4-2.1q0-0.9-0.6-1.5t-1.6-0.7q-0.9 0-1.5 0.7l-2.8 3.6h4.4q0.8 0 1.5-0.6t0.6-1.5z m8.4 5.7v7.1q0 0.4-0.2 0.6t-0.5 0.2h-2.2v9.2q0 0.9-0.6 1.6t-1.5 0.6h-24.3q-0.9 0-1.5-0.6t-0.6-1.6v-9.2h-2.2q-0.3 0-0.5-0.2t-0.2-0.6v-7.1q0-0.3 0.2-0.5t0.5-0.2h9.8q-2 0-3.5-1.5t-1.5-3.5 1.5-3.6 3.5-1.4q2.4 0 3.8 1.7l2.8 3.7 2.9-3.7q1.4-1.7 3.8-1.7 2 0 3.5 1.4t1.4 3.6-1.4 3.5-3.6 1.5h9.9q0.3 0 0.5 0.2t0.2 0.5z"/></g>
</IconBase>
);
}
}
|
src/components/Body-dependencies/Slider.js | CoreyBurkhart/pomodoro-wonderful | import React, { Component } from 'react';
import '../../css/slider.css';
class Slider extends Component {
constructor() {
super();
this.toggleTextInput = this.toggleTextInput.bind(this);
this.keypressHandler = this.keypressHandler.bind(this);
this.inputDisplayed = false;
}
toggleTextInput(e) {
if(this.props.passedState.started !== true) {
if(this.inputDisplayed) {
console.log('hid input');
this.refs.text.style.display = 'none';
this.refs.span.style.display = 'inline';
}
else {
console.log('hid span');
this.refs.text.style.display = 'inline';
this.refs.span.style.display = 'none';
this.refs.text.select();
}
try {
if(e.target.tagName === 'INPUT') {
console.log('ran textInputHandler');
this.props.textInputHandler(e);
}
} catch(e) {}
this.inputDisplayed = !this.inputDisplayed;
console.log(this.inputDisplayed);
}
}
keypressHandler(e) {
if(e.which === 13) {
console.log('enter');
// this.inputDisplayed = !this.inputDisplayed;
e.target.blur();
this.props.textInputHandler(e);
}
}
render() {
return (
<div className="slider col-xs-12 ">
<div className={'row ' + this.props.title}>
<label className='col-xs-2' htmlFor={this.props.title}> {this.props.title} </label>
<div className="col-xs-2 col-xs-offset-8 range-number">
<span ref='span' onClick={this.toggleTextInput}>{this.props.value}</span>
<input type='text' ref='text' className={this.props.title} style={{display: 'none'}} onBlur={this.toggleTextInput} maxLength="3" onKeyPress={this.keypressHandler} disabled={this.props.passedState.started}></input>
</div>
</div>
<input type='range' min={this.props.min} id={this.props.title} max={this.props.max} onInput={this.props.rangeChangeHandler} disabled={this.props.passedState.started} />
</div>
)
}
}
export default Slider;
|
src/components/widgets/HBar.js | rsamec/react-designer | import React from 'react';
import _ from 'lodash';
import * as md from 'react-icons/lib/md';
var styleSvg = function(style,fill) {
style = _.clone(style) || {};
if (fill === undefined) return style;
style.fill = fill.color;
style.fillOpacity = !!fill.alpha ? fill.alpha / 100 : 1;
return style;
}
let HBar = (props) => {
//var style = props.style || {};
var iconStyle = {};
//size
if (props.item && props.item.height) iconStyle.height = props.item.height;
if (props.item && props.item.width) iconStyle.width = props.item.width;
var containerStyle = {display: 'flex', flexWrap: 'wrap'};
if (props.width) containerStyle.width = props.width;
if (props.height) containerStyle.height = props.height;
var items = _.range(0, props.item && props.item.count || 20);
var index = items.length * (props.value / 100);
var icon = md[props.icon];
var iconProps = styleSvg(iconStyle, props.color);
var selectIconProps = styleSvg(iconStyle, props.selectColor);
return (
<div style={containerStyle}>
{items.map(function (item, i) {
return React.createElement(icon, _.extend(index > i ? selectIconProps : iconProps, {key: i}), null)
})}
</div>
);
}
HBar.defaultProps = {
icon: 'MdAccessibility',
value: 50,
item: {count: 20, height: 50, width: 50},
color: {color: 'black'},
selectColor: {color: 'red'}
}
export default HBar
|
src/client/components/Loader.js | djmill0326/node-random-stuff | import React from 'react';
module.exports = () => (
<div className="flex flex-center flex-column height-100vh">
<div className="spinner">
<div className="rect1"></div>
<div className="rect2"></div>
<div className="rect3"></div>
<div className="rect4"></div>
<div className="rect5"></div>
</div>
</div>
)
|
ajax/libs/yui/3.7.1/event-custom-base/event-custom-base-coverage.js | DaAwesomeP/cdnjs | if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/event-custom-base/event-custom-base.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/event-custom-base/event-custom-base.js",
code: []
};
_yuitest_coverage["build/event-custom-base/event-custom-base.js"].code=["YUI.add('event-custom-base', function (Y, NAME) {","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," */","","Y.Env.evt = {"," handles: {},"," plugins: {}","};","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * Allows for the insertion of methods that are executed before or after"," * a specified method"," * @class Do"," * @static"," */","","var DO_BEFORE = 0,"," DO_AFTER = 1,","","DO = {",""," /**"," * Cache of objects touched by the utility"," * @property objs"," * @static"," * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object "," * replaces the role of this property, but is considered to be private, and "," * is only mentioned to provide a migration path."," * "," * If you have a use case which warrants migration to the _yuiaop property, "," * please file a ticket to let us know what it's used for and we can see if "," * we need to expose hooks for that functionality more formally."," */"," objs: null,",""," /**"," * <p>Execute the supplied method before the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>"," * <dd>Replace the arguments that the original function will be"," * called with.</dd>"," * <dt></code>Y.Do.Prevent(message)</code></dt>"," * <dd>Don't execute the wrapped function. Other before phase"," * wrappers will be executed.</dd>"," * </dl>"," *"," * @method before"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {string} handle for the subscription"," * @static"," */"," before: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_BEFORE, f, obj, sFn);"," },",""," /**"," * <p>Execute the supplied method after the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>"," * <dd>Return <code>returnValue</code> instead of the wrapped"," * method's original return value. This can be further altered by"," * other after phase wrappers.</dd>"," * </dl>"," *"," * <p>The static properties <code>Y.Do.originalRetVal</code> and"," * <code>Y.Do.currentRetVal</code> will be populated for reference.</p>"," *"," * @method after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * @return {string} handle for the subscription"," * @static"," */"," after: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_AFTER, f, obj, sFn);"," },",""," /**"," * Execute the supplied method before or after the specified function."," * Used by <code>before</code> and <code>after</code>."," *"," * @method _inject"," * @param when {string} before or after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @return {string} handle for the subscription"," * @private"," * @static"," */"," _inject: function(when, fn, obj, sFn) {"," // object id"," var id = Y.stamp(obj), o, sid;",""," if (!obj._yuiaop) {"," // create a map entry for the obj if it doesn't exist, to hold overridden methods"," obj._yuiaop = {};"," }",""," o = obj._yuiaop;",""," if (!o[sFn]) {"," // create a map entry for the method if it doesn't exist"," o[sFn] = new Y.Do.Method(obj, sFn);",""," // re-route the method to our wrapper"," obj[sFn] = function() {"," return o[sFn].exec.apply(o[sFn], arguments);"," };"," }",""," // subscriber id"," sid = id + Y.stamp(fn) + sFn;",""," // register the callback"," o[sFn].register(sid, fn, when);",""," return new Y.EventHandle(o[sFn], sid);"," },",""," /**"," * Detach a before or after subscription."," *"," * @method detach"," * @param handle {string} the subscription handle"," * @static"," */"," detach: function(handle) {"," if (handle.detach) {"," handle.detach();"," }"," },",""," _unload: function(e, me) {"," }","};","","Y.Do = DO;","","//////////////////////////////////////////////////////////////////////////","","/**"," * Contains the return value from the wrapped method, accessible"," * by 'after' event listeners."," *"," * @property originalRetVal"," * @static"," * @since 3.2.0"," */","","/**"," * Contains the current state of the return value, consumable by"," * 'after' event listeners, and updated if an after subscriber"," * changes the return value generated by the wrapped function."," *"," * @property currentRetVal"," * @static"," * @since 3.2.0"," */","","//////////////////////////////////////////////////////////////////////////","","/**"," * Wrapper for a displaced method with aop enabled"," * @class Do.Method"," * @constructor"," * @param obj The object to operate on"," * @param sFn The name of the method to displace"," */","DO.Method = function(obj, sFn) {"," this.obj = obj;"," this.methodName = sFn;"," this.method = obj[sFn];"," this.before = {};"," this.after = {};","};","","/**"," * Register a aop subscriber"," * @method register"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype.register = function (sid, fn, when) {"," if (when) {"," this.after[sid] = fn;"," } else {"," this.before[sid] = fn;"," }","};","","/**"," * Unregister a aop subscriber"," * @method delete"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype._delete = function (sid) {"," delete this.before[sid];"," delete this.after[sid];","};","","/**"," * <p>Execute the wrapped method. All arguments are passed into the wrapping"," * functions. If any of the before wrappers return an instance of"," * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped"," * function nor any after phase subscribers will be executed.</p>"," *"," * <p>The return value will be the return value of the wrapped function or one"," * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or"," * <code>Y.Do.AlterReturn</code>."," *"," * @method exec"," * @param arg* {any} Arguments are passed to the wrapping and wrapped functions"," * @return {any} Return value of wrapped function unless overwritten (see above)"," */","DO.Method.prototype.exec = function () {",""," var args = Y.Array(arguments, 0, true),"," i, ret, newRet,"," bf = this.before,"," af = this.after,"," prevented = false;",""," // execute before"," for (i in bf) {"," if (bf.hasOwnProperty(i)) {"," ret = bf[i].apply(this.obj, args);"," if (ret) {"," switch (ret.constructor) {"," case DO.Halt:"," return ret.retVal;"," case DO.AlterArgs:"," args = ret.newArgs;"," break;"," case DO.Prevent:"," prevented = true;"," break;"," default:"," }"," }"," }"," }",""," // execute method"," if (!prevented) {"," ret = this.method.apply(this.obj, args);"," }",""," DO.originalRetVal = ret;"," DO.currentRetVal = ret;",""," // execute after methods."," for (i in af) {"," if (af.hasOwnProperty(i)) {"," newRet = af[i].apply(this.obj, args);"," // Stop processing if a Halt object is returned"," if (newRet && newRet.constructor == DO.Halt) {"," return newRet.retVal;"," // Check for a new return value"," } else if (newRet && newRet.constructor == DO.AlterReturn) {"," ret = newRet.newRetVal;"," // Update the static retval state"," DO.currentRetVal = ret;"," }"," }"," }",""," return ret;","};","","//////////////////////////////////////////////////////////////////////////","","/**"," * Return an AlterArgs object when you want to change the arguments that"," * were passed into the function. Useful for Do.before subscribers. An"," * example would be a service that scrubs out illegal characters prior to"," * executing the core business logic."," * @class Do.AlterArgs"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newArgs {Array} Call parameters to be used for the original method"," * instead of the arguments originally passed in."," */","DO.AlterArgs = function(msg, newArgs) {"," this.msg = msg;"," this.newArgs = newArgs;","};","","/**"," * Return an AlterReturn object when you want to change the result returned"," * from the core method to the caller. Useful for Do.after subscribers."," * @class Do.AlterReturn"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newRetVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.AlterReturn = function(msg, newRetVal) {"," this.msg = msg;"," this.newRetVal = newRetVal;","};","","/**"," * Return a Halt object when you want to terminate the execution"," * of all subsequent subscribers as well as the wrapped method"," * if it has not exectued yet. Useful for Do.before subscribers."," * @class Do.Halt"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.Halt = function(msg, retVal) {"," this.msg = msg;"," this.retVal = retVal;","};","","/**"," * Return a Prevent object when you want to prevent the wrapped function"," * from executing, but want the remaining listeners to execute. Useful"," * for Do.before subscribers."," * @class Do.Prevent"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," */","DO.Prevent = function(msg) {"," this.msg = msg;","};","","/**"," * Return an Error object when you want to terminate the execution"," * of all subsequent method calls."," * @class Do.Error"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," * @deprecated use Y.Do.Halt or Y.Do.Prevent"," */","DO.Error = DO.Halt;","","","//////////////////////////////////////////////////////////////////////////","","// Y[\"Event\"] && Y.Event.addListener(window, \"unload\", Y.Do._unload, Y.Do);","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","","// var onsubscribeType = \"_event:onsub\",","var YArray = Y.Array,",""," AFTER = 'after',"," CONFIGS = ["," 'broadcast',"," 'monitored',"," 'bubbles',"," 'context',"," 'contextFn',"," 'currentTarget',"," 'defaultFn',"," 'defaultTargetOnly',"," 'details',"," 'emitFacade',"," 'fireOnce',"," 'async',"," 'host',"," 'preventable',"," 'preventedFn',"," 'queuable',"," 'silent',"," 'stoppedFn',"," 'target',"," 'type'"," ],",""," CONFIGS_HASH = YArray.hash(CONFIGS),",""," nativeSlice = Array.prototype.slice, ",""," YUI3_SIGNATURE = 9,"," YUI_LOG = 'yui:log',",""," mixConfigs = function(r, s, ov) {"," var p;",""," for (p in s) {"," if (CONFIGS_HASH[p] && (ov || !(p in r))) { "," r[p] = s[p];"," }"," }",""," return r;"," };","","/**"," * The CustomEvent class lets you define events for your application"," * that can be subscribed to by one or more independent component."," *"," * @param {String} type The type of event, which is passed to the callback"," * when the event fires."," * @param {object} o configuration object."," * @class CustomEvent"," * @constructor"," */","Y.CustomEvent = function(type, o) {",""," this._kds = Y.CustomEvent.keepDeprecatedSubs;",""," o = o || {};",""," this.id = Y.stamp(this);",""," /**"," * The type of event, returned to subscribers when the event fires"," * @property type"," * @type string"," */"," this.type = type;",""," /**"," * The context the the event will fire from by default. Defaults to the YUI"," * instance."," * @property context"," * @type object"," */"," this.context = Y;",""," /**"," * Monitor when an event is attached or detached."," *"," * @property monitored"," * @type boolean"," */"," // this.monitored = false;",""," this.logSystem = (type == YUI_LOG);",""," /**"," * If 0, this event does not broadcast. If 1, the YUI instance is notified"," * every time this event fires. If 2, the YUI instance and the YUI global"," * (if event is enabled on the global) are notified every time this event"," * fires."," * @property broadcast"," * @type int"," */"," // this.broadcast = 0;",""," /**"," * By default all custom events are logged in the debug build, set silent"," * to true to disable debug outpu for this event."," * @property silent"," * @type boolean"," */"," this.silent = this.logSystem;",""," /**"," * Specifies whether this event should be queued when the host is actively"," * processing an event. This will effect exectution order of the callbacks"," * for the various events."," * @property queuable"," * @type boolean"," * @default false"," */"," // this.queuable = false;",""," /**"," * The subscribers to this event"," * @property subscribers"," * @type Subscriber {}"," * @deprecated"," */"," if (this._kds) {"," this.subscribers = {};"," }",""," /**"," * The subscribers to this event"," * @property _subscribers"," * @type Subscriber []"," * @private"," */"," this._subscribers = [];",""," /**"," * 'After' subscribers"," * @property afters"," * @type Subscriber {}"," */"," if (this._kds) {"," this.afters = {};"," }",""," /**"," * 'After' subscribers"," * @property _afters"," * @type Subscriber []"," * @private"," */"," this._afters = [];",""," /**"," * This event has fired if true"," *"," * @property fired"," * @type boolean"," * @default false;"," */"," // this.fired = false;",""," /**"," * An array containing the arguments the custom event"," * was last fired with."," * @property firedWith"," * @type Array"," */"," // this.firedWith;",""," /**"," * This event should only fire one time if true, and if"," * it has fired, any new subscribers should be notified"," * immediately."," *"," * @property fireOnce"," * @type boolean"," * @default false;"," */"," // this.fireOnce = false;",""," /**"," * fireOnce listeners will fire syncronously unless async"," * is set to true"," * @property async"," * @type boolean"," * @default false"," */"," //this.async = false;",""," /**"," * Flag for stopPropagation that is modified during fire()"," * 1 means to stop propagation to bubble targets. 2 means"," * to also stop additional subscribers on this target."," * @property stopped"," * @type int"," */"," // this.stopped = 0;",""," /**"," * Flag for preventDefault that is modified during fire()."," * if it is not 0, the default behavior for this event"," * @property prevented"," * @type int"," */"," // this.prevented = 0;",""," /**"," * Specifies the host for this custom event. This is used"," * to enable event bubbling"," * @property host"," * @type EventTarget"," */"," // this.host = null;",""," /**"," * The default function to execute after event listeners"," * have fire, but only if the default action was not"," * prevented."," * @property defaultFn"," * @type Function"," */"," // this.defaultFn = null;",""," /**"," * The function to execute if a subscriber calls"," * stopPropagation or stopImmediatePropagation"," * @property stoppedFn"," * @type Function"," */"," // this.stoppedFn = null;",""," /**"," * The function to execute if a subscriber calls"," * preventDefault"," * @property preventedFn"," * @type Function"," */"," // this.preventedFn = null;",""," /**"," * Specifies whether or not this event's default function"," * can be cancelled by a subscriber by executing preventDefault()"," * on the event facade"," * @property preventable"," * @type boolean"," * @default true"," */"," this.preventable = true;",""," /**"," * Specifies whether or not a subscriber can stop the event propagation"," * via stopPropagation(), stopImmediatePropagation(), or halt()"," *"," * Events can only bubble if emitFacade is true."," *"," * @property bubbles"," * @type boolean"," * @default true"," */"," this.bubbles = true;",""," /**"," * Supports multiple options for listener signatures in order to"," * port YUI 2 apps."," * @property signature"," * @type int"," * @default 9"," */"," this.signature = YUI3_SIGNATURE;",""," // this.subCount = 0;"," // this.afterCount = 0;",""," // this.hasSubscribers = false;"," // this.hasAfters = false;",""," /**"," * If set to true, the custom event will deliver an EventFacade object"," * that is similar to a DOM event object."," * @property emitFacade"," * @type boolean"," * @default false"," */"," // this.emitFacade = false;",""," this.applyConfig(o, true);","","","};","","/**"," * Static flag to enable population of the <a href=\"#property_subscribers\">`subscribers`</a>"," * and <a href=\"#property_subscribers\">`afters`</a> properties held on a `CustomEvent` instance."," * "," * These properties were changed to private properties (`_subscribers` and `_afters`), and "," * converted from objects to arrays for performance reasons. "," *"," * Setting this property to true will populate the deprecated `subscribers` and `afters` "," * properties for people who may be using them (which is expected to be rare). There will"," * be a performance hit, compared to the new array based implementation."," *"," * If you are using these deprecated properties for a use case which the public API"," * does not support, please file an enhancement request, and we can provide an alternate "," * public implementation which doesn't have the performance cost required to maintiain the"," * properties as objects."," *"," * @property keepDeprecatedSubs"," * @static"," * @for CustomEvent"," * @type boolean"," * @default false"," * @deprecated"," */","Y.CustomEvent.keepDeprecatedSubs = false;","","Y.CustomEvent.mixConfigs = mixConfigs;","","Y.CustomEvent.prototype = {",""," constructor: Y.CustomEvent,",""," /**"," * Returns the number of subscribers for this event as the sum of the on()"," * subscribers and after() subscribers."," *"," * @method hasSubs"," * @return Number"," */"," hasSubs: function(when) {"," var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;",""," if (sib) {"," s += sib._subscribers.length;"," a += sib._afters.length;"," }",""," if (when) {"," return (when == 'after') ? a : s;"," }",""," return (s + a);"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('detach', 'attach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," this.monitored = true;"," var type = this.id + '|' + this.type + '_' + what,"," args = nativeSlice.call(arguments, 0);"," args[0] = type;"," return this.host.on.apply(this.host, args);"," },",""," /**"," * Get all of the subscribers to this event and any sibling event"," * @method getSubs"," * @return {Array} first item is the on subscribers, second the after."," */"," getSubs: function() {"," var s = this._subscribers, a = this._afters, sib = this.sibling;",""," s = (sib) ? s.concat(sib._subscribers) : s.concat();"," a = (sib) ? a.concat(sib._afters) : a.concat();",""," return [s, a];"," },",""," /**"," * Apply configuration properties. Only applies the CONFIG whitelist"," * @method applyConfig"," * @param o hash of properties to apply."," * @param force {boolean} if true, properties that exist on the event"," * will be overwritten."," */"," applyConfig: function(o, force) {"," mixConfigs(this, o, force);"," },",""," /**"," * Create the Subscription for subscribing function, context, and bound"," * arguments. If this is a fireOnce event, the subscriber is immediately "," * notified."," *"," * @method _on"," * @param fn {Function} Subscription callback"," * @param [context] {Object} Override `this` in the callback"," * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()"," * @param [when] {String} \"after\" to slot into after subscribers"," * @return {EventHandle}"," * @protected"," */"," _on: function(fn, context, args, when) {","",""," var s = new Y.Subscriber(fn, context, args, when);",""," if (this.fireOnce && this.fired) {"," if (this.async) {"," setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);"," } else {"," this._notify(s, this.firedWith);"," }"," }",""," if (when == AFTER) {"," this._afters.push(s);"," } else {"," this._subscribers.push(s);"," }",""," if (this._kds) {"," if (when == AFTER) {"," this.afters[s.id] = s;"," } else {"," this.subscribers[s.id] = s;"," }"," }",""," return new Y.EventHandle(this, s);"," },",""," /**"," * Listen for this event"," * @method subscribe"," * @param {Function} fn The function to execute."," * @return {EventHandle} Unsubscribe handle."," * @deprecated use on."," */"," subscribe: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, true);"," },"," "," /**"," * Listen for this event"," * @method on"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} An object with a detach method to detch the handler(s)."," */"," on: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;",""," if (this.monitored && this.host) {"," this.host._monitor('attach', this, {"," args: arguments"," });"," }"," return this._on(fn, context, a, true);"," },",""," /**"," * Listen for this event after the normal subscribers have been notified and"," * the default behavior has been applied. If a normal subscriber prevents the"," * default behavior, it also prevents after listeners from firing."," * @method after"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} handle Unsubscribe handle."," */"," after: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, AFTER);"," },",""," /**"," * Detach listeners."," * @method detach"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int} returns the number of subscribers unsubscribed."," */"," detach: function(fn, context) {"," // unsubscribe handle"," if (fn && fn.detach) {"," return fn.detach();"," }"," "," var i, s,"," found = 0,"," subs = this._subscribers,"," afters = this._afters;",""," for (i = subs.length; i >= 0; i--) {"," s = subs[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, subs, i);"," found++;"," }"," }",""," for (i = afters.length; i >= 0; i--) {"," s = afters[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, afters, i);"," found++;"," }"," }",""," return found;"," },",""," /**"," * Detach listeners."," * @method unsubscribe"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int|undefined} returns the number of subscribers unsubscribed."," * @deprecated use detach."," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * Notify a single subscriber"," * @method _notify"," * @param {Subscriber} s the subscriber."," * @param {Array} args the arguments array to apply to the listener."," * @protected"," */"," _notify: function(s, args, ef) {","",""," var ret;",""," ret = s.notify(args, this);",""," if (false === ret || this.stopped > 1) {"," return false;"," }",""," return true;"," },",""," /**"," * Logger abstraction to centralize the application of the silent flag"," * @method log"," * @param {string} msg message to log."," * @param {string} cat log category."," */"," log: function(msg, cat) {"," },",""," /**"," * Notifies the subscribers. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters:"," * <ul>"," * <li>The type of event</li>"," * <li>All of the arguments fire() was executed with as an array</li>"," * <li>The custom object (if any) that was passed into the subscribe()"," * method</li>"," * </ul>"," * @method fire"," * @param {Object*} arguments an arbitrary set of parameters to pass to"," * the handler."," * @return {boolean} false if one of the subscribers returned false,"," * true otherwise."," *"," */"," fire: function() {"," if (this.fireOnce && this.fired) {"," return true;"," } else {",""," var args = nativeSlice.call(arguments, 0);",""," // this doesn't happen if the event isn't published"," // this.host._monitor('fire', this.type, args);",""," this.fired = true;",""," if (this.fireOnce) {"," this.firedWith = args;"," }",""," if (this.emitFacade) {"," return this.fireComplex(args);"," } else {"," return this.fireSimple(args);"," }"," }"," },",""," /**"," * Set up for notifying subscribers of non-emitFacade events."," *"," * @method fireSimple"," * @param args {Array} Arguments passed to fire()"," * @return Boolean false if a subscriber returned false"," * @protected"," */"," fireSimple: function(args) {"," this.stopped = 0;"," this.prevented = 0;"," if (this.hasSubs()) {"," var subs = this.getSubs();"," this._procSubs(subs[0], args);"," this._procSubs(subs[1], args);"," }"," this._broadcast(args);"," return this.stopped ? false : true;"," },",""," // Requires the event-custom-complex module for full funcitonality."," fireComplex: function(args) {"," args[0] = args[0] || {};"," return this.fireSimple(args);"," },",""," /**"," * Notifies a list of subscribers."," *"," * @method _procSubs"," * @param subs {Array} List of subscribers"," * @param args {Array} Arguments passed to fire()"," * @param ef {}"," * @return Boolean false if a subscriber returns false or stops the event"," * propagation via e.stopPropagation(),"," * e.stopImmediatePropagation(), or e.halt()"," * @private"," */"," _procSubs: function(subs, args, ef) {"," var s, i, l;",""," for (i = 0, l = subs.length; i < l; i++) {"," s = subs[i];"," if (s && s.fn) {"," if (false === this._notify(s, args, ef)) {"," this.stopped = 2;"," }"," if (this.stopped == 2) {"," return false;"," }"," }"," }",""," return true;"," },",""," /**"," * Notifies the YUI instance if the event is configured with broadcast = 1,"," * and both the YUI instance and Y.Global if configured with broadcast = 2."," *"," * @method _broadcast"," * @param args {Array} Arguments sent to fire()"," * @private"," */"," _broadcast: function(args) {"," if (!this.stopped && this.broadcast) {",""," var a = args.concat();"," a.unshift(this.type);",""," if (this.host !== Y) {"," Y.fire.apply(Y, a);"," }",""," if (this.broadcast == 2) {"," Y.Global.fire.apply(Y.Global, a);"," }"," }"," },",""," /**"," * Removes all listeners"," * @method unsubscribeAll"," * @return {int} The number of listeners unsubscribed."," * @deprecated use detachAll."," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * Removes all listeners"," * @method detachAll"," * @return {int} The number of listeners unsubscribed."," */"," detachAll: function() {"," return this.detach();"," },",""," /**"," * Deletes the subscriber from the internal store of on() and after()"," * subscribers."," *"," * @method _delete"," * @param s subscriber object."," * @param subs (optional) on or after subscriber array"," * @param index (optional) The index found."," * @private"," */"," _delete: function(s, subs, i) {"," var when = s._when;",""," if (!subs) {"," subs = (when === AFTER) ? this._afters : this._subscribers; "," i = YArray.indexOf(subs, s, 0);"," }",""," if (s && subs[i] === s) {"," subs.splice(i, 1);"," }",""," if (this._kds) {"," if (when === AFTER) {"," delete this.afters[s.id];"," } else {"," delete this.subscribers[s.id];"," }"," }",""," if (this.monitored && this.host) {"," this.host._monitor('detach', this, {"," ce: this,"," sub: s"," });"," }",""," if (s) {"," s.deleted = true;"," }"," }","};","/**"," * Stores the subscriber information to be used when the event fires."," * @param {Function} fn The wrapped function to execute."," * @param {Object} context The value of the keyword 'this' in the listener."," * @param {Array} args* 0..n additional arguments to supply the listener."," *"," * @class Subscriber"," * @constructor"," */","Y.Subscriber = function(fn, context, args, when) {",""," /**"," * The callback that will be execute when the event fires"," * This is wrapped by Y.rbind if obj was supplied."," * @property fn"," * @type Function"," */"," this.fn = fn;",""," /**"," * Optional 'this' keyword for the listener"," * @property context"," * @type Object"," */"," this.context = context;",""," /**"," * Unique subscriber id"," * @property id"," * @type String"," */"," this.id = Y.stamp(this);",""," /**"," * Additional arguments to propagate to the subscriber"," * @property args"," * @type Array"," */"," this.args = args;",""," this._when = when;",""," /**"," * Custom events for a given fire transaction."," * @property events"," * @type {EventTarget}"," */"," // this.events = null;",""," /**"," * This listener only reacts to the event once"," * @property once"," */"," // this.once = false;","","};","","Y.Subscriber.prototype = {"," constructor: Y.Subscriber,",""," _notify: function(c, args, ce) {"," if (this.deleted && !this.postponed) {"," if (this.postponed) {"," delete this.fn;"," delete this.context;"," } else {"," delete this.postponed;"," return null;"," }"," }"," var a = this.args, ret;"," switch (ce.signature) {"," case 0:"," ret = this.fn.call(c, ce.type, args, c);"," break;"," case 1:"," ret = this.fn.call(c, args[0] || null, c);"," break;"," default:"," if (a || args) {"," args = args || [];"," a = (a) ? args.concat(a) : args;"," ret = this.fn.apply(c, a);"," } else {"," ret = this.fn.call(c);"," }"," }",""," if (this.once) {"," ce._delete(this);"," }",""," return ret;"," },",""," /**"," * Executes the subscriber."," * @method notify"," * @param args {Array} Arguments array for the subscriber."," * @param ce {CustomEvent} The custom event that sent the notification."," */"," notify: function(args, ce) {"," var c = this.context,"," ret = true;",""," if (!c) {"," c = (ce.contextFn) ? ce.contextFn() : ce.context;"," }",""," // only catch errors if we will not re-throw them."," if (Y.config && Y.config.throwFail) {"," ret = this._notify(c, args, ce);"," } else {"," try {"," ret = this._notify(c, args, ce);"," } catch (e) {"," Y.error(this + ' failed: ' + e.message, e);"," }"," }",""," return ret;"," },",""," /**"," * Returns true if the fn and obj match this objects properties."," * Used by the unsubscribe method to match the right subscriber."," *"," * @method contains"," * @param {Function} fn the function to execute."," * @param {Object} context optional 'this' keyword for the listener."," * @return {boolean} true if the supplied arguments match this"," * subscriber's signature."," */"," contains: function(fn, context) {"," if (context) {"," return ((this.fn == fn) && this.context == context);"," } else {"," return (this.fn == fn);"," }"," },"," "," valueOf : function() {"," return this.id;"," }","","};","/**"," * Return value from all subscribe operations"," * @class EventHandle"," * @constructor"," * @param {CustomEvent} evt the custom event."," * @param {Subscriber} sub the subscriber."," */","Y.EventHandle = function(evt, sub) {",""," /**"," * The custom event"," *"," * @property evt"," * @type CustomEvent"," */"," this.evt = evt;",""," /**"," * The subscriber object"," *"," * @property sub"," * @type Subscriber"," */"," this.sub = sub;","};","","Y.EventHandle.prototype = {"," batch: function(f, c) {"," f.call(c || this, this);"," if (Y.Lang.isArray(this.evt)) {"," Y.Array.each(this.evt, function(h) {"," h.batch.call(c || h, f);"," });"," }"," },",""," /**"," * Detaches this subscriber"," * @method detach"," * @return {int} the number of detached listeners"," */"," detach: function() {"," var evt = this.evt, detached = 0, i;"," if (evt) {"," if (Y.Lang.isArray(evt)) {"," for (i = 0; i < evt.length; i++) {"," detached += evt[i].detach();"," }"," } else {"," evt._delete(this.sub);"," detached = 1;"," }",""," }",""," return detached;"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('attach', 'detach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," return this.evt.monitor.apply(this.evt, arguments);"," }","};","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * EventTarget provides the implementation for any object to"," * publish, subscribe and fire to custom events, and also"," * alows other EventTargets to target the object with events"," * sourced from the other object."," * EventTarget is designed to be used with Y.augment to wrap"," * EventCustom in an interface that allows events to be listened to"," * and fired by name. This makes it possible for implementing code to"," * subscribe to an event that either has not been created yet, or will"," * not be created at all."," * @class EventTarget"," * @param opts a configuration object"," * @config emitFacade {boolean} if true, all events will emit event"," * facade payloads by default (default false)"," * @config prefix {String} the prefix to apply to non-prefixed event names"," */","","var L = Y.Lang,"," PREFIX_DELIMITER = ':',"," CATEGORY_DELIMITER = '|',"," AFTER_PREFIX = '~AFTER~',"," WILD_TYPE_RE = /(.*?)(:)(.*?)/,",""," _wildType = Y.cached(function(type) {"," return type.replace(WILD_TYPE_RE, \"*$2$3\");"," }),",""," /**"," * If the instance has a prefix attribute and the"," * event type is not prefixed, the instance prefix is"," * applied to the supplied type."," * @method _getType"," * @private"," */"," _getType = Y.cached(function(type, pre) {",""," if (!pre || (typeof type !== \"string\") || type.indexOf(PREFIX_DELIMITER) > -1) {"," return type;"," }",""," return pre + PREFIX_DELIMITER + type;"," }),",""," /**"," * Returns an array with the detach key (if provided),"," * and the prefixed event name from _getType"," * Y.on('detachcategory| menu:click', fn)"," * @method _parseType"," * @private"," */"," _parseType = Y.cached(function(type, pre) {",""," var t = type, detachcategory, after, i;",""," if (!L.isString(t)) {"," return t;"," }",""," i = t.indexOf(AFTER_PREFIX);",""," if (i > -1) {"," after = true;"," t = t.substr(AFTER_PREFIX.length);"," }",""," i = t.indexOf(CATEGORY_DELIMITER);",""," if (i > -1) {"," detachcategory = t.substr(0, (i));"," t = t.substr(i+1);"," if (t == '*') {"," t = null;"," }"," }",""," // detach category, full type with instance prefix, is this an after listener, short type"," return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];"," }),",""," ET = function(opts) {","",""," var o = (L.isObject(opts)) ? opts : {};",""," this._yuievt = this._yuievt || {",""," id: Y.guid(),",""," events: {},",""," targets: {},",""," config: o,",""," chain: ('chain' in o) ? o.chain : Y.config.chain,",""," bubbling: false,",""," defaults: {"," context: o.context || this,"," host: this,"," emitFacade: o.emitFacade,"," fireOnce: o.fireOnce,"," queuable: o.queuable,"," monitored: o.monitored,"," broadcast: o.broadcast,"," defaultTargetOnly: o.defaultTargetOnly,"," bubbles: ('bubbles' in o) ? o.bubbles : true"," }"," };"," };","","","ET.prototype = {"," constructor: ET,",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>on</code> except the"," * listener is immediatelly detached when it is executed."," * @method once"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," once: function() {"," var handle = this.on.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>after</code> except the"," * listener is immediatelly detached when it is executed."," * @method onceAfter"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," onceAfter: function() {"," var handle = this.after.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Takes the type parameter passed to 'on' and parses out the"," * various pieces that could be included in the type. If the"," * event type is passed without a prefix, it will be expanded"," * to include the prefix one is supplied or the event target"," * is configured with a default prefix."," * @method parseType"," * @param {String} type the type"," * @param {String} [pre=this._yuievt.config.prefix] the prefix"," * @since 3.3.0"," * @return {Array} an array containing:"," * * the detach category, if supplied,"," * * the prefixed event type,"," * * whether or not this is an after listener,"," * * the supplied event type"," */"," parseType: function(type, pre) {"," return _parseType(type, pre || this._yuievt.config.prefix);"," },",""," /**"," * Subscribe a callback function to a custom event fired by this object or"," * from an object that bubbles its events to this object."," *"," * Callback functions for events published with `emitFacade = true` will"," * receive an `EventFacade` as the first argument (typically named \"e\")."," * These callbacks can then call `e.preventDefault()` to disable the"," * behavior published to that event's `defaultFn`. See the `EventFacade`"," * API for all available properties and methods. Subscribers to"," * non-`emitFacade` events will receive the arguments passed to `fire()`"," * after the event name."," *"," * To subscribe to multiple events at once, pass an object as the first"," * argument, where the key:value pairs correspond to the eventName:callback,"," * or pass an array of event names as the first argument to subscribe to"," * all listed events with the same callback."," *"," * Returning `false` from a callback is supported as an alternative to"," * calling `e.preventDefault(); e.stopPropagation();`. However, it is"," * recommended to use the event methods whenever possible."," *"," * @method on"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," on: function(type, fn, context) {",""," var yuievt = this._yuievt,"," parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,"," detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,"," Node = Y.Node, n, domevent, isArr;",""," // full name, args, detachcategory, after"," this._monitor('attach', parts[1], {"," args: arguments,"," category: parts[0],"," after: parts[2]"," });",""," if (L.isObject(type)) {",""," if (L.isFunction(type)) {"," return Y.Do.before.apply(Y.Do, arguments);"," }",""," f = fn;"," c = context;"," args = nativeSlice.call(arguments, 0);"," ret = [];",""," if (L.isArray(type)) {"," isArr = true;"," }",""," after = type._after;"," delete type._after;",""," Y.each(type, function(v, k) {",""," if (L.isObject(v)) {"," f = v.fn || ((L.isFunction(v)) ? v : f);"," c = v.context || c;"," }",""," var nv = (after) ? AFTER_PREFIX : '';",""," args[0] = nv + ((isArr) ? v : k);"," args[1] = f;"," args[2] = c;",""," ret.push(this.on.apply(this, args));",""," }, this);",""," return (yuievt.chain) ? this : new Y.EventHandle(ret);"," }",""," detachcategory = parts[0];"," after = parts[2];"," shorttype = parts[3];",""," // extra redirection so we catch adaptor events too. take a look at this."," if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {"," args = nativeSlice.call(arguments, 0);"," args.splice(2, 0, Node.getDOMNode(this));"," return Y.on.apply(Y, args);"," }",""," type = parts[1];",""," if (Y.instanceOf(this, YUI)) {",""," adapt = Y.Env.evt.plugins[type];"," args = nativeSlice.call(arguments, 0);"," args[0] = shorttype;",""," if (Node) {"," n = args[2];",""," if (Y.instanceOf(n, Y.NodeList)) {"," n = Y.NodeList.getDOMNodes(n);"," } else if (Y.instanceOf(n, Node)) {"," n = Node.getDOMNode(n);"," }",""," domevent = (shorttype in Node.DOM_EVENTS);",""," // Captures both DOM events and event plugins."," if (domevent) {"," args[2] = n;"," }"," }",""," // check for the existance of an event adaptor"," if (adapt) {"," handle = adapt.on.apply(Y, args);"," } else if ((!type) || domevent) {"," handle = Y.Event._attach(args);"," }",""," }",""," if (!handle) {"," ce = yuievt.events[type] || this.publish(type);"," handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);"," }",""," if (detachcategory) {"," store[detachcategory] = store[detachcategory] || {};"," store[detachcategory][type] = store[detachcategory][type] || [];"," store[detachcategory][type].push(handle);"," }",""," return (yuievt.chain) ? this : handle;",""," },",""," /**"," * subscribe to an event"," * @method subscribe"," * @deprecated use on"," */"," subscribe: function() {"," return this.on.apply(this, arguments);"," },",""," /**"," * Detach one or more listeners the from the specified event"," * @method detach"," * @param type {string|Object} Either the handle to the subscriber or the"," * type of event. If the type"," * is not specified, it will attempt to remove"," * the listener from all hosted events."," * @param fn {Function} The subscribed function to unsubscribe, if not"," * supplied, all subscribers will be removed."," * @param context {Object} The custom object passed to subscribe. This is"," * optional, but if supplied will be used to"," * disambiguate multiple listeners that are the same"," * (e.g., you subscribe many object using a function"," * that lives on the prototype)"," * @return {EventTarget} the host"," */"," detach: function(type, fn, context) {"," var evts = this._yuievt.events, i,"," Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));",""," // detachAll disabled on the Y instance."," if (!type && (this !== Y)) {"," for (i in evts) {"," if (evts.hasOwnProperty(i)) {"," evts[i].detach(fn, context);"," }"," }"," if (isNode) {"," Y.Event.purgeElement(Node.getDOMNode(this));"," }",""," return this;"," }",""," var parts = _parseType(type, this._yuievt.config.prefix),"," detachcategory = L.isArray(parts) ? parts[0] : null,"," shorttype = (parts) ? parts[3] : null,"," adapt, store = Y.Env.evt.handles, detachhost, cat, args,"," ce,",""," keyDetacher = function(lcat, ltype, host) {"," var handles = lcat[ltype], ce, i;"," if (handles) {"," for (i = handles.length - 1; i >= 0; --i) {"," ce = handles[i].evt;"," if (ce.host === host || ce.el === host) {"," handles[i].detach();"," }"," }"," }"," };",""," if (detachcategory) {",""," cat = store[detachcategory];"," type = parts[1];"," detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;",""," if (cat) {"," if (type) {"," keyDetacher(cat, type, detachhost);"," } else {"," for (i in cat) {"," if (cat.hasOwnProperty(i)) {"," keyDetacher(cat, i, detachhost);"," }"," }"," }",""," return this;"," }",""," // If this is an event handle, use it to detach"," } else if (L.isObject(type) && type.detach) {"," type.detach();"," return this;"," // extra redirection so we catch adaptor events too. take a look at this."," } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {"," args = nativeSlice.call(arguments, 0);"," args[2] = Node.getDOMNode(this);"," Y.detach.apply(Y, args);"," return this;"," }",""," adapt = Y.Env.evt.plugins[shorttype];",""," // The YUI instance handles DOM events and adaptors"," if (Y.instanceOf(this, YUI)) {"," args = nativeSlice.call(arguments, 0);"," // use the adaptor specific detach code if"," if (adapt && adapt.detach) {"," adapt.detach.apply(Y, args);"," return this;"," // DOM event fork"," } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {"," args[0] = type;"," Y.Event.detach.apply(Y.Event, args);"," return this;"," }"," }",""," // ce = evts[type];"," ce = evts[parts[1]];"," if (ce) {"," ce.detach(fn, context);"," }",""," return this;"," },",""," /**"," * detach a listener"," * @method unsubscribe"," * @deprecated use detach"," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * Removes all listeners from the specified event. If the event type"," * is not specified, all listeners from all hosted custom events will"," * be removed."," * @method detachAll"," * @param type {String} The type, or name of the event"," */"," detachAll: function(type) {"," return this.detach(type);"," },",""," /**"," * Removes all listeners from the specified event. If the event type"," * is not specified, all listeners from all hosted custom events will"," * be removed."," * @method unsubscribeAll"," * @param type {String} The type, or name of the event"," * @deprecated use detachAll"," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * Creates a new custom event of the specified type. If a custom event"," * by that name already exists, it will not be re-created. In either"," * case the custom event is returned."," *"," * @method publish"," *"," * @param type {String} the type, or name of the event"," * @param opts {object} optional config params. Valid properties are:"," *"," * <ul>"," * <li>"," * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false)"," * </li>"," * <li>"," * 'bubbles': whether or not this event bubbles (true)"," * Events can only bubble if emitFacade is true."," * </li>"," * <li>"," * 'context': the default execution context for the listeners (this)"," * </li>"," * <li>"," * 'defaultFn': the default function to execute when this event fires if preventDefault was not called"," * </li>"," * <li>"," * 'emitFacade': whether or not this event emits a facade (false)"," * </li>"," * <li>"," * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click'"," * </li>"," * <li>"," * 'fireOnce': if an event is configured to fire once, new subscribers after"," * the fire will be notified immediately."," * </li>"," * <li>"," * 'async': fireOnce event listeners will fire synchronously if the event has already"," * fired unless async is true."," * </li>"," * <li>"," * 'preventable': whether or not preventDefault() has an effect (true)"," * </li>"," * <li>"," * 'preventedFn': a function that is executed when preventDefault is called"," * </li>"," * <li>"," * 'queuable': whether or not this event can be queued during bubbling (false)"," * </li>"," * <li>"," * 'silent': if silent is true, debug messages are not provided for this event."," * </li>"," * <li>"," * 'stoppedFn': a function that is executed when stopPropagation is called"," * </li>"," *"," * <li>"," * 'monitored': specifies whether or not this event should send notifications about"," * when the event has been attached, detached, or published."," * </li>"," * <li>"," * 'type': the event type (valid option if not provided as the first parameter to publish)"," * </li>"," * </ul>"," *"," * @return {CustomEvent} the custom event"," *"," */"," publish: function(type, opts) {"," var events, ce, ret, defaults,"," edata = this._yuievt,"," pre = edata.config.prefix;",""," if (L.isObject(type)) {"," ret = {};"," Y.each(type, function(v, k) {"," ret[k] = this.publish(k, v || opts);"," }, this);",""," return ret;"," }",""," type = (pre) ? _getType(type, pre) : type;",""," events = edata.events;"," ce = events[type];",""," this._monitor('publish', type, {"," args: arguments"," });",""," if (ce) {"," // ce.log(\"publish applying new config to published event: '\"+type+\"' exists\", 'info', 'event');"," if (opts) {"," ce.applyConfig(opts, true);"," }"," } else {"," // TODO: Lazy publish goes here."," defaults = edata.defaults;",""," // apply defaults"," ce = new Y.CustomEvent(type, defaults);"," if (opts) {"," ce.applyConfig(opts, true);"," }",""," events[type] = ce;"," }",""," // make sure we turn the broadcast flag off if this"," // event was published as a result of bubbling"," // if (opts instanceof Y.CustomEvent) {"," // events[type].broadcast = false;"," // }",""," return events[type];"," },",""," /**"," * This is the entry point for the event monitoring system."," * You can monitor 'attach', 'detach', 'fire', and 'publish'."," * When configured, these events generate an event. click ->"," * click_attach, click_detach, click_publish -- these can"," * be subscribed to like other events to monitor the event"," * system. Inividual published events can have monitoring"," * turned on or off (publish can't be turned off before it"," * it published) by setting the events 'monitor' config."," *"," * @method _monitor"," * @param what {String} 'attach', 'detach', 'fire', or 'publish'"," * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object."," * @param o {Object} Information about the event interaction, such as"," * fire() args, subscription category, publish config"," * @private"," */"," _monitor: function(what, eventType, o) {"," var monitorevt, ce, type;",""," if (eventType) {"," if (typeof eventType === \"string\") {"," type = eventType;"," ce = this.getEvent(eventType, true);"," } else {"," ce = eventType;"," type = eventType.type;"," }",""," if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {"," monitorevt = type + '_' + what;"," o.monitored = what;"," this.fire.call(this, monitorevt, o);"," }"," }"," },",""," /**"," * Fire a custom event by name. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters."," *"," * If the custom event object hasn't been created, then the event hasn't"," * been published and it has no subscribers. For performance sake, we"," * immediate exit in this case. This means the event won't bubble, so"," * if the intention is that a bubble target be notified, the event must"," * be published on this object first."," *"," * The first argument is the event type, and any additional arguments are"," * passed to the listeners as parameters. If the first of these is an"," * object literal, and the event is configured to emit an event facade,"," * that object is mixed into the event facade and the facade is provided"," * in place of the original object."," *"," * @method fire"," * @param type {String|Object} The type of the event, or an object that contains"," * a 'type' property."," * @param arguments {Object*} an arbitrary set of parameters to pass to"," * the handler. If the first of these is an object literal and the event is"," * configured to emit an event facade, the event facade will replace that"," * parameter after the properties the object literal contains are copied to"," * the event facade."," * @return {EventTarget} the event host"," */"," fire: function(type) {",""," var typeIncluded = L.isString(type),"," t = (typeIncluded) ? type : (type && type.type),"," yuievt = this._yuievt,"," pre = yuievt.config.prefix, "," ce, ret, "," ce2,"," args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;",""," t = (pre) ? _getType(t, pre) : t;",""," ce = this.getEvent(t, true);"," ce2 = this.getSibling(t, ce);",""," if (ce2 && !ce) {"," ce = this.publish(t);"," }",""," this._monitor('fire', (ce || t), {"," args: args"," });",""," // this event has not been published or subscribed to"," if (!ce) {"," if (yuievt.hasTargets) {"," return this.bubble({ type: t }, args, this);"," }",""," // otherwise there is nothing to be done"," ret = true;"," } else {"," ce.sibling = ce2;"," ret = ce.fire.apply(ce, args);"," }",""," return (yuievt.chain) ? this : ret;"," },",""," getSibling: function(type, ce) {"," var ce2;"," // delegate to *:type events if there are subscribers"," if (type.indexOf(PREFIX_DELIMITER) > -1) {"," type = _wildType(type);"," // console.log(type);"," ce2 = this.getEvent(type, true);"," if (ce2) {"," // console.log(\"GOT ONE: \" + type);"," ce2.applyConfig(ce);"," ce2.bubbles = false;"," ce2.broadcast = 0;"," // ret = ce2.fire.apply(ce2, a);"," }"," }",""," return ce2;"," },",""," /**"," * Returns the custom event of the provided type has been created, a"," * falsy value otherwise"," * @method getEvent"," * @param type {String} the type, or name of the event"," * @param prefixed {String} if true, the type is prefixed already"," * @return {CustomEvent} the custom event or null"," */"," getEvent: function(type, prefixed) {"," var pre, e;"," if (!prefixed) {"," pre = this._yuievt.config.prefix;"," type = (pre) ? _getType(type, pre) : type;"," }"," e = this._yuievt.events;"," return e[type] || null;"," },",""," /**"," * Subscribe to a custom event hosted by this object. The"," * supplied callback will execute after any listeners add"," * via the subscribe method, and after the default function,"," * if configured for the event, has executed."," *"," * @method after"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," after: function(type, fn) {",""," var a = nativeSlice.call(arguments, 0);",""," switch (L.type(type)) {"," case 'function':"," return Y.Do.after.apply(Y.Do, arguments);"," case 'array':"," // YArray.each(a[0], function(v) {"," // v = AFTER_PREFIX + v;"," // });"," // break;"," case 'object':"," a[0]._after = true;"," break;"," default:"," a[0] = AFTER_PREFIX + type;"," }",""," return this.on.apply(this, a);",""," },",""," /**"," * Executes the callback before a DOM event, custom event"," * or method. If the first argument is a function, it"," * is assumed the target is a method. For DOM and custom"," * events, this is an alias for Y.on."," *"," * For DOM and custom events:"," * type, callback, context, 0-n arguments"," *"," * For methods:"," * callback, object (method host), methodName, context, 0-n arguments"," *"," * @method before"," * @return detach handle"," */"," before: function() {"," return this.on.apply(this, arguments);"," }","","};","","Y.EventTarget = ET;","","// make Y an event target","Y.mix(Y, ET.prototype);","ET.call(Y, { bubbles: false });","","YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();","","/**"," * Hosts YUI page level events. This is where events bubble to"," * when the broadcast config is set to 2. This property is"," * only available if the custom event module is loaded."," * @property Global"," * @type EventTarget"," * @for YUI"," */","Y.Global = YUI.Env.globalEvents;","","// @TODO implement a global namespace function on Y.Global?","","/**","`Y.on()` can do many things:","","<ul>"," <li>Subscribe to custom events `publish`ed and `fire`d from Y</li>"," <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and"," `fire`d from any object in the YUI instance sandbox</li>"," <li>Subscribe to DOM events</li>"," <li>Subscribe to the execution of a method on any object, effectively"," treating that method as an event</li>","</ul>","","For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.",""," Y.on('io:complete', function () {"," Y.MyApp.updateStatus('Transaction complete');"," });","","To subscribe to DOM events, pass the name of a DOM event as the first argument","and a CSS selector string as the third argument after the callback function.","Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,","array, or simply omitted (the default is the `window` object).",""," Y.on('click', function (e) {"," e.preventDefault();",""," // proceed with ajax form submission"," var url = this.get('action');"," ..."," }, '#my-form');","","The `this` object in DOM event callbacks will be the `Node` targeted by the CSS","selector or other identifier.","","`on()` subscribers for DOM events or custom events `publish`ed with a","`defaultFn` can prevent the default behavior with `e.preventDefault()` from the","event object passed as the first parameter to the subscription callback.","","To subscribe to the execution of an object method, pass arguments corresponding to the call signature for ","<a href=\"../classes/Do.html#methods_before\">`Y.Do.before(...)`</a>.","","NOTE: The formal parameter list below is for events, not for function","injection. See `Y.Do.before` for that signature.","","@method on","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@see Do.before","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `on()`, except that","the listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see on","@method once","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `once()`, except, like `after()`,","the subscription callback executes after all `on()` subscribers and the event's","`defaultFn` (if configured) have executed. Like `after()` if any `on()` phase","subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`","subscribers will execute.","","The listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see once","@method onceAfter","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Like `on()`, this method creates a subscription to a custom event or to the","execution of a method on an object.","","For events, `after()` subscribers are executed after the event's","`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","NOTE: The subscription signature shown is for events, not for function","injection. See <a href=\"../classes/Do.html#methods_after\">`Y.Do.after`</a>","for that signature.","","@see on","@see Do.after","@method after","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [args*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","","}, '@VERSION@', {\"requires\": [\"oop\"]});"];
_yuitest_coverage["build/event-custom-base/event-custom-base.js"].lines = {"1":0,"9":0,"29":0,"76":0,"77":0,"78":0,"79":0,"82":0,"113":0,"114":0,"115":0,"116":0,"119":0,"138":0,"140":0,"142":0,"145":0,"147":0,"149":0,"152":0,"153":0,"158":0,"161":0,"163":0,"174":0,"175":0,"183":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"230":0,"231":0,"232":0,"234":0,"245":0,"246":0,"247":0,"264":0,"266":0,"273":0,"274":0,"275":0,"276":0,"277":0,"279":0,"281":0,"282":0,"284":0,"285":0,"293":0,"294":0,"297":0,"298":0,"301":0,"302":0,"303":0,"305":0,"306":0,"308":0,"309":0,"311":0,"316":0,"332":0,"333":0,"334":0,"346":0,"347":0,"348":0,"361":0,"362":0,"363":0,"374":0,"375":0,"388":0,"405":0,"439":0,"441":0,"442":0,"443":0,"447":0,"460":0,"462":0,"464":0,"466":0,"473":0,"481":0,"491":0,"509":0,"527":0,"528":0,"537":0,"544":0,"545":0,"554":0,"651":0,"663":0,"672":0,"689":0,"717":0,"719":0,"721":0,"733":0,"735":0,"736":0,"737":0,"740":0,"741":0,"744":0,"756":0,"757":0,"759":0,"760":0,"769":0,"771":0,"772":0,"774":0,"785":0,"804":0,"806":0,"807":0,"808":0,"810":0,"814":0,"815":0,"817":0,"820":0,"821":0,"822":0,"824":0,"828":0,"839":0,"840":0,"853":0,"855":0,"856":0,"860":0,"875":0,"876":0,"889":0,"890":0,"893":0,"898":0,"899":0,"900":0,"901":0,"902":0,"906":0,"907":0,"908":0,"909":0,"910":0,"914":0,"927":0,"940":0,"942":0,"944":0,"945":0,"948":0,"978":0,"979":0,"982":0,"987":0,"989":0,"990":0,"993":0,"994":0,"996":0,"1010":0,"1011":0,"1012":0,"1013":0,"1014":0,"1015":0,"1017":0,"1018":0,"1023":0,"1024":0,"1040":0,"1042":0,"1043":0,"1044":0,"1045":0,"1046":0,"1048":0,"1049":0,"1054":0,"1066":0,"1068":0,"1069":0,"1071":0,"1072":0,"1075":0,"1076":0,"1088":0,"1097":0,"1111":0,"1113":0,"1114":0,"1115":0,"1118":0,"1119":0,"1122":0,"1123":0,"1124":0,"1126":0,"1130":0,"1131":0,"1137":0,"1138":0,"1151":0,"1159":0,"1166":0,"1173":0,"1180":0,"1182":0,"1199":0,"1203":0,"1204":0,"1205":0,"1206":0,"1208":0,"1209":0,"1212":0,"1213":0,"1215":0,"1216":0,"1218":0,"1219":0,"1221":0,"1222":0,"1223":0,"1224":0,"1226":0,"1230":0,"1231":0,"1234":0,"1244":0,"1247":0,"1248":0,"1252":0,"1253":0,"1255":0,"1256":0,"1258":0,"1262":0,"1276":0,"1277":0,"1279":0,"1284":0,"1295":0,"1303":0,"1311":0,"1314":0,"1316":0,"1317":0,"1318":0,"1319":0,"1330":0,"1331":0,"1332":0,"1333":0,"1334":0,"1337":0,"1338":0,"1343":0,"1355":0,"1383":0,"1390":0,"1402":0,"1403":0,"1406":0,"1418":0,"1420":0,"1421":0,"1424":0,"1426":0,"1427":0,"1428":0,"1431":0,"1433":0,"1434":0,"1435":0,"1436":0,"1437":0,"1442":0,"1448":0,"1450":0,"1479":0,"1495":0,"1496":0,"1497":0,"1498":0,"1501":0,"1517":0,"1518":0,"1519":0,"1520":0,"1523":0,"1543":0,"1577":0,"1583":0,"1589":0,"1591":0,"1592":0,"1595":0,"1596":0,"1597":0,"1598":0,"1600":0,"1601":0,"1604":0,"1605":0,"1607":0,"1609":0,"1610":0,"1611":0,"1614":0,"1616":0,"1617":0,"1618":0,"1620":0,"1624":0,"1627":0,"1628":0,"1629":0,"1632":0,"1633":0,"1634":0,"1635":0,"1638":0,"1640":0,"1642":0,"1643":0,"1644":0,"1646":0,"1647":0,"1649":0,"1650":0,"1651":0,"1652":0,"1655":0,"1658":0,"1659":0,"1664":0,"1665":0,"1666":0,"1667":0,"1672":0,"1673":0,"1674":0,"1677":0,"1678":0,"1679":0,"1680":0,"1683":0,"1693":0,"1713":0,"1717":0,"1718":0,"1719":0,"1720":0,"1723":0,"1724":0,"1727":0,"1730":0,"1737":0,"1738":0,"1739":0,"1740":0,"1741":0,"1742":0,"1748":0,"1750":0,"1751":0,"1752":0,"1754":0,"1755":0,"1756":0,"1758":0,"1759":0,"1760":0,"1765":0,"1769":0,"1770":0,"1771":0,"1773":0,"1774":0,"1775":0,"1776":0,"1777":0,"1780":0,"1783":0,"1784":0,"1786":0,"1787":0,"1788":0,"1790":0,"1791":0,"1792":0,"1793":0,"1798":0,"1799":0,"1800":0,"1803":0,"1812":0,"1823":0,"1835":0,"1905":0,"1909":0,"1910":0,"1911":0,"1912":0,"1915":0,"1918":0,"1920":0,"1921":0,"1923":0,"1927":0,"1929":0,"1930":0,"1934":0,"1937":0,"1938":0,"1939":0,"1942":0,"1951":0,"1972":0,"1974":0,"1975":0,"1976":0,"1977":0,"1979":0,"1980":0,"1983":0,"1984":0,"1985":0,"1986":0,"2020":0,"2028":0,"2030":0,"2031":0,"2033":0,"2034":0,"2037":0,"2042":0,"2043":0,"2044":0,"2048":0,"2050":0,"2051":0,"2054":0,"2058":0,"2060":0,"2061":0,"2063":0,"2064":0,"2066":0,"2067":0,"2068":0,"2073":0,"2085":0,"2086":0,"2087":0,"2088":0,"2090":0,"2091":0,"2110":0,"2112":0,"2114":0,"2121":0,"2122":0,"2124":0,"2127":0,"2147":0,"2152":0,"2155":0,"2156":0,"2158":0,"2168":0};
_yuitest_coverage["build/event-custom-base/event-custom-base.js"].functions = {"before:75":0,"after:112":0,"]:152":0,"_inject:136":0,"detach:173":0,"Method:215":0,"register:230":0,"_delete:245":0,"exec:264":0,"AlterArgs:332":0,"AlterReturn:346":0,"Halt:361":0,"Prevent:374":0,"mixConfigs:438":0,"CustomEvent:460":0,"hasSubs:732":0,"monitor:755":0,"getSubs:768":0,"applyConfig:784":0,"_on:801":0,"subscribe:838":0,"on:852":0,"after:874":0,"detach:887":0,"unsubscribe:926":0,"_notify:937":0,"fire:977":0,"fireSimple:1009":0,"fireComplex:1022":0,"_procSubs:1039":0,"_broadcast:1065":0,"unsubscribeAll:1087":0,"detachAll:1096":0,"_delete:1110":0,"Subscriber:1151":0,"_notify:1202":0,"notify:1243":0,"contains:1275":0,"valueOf:1283":0,"EventHandle:1295":0,"(anonymous 2):1318":0,"batch:1315":0,"detach:1329":0,"monitor:1354":0,"(anonymous 3):1389":0,"(anonymous 4):1400":0,"(anonymous 5):1416":0,"ET:1445":0,"(anonymous 6):1496":0,"once:1494":0,"(anonymous 7):1518":0,"onceAfter:1516":0,"parseType:1542":0,"(anonymous 8):1607":0,"on:1575":0,"subscribe:1692":0,"keyDetacher:1736":0,"detach:1712":0,"unsubscribe:1811":0,"detachAll:1822":0,"unsubscribeAll:1834":0,"(anonymous 9):1911":0,"publish:1904":0,"_monitor:1971":0,"fire:2018":0,"getSibling:2057":0,"getEvent:2084":0,"after:2108":0,"before:2146":0,"(anonymous 1):1":0};
_yuitest_coverage["build/event-custom-base/event-custom-base.js"].coveredLines = 482;
_yuitest_coverage["build/event-custom-base/event-custom-base.js"].coveredFunctions = 70;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1);
YUI.add('event-custom-base', function (Y, NAME) {
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
* @module event-custom
*/
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 1)", 1);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 9);
Y.Env.evt = {
handles: {},
plugins: {}
};
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
* @module event-custom
* @submodule event-custom-base
*/
/**
* Allows for the insertion of methods that are executed before or after
* a specified method
* @class Do
* @static
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 29);
var DO_BEFORE = 0,
DO_AFTER = 1,
DO = {
/**
* Cache of objects touched by the utility
* @property objs
* @static
* @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
* replaces the role of this property, but is considered to be private, and
* is only mentioned to provide a migration path.
*
* If you have a use case which warrants migration to the _yuiaop property,
* please file a ticket to let us know what it's used for and we can see if
* we need to expose hooks for that functionality more formally.
*/
objs: null,
/**
* <p>Execute the supplied method before the specified function. Wrapping
* function may optionally return an instance of the following classes to
* further alter runtime behavior:</p>
* <dl>
* <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
* <dd>Immediatly stop execution and return
* <code>returnValue</code>. No other wrapping functions will be
* executed.</dd>
* <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>
* <dd>Replace the arguments that the original function will be
* called with.</dd>
* <dt></code>Y.Do.Prevent(message)</code></dt>
* <dd>Don't execute the wrapped function. Other before phase
* wrappers will be executed.</dd>
* </dl>
*
* @method before
* @param fn {Function} the function to execute
* @param obj the object hosting the method to displace
* @param sFn {string} the name of the method to displace
* @param c The execution context for fn
* @param arg* {mixed} 0..n additional arguments to supply to the subscriber
* when the event fires.
* @return {string} handle for the subscription
* @static
*/
before: function(fn, obj, sFn, c) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "before", 75);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 76);
var f = fn, a;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 77);
if (c) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 78);
a = [fn, c].concat(Y.Array(arguments, 4, true));
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 79);
f = Y.rbind.apply(Y, a);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 82);
return this._inject(DO_BEFORE, f, obj, sFn);
},
/**
* <p>Execute the supplied method after the specified function. Wrapping
* function may optionally return an instance of the following classes to
* further alter runtime behavior:</p>
* <dl>
* <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
* <dd>Immediatly stop execution and return
* <code>returnValue</code>. No other wrapping functions will be
* executed.</dd>
* <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>
* <dd>Return <code>returnValue</code> instead of the wrapped
* method's original return value. This can be further altered by
* other after phase wrappers.</dd>
* </dl>
*
* <p>The static properties <code>Y.Do.originalRetVal</code> and
* <code>Y.Do.currentRetVal</code> will be populated for reference.</p>
*
* @method after
* @param fn {Function} the function to execute
* @param obj the object hosting the method to displace
* @param sFn {string} the name of the method to displace
* @param c The execution context for fn
* @param arg* {mixed} 0..n additional arguments to supply to the subscriber
* @return {string} handle for the subscription
* @static
*/
after: function(fn, obj, sFn, c) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "after", 112);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 113);
var f = fn, a;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 114);
if (c) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 115);
a = [fn, c].concat(Y.Array(arguments, 4, true));
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 116);
f = Y.rbind.apply(Y, a);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 119);
return this._inject(DO_AFTER, f, obj, sFn);
},
/**
* Execute the supplied method before or after the specified function.
* Used by <code>before</code> and <code>after</code>.
*
* @method _inject
* @param when {string} before or after
* @param fn {Function} the function to execute
* @param obj the object hosting the method to displace
* @param sFn {string} the name of the method to displace
* @param c The execution context for fn
* @return {string} handle for the subscription
* @private
* @static
*/
_inject: function(when, fn, obj, sFn) {
// object id
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_inject", 136);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 138);
var id = Y.stamp(obj), o, sid;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 140);
if (!obj._yuiaop) {
// create a map entry for the obj if it doesn't exist, to hold overridden methods
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 142);
obj._yuiaop = {};
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 145);
o = obj._yuiaop;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 147);
if (!o[sFn]) {
// create a map entry for the method if it doesn't exist
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 149);
o[sFn] = new Y.Do.Method(obj, sFn);
// re-route the method to our wrapper
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 152);
obj[sFn] = function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "]", 152);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 153);
return o[sFn].exec.apply(o[sFn], arguments);
};
}
// subscriber id
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 158);
sid = id + Y.stamp(fn) + sFn;
// register the callback
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 161);
o[sFn].register(sid, fn, when);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 163);
return new Y.EventHandle(o[sFn], sid);
},
/**
* Detach a before or after subscription.
*
* @method detach
* @param handle {string} the subscription handle
* @static
*/
detach: function(handle) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detach", 173);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 174);
if (handle.detach) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 175);
handle.detach();
}
},
_unload: function(e, me) {
}
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 183);
Y.Do = DO;
//////////////////////////////////////////////////////////////////////////
/**
* Contains the return value from the wrapped method, accessible
* by 'after' event listeners.
*
* @property originalRetVal
* @static
* @since 3.2.0
*/
/**
* Contains the current state of the return value, consumable by
* 'after' event listeners, and updated if an after subscriber
* changes the return value generated by the wrapped function.
*
* @property currentRetVal
* @static
* @since 3.2.0
*/
//////////////////////////////////////////////////////////////////////////
/**
* Wrapper for a displaced method with aop enabled
* @class Do.Method
* @constructor
* @param obj The object to operate on
* @param sFn The name of the method to displace
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 215);
DO.Method = function(obj, sFn) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "Method", 215);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 216);
this.obj = obj;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 217);
this.methodName = sFn;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 218);
this.method = obj[sFn];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 219);
this.before = {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 220);
this.after = {};
};
/**
* Register a aop subscriber
* @method register
* @param sid {string} the subscriber id
* @param fn {Function} the function to execute
* @param when {string} when to execute the function
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 230);
DO.Method.prototype.register = function (sid, fn, when) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "register", 230);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 231);
if (when) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 232);
this.after[sid] = fn;
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 234);
this.before[sid] = fn;
}
};
/**
* Unregister a aop subscriber
* @method delete
* @param sid {string} the subscriber id
* @param fn {Function} the function to execute
* @param when {string} when to execute the function
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 245);
DO.Method.prototype._delete = function (sid) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_delete", 245);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 246);
delete this.before[sid];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 247);
delete this.after[sid];
};
/**
* <p>Execute the wrapped method. All arguments are passed into the wrapping
* functions. If any of the before wrappers return an instance of
* <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped
* function nor any after phase subscribers will be executed.</p>
*
* <p>The return value will be the return value of the wrapped function or one
* provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or
* <code>Y.Do.AlterReturn</code>.
*
* @method exec
* @param arg* {any} Arguments are passed to the wrapping and wrapped functions
* @return {any} Return value of wrapped function unless overwritten (see above)
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 264);
DO.Method.prototype.exec = function () {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "exec", 264);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 266);
var args = Y.Array(arguments, 0, true),
i, ret, newRet,
bf = this.before,
af = this.after,
prevented = false;
// execute before
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 273);
for (i in bf) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 274);
if (bf.hasOwnProperty(i)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 275);
ret = bf[i].apply(this.obj, args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 276);
if (ret) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 277);
switch (ret.constructor) {
case DO.Halt:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 279);
return ret.retVal;
case DO.AlterArgs:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 281);
args = ret.newArgs;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 282);
break;
case DO.Prevent:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 284);
prevented = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 285);
break;
default:
}
}
}
}
// execute method
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 293);
if (!prevented) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 294);
ret = this.method.apply(this.obj, args);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 297);
DO.originalRetVal = ret;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 298);
DO.currentRetVal = ret;
// execute after methods.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 301);
for (i in af) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 302);
if (af.hasOwnProperty(i)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 303);
newRet = af[i].apply(this.obj, args);
// Stop processing if a Halt object is returned
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 305);
if (newRet && newRet.constructor == DO.Halt) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 306);
return newRet.retVal;
// Check for a new return value
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 308);
if (newRet && newRet.constructor == DO.AlterReturn) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 309);
ret = newRet.newRetVal;
// Update the static retval state
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 311);
DO.currentRetVal = ret;
}}
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 316);
return ret;
};
//////////////////////////////////////////////////////////////////////////
/**
* Return an AlterArgs object when you want to change the arguments that
* were passed into the function. Useful for Do.before subscribers. An
* example would be a service that scrubs out illegal characters prior to
* executing the core business logic.
* @class Do.AlterArgs
* @constructor
* @param msg {String} (optional) Explanation of the altered return value
* @param newArgs {Array} Call parameters to be used for the original method
* instead of the arguments originally passed in.
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 332);
DO.AlterArgs = function(msg, newArgs) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "AlterArgs", 332);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 333);
this.msg = msg;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 334);
this.newArgs = newArgs;
};
/**
* Return an AlterReturn object when you want to change the result returned
* from the core method to the caller. Useful for Do.after subscribers.
* @class Do.AlterReturn
* @constructor
* @param msg {String} (optional) Explanation of the altered return value
* @param newRetVal {any} Return value passed to code that invoked the wrapped
* function.
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 346);
DO.AlterReturn = function(msg, newRetVal) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "AlterReturn", 346);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 347);
this.msg = msg;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 348);
this.newRetVal = newRetVal;
};
/**
* Return a Halt object when you want to terminate the execution
* of all subsequent subscribers as well as the wrapped method
* if it has not exectued yet. Useful for Do.before subscribers.
* @class Do.Halt
* @constructor
* @param msg {String} (optional) Explanation of why the termination was done
* @param retVal {any} Return value passed to code that invoked the wrapped
* function.
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 361);
DO.Halt = function(msg, retVal) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "Halt", 361);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 362);
this.msg = msg;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 363);
this.retVal = retVal;
};
/**
* Return a Prevent object when you want to prevent the wrapped function
* from executing, but want the remaining listeners to execute. Useful
* for Do.before subscribers.
* @class Do.Prevent
* @constructor
* @param msg {String} (optional) Explanation of why the termination was done
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 374);
DO.Prevent = function(msg) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "Prevent", 374);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 375);
this.msg = msg;
};
/**
* Return an Error object when you want to terminate the execution
* of all subsequent method calls.
* @class Do.Error
* @constructor
* @param msg {String} (optional) Explanation of the altered return value
* @param retVal {any} Return value passed to code that invoked the wrapped
* function.
* @deprecated use Y.Do.Halt or Y.Do.Prevent
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 388);
DO.Error = DO.Halt;
//////////////////////////////////////////////////////////////////////////
// Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do);
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
* @module event-custom
* @submodule event-custom-base
*/
// var onsubscribeType = "_event:onsub",
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 405);
var YArray = Y.Array,
AFTER = 'after',
CONFIGS = [
'broadcast',
'monitored',
'bubbles',
'context',
'contextFn',
'currentTarget',
'defaultFn',
'defaultTargetOnly',
'details',
'emitFacade',
'fireOnce',
'async',
'host',
'preventable',
'preventedFn',
'queuable',
'silent',
'stoppedFn',
'target',
'type'
],
CONFIGS_HASH = YArray.hash(CONFIGS),
nativeSlice = Array.prototype.slice,
YUI3_SIGNATURE = 9,
YUI_LOG = 'yui:log',
mixConfigs = function(r, s, ov) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "mixConfigs", 438);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 439);
var p;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 441);
for (p in s) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 442);
if (CONFIGS_HASH[p] && (ov || !(p in r))) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 443);
r[p] = s[p];
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 447);
return r;
};
/**
* The CustomEvent class lets you define events for your application
* that can be subscribed to by one or more independent component.
*
* @param {String} type The type of event, which is passed to the callback
* when the event fires.
* @param {object} o configuration object.
* @class CustomEvent
* @constructor
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 460);
Y.CustomEvent = function(type, o) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "CustomEvent", 460);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 462);
this._kds = Y.CustomEvent.keepDeprecatedSubs;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 464);
o = o || {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 466);
this.id = Y.stamp(this);
/**
* The type of event, returned to subscribers when the event fires
* @property type
* @type string
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 473);
this.type = type;
/**
* The context the the event will fire from by default. Defaults to the YUI
* instance.
* @property context
* @type object
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 481);
this.context = Y;
/**
* Monitor when an event is attached or detached.
*
* @property monitored
* @type boolean
*/
// this.monitored = false;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 491);
this.logSystem = (type == YUI_LOG);
/**
* If 0, this event does not broadcast. If 1, the YUI instance is notified
* every time this event fires. If 2, the YUI instance and the YUI global
* (if event is enabled on the global) are notified every time this event
* fires.
* @property broadcast
* @type int
*/
// this.broadcast = 0;
/**
* By default all custom events are logged in the debug build, set silent
* to true to disable debug outpu for this event.
* @property silent
* @type boolean
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 509);
this.silent = this.logSystem;
/**
* Specifies whether this event should be queued when the host is actively
* processing an event. This will effect exectution order of the callbacks
* for the various events.
* @property queuable
* @type boolean
* @default false
*/
// this.queuable = false;
/**
* The subscribers to this event
* @property subscribers
* @type Subscriber {}
* @deprecated
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 527);
if (this._kds) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 528);
this.subscribers = {};
}
/**
* The subscribers to this event
* @property _subscribers
* @type Subscriber []
* @private
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 537);
this._subscribers = [];
/**
* 'After' subscribers
* @property afters
* @type Subscriber {}
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 544);
if (this._kds) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 545);
this.afters = {};
}
/**
* 'After' subscribers
* @property _afters
* @type Subscriber []
* @private
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 554);
this._afters = [];
/**
* This event has fired if true
*
* @property fired
* @type boolean
* @default false;
*/
// this.fired = false;
/**
* An array containing the arguments the custom event
* was last fired with.
* @property firedWith
* @type Array
*/
// this.firedWith;
/**
* This event should only fire one time if true, and if
* it has fired, any new subscribers should be notified
* immediately.
*
* @property fireOnce
* @type boolean
* @default false;
*/
// this.fireOnce = false;
/**
* fireOnce listeners will fire syncronously unless async
* is set to true
* @property async
* @type boolean
* @default false
*/
//this.async = false;
/**
* Flag for stopPropagation that is modified during fire()
* 1 means to stop propagation to bubble targets. 2 means
* to also stop additional subscribers on this target.
* @property stopped
* @type int
*/
// this.stopped = 0;
/**
* Flag for preventDefault that is modified during fire().
* if it is not 0, the default behavior for this event
* @property prevented
* @type int
*/
// this.prevented = 0;
/**
* Specifies the host for this custom event. This is used
* to enable event bubbling
* @property host
* @type EventTarget
*/
// this.host = null;
/**
* The default function to execute after event listeners
* have fire, but only if the default action was not
* prevented.
* @property defaultFn
* @type Function
*/
// this.defaultFn = null;
/**
* The function to execute if a subscriber calls
* stopPropagation or stopImmediatePropagation
* @property stoppedFn
* @type Function
*/
// this.stoppedFn = null;
/**
* The function to execute if a subscriber calls
* preventDefault
* @property preventedFn
* @type Function
*/
// this.preventedFn = null;
/**
* Specifies whether or not this event's default function
* can be cancelled by a subscriber by executing preventDefault()
* on the event facade
* @property preventable
* @type boolean
* @default true
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 651);
this.preventable = true;
/**
* Specifies whether or not a subscriber can stop the event propagation
* via stopPropagation(), stopImmediatePropagation(), or halt()
*
* Events can only bubble if emitFacade is true.
*
* @property bubbles
* @type boolean
* @default true
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 663);
this.bubbles = true;
/**
* Supports multiple options for listener signatures in order to
* port YUI 2 apps.
* @property signature
* @type int
* @default 9
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 672);
this.signature = YUI3_SIGNATURE;
// this.subCount = 0;
// this.afterCount = 0;
// this.hasSubscribers = false;
// this.hasAfters = false;
/**
* If set to true, the custom event will deliver an EventFacade object
* that is similar to a DOM event object.
* @property emitFacade
* @type boolean
* @default false
*/
// this.emitFacade = false;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 689);
this.applyConfig(o, true);
};
/**
* Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a>
* and <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance.
*
* These properties were changed to private properties (`_subscribers` and `_afters`), and
* converted from objects to arrays for performance reasons.
*
* Setting this property to true will populate the deprecated `subscribers` and `afters`
* properties for people who may be using them (which is expected to be rare). There will
* be a performance hit, compared to the new array based implementation.
*
* If you are using these deprecated properties for a use case which the public API
* does not support, please file an enhancement request, and we can provide an alternate
* public implementation which doesn't have the performance cost required to maintiain the
* properties as objects.
*
* @property keepDeprecatedSubs
* @static
* @for CustomEvent
* @type boolean
* @default false
* @deprecated
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 717);
Y.CustomEvent.keepDeprecatedSubs = false;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 719);
Y.CustomEvent.mixConfigs = mixConfigs;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 721);
Y.CustomEvent.prototype = {
constructor: Y.CustomEvent,
/**
* Returns the number of subscribers for this event as the sum of the on()
* subscribers and after() subscribers.
*
* @method hasSubs
* @return Number
*/
hasSubs: function(when) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "hasSubs", 732);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 733);
var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 735);
if (sib) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 736);
s += sib._subscribers.length;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 737);
a += sib._afters.length;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 740);
if (when) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 741);
return (when == 'after') ? a : s;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 744);
return (s + a);
},
/**
* Monitor the event state for the subscribed event. The first parameter
* is what should be monitored, the rest are the normal parameters when
* subscribing to an event.
* @method monitor
* @param what {string} what to monitor ('detach', 'attach', 'publish').
* @return {EventHandle} return value from the monitor event subscription.
*/
monitor: function(what) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "monitor", 755);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 756);
this.monitored = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 757);
var type = this.id + '|' + this.type + '_' + what,
args = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 759);
args[0] = type;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 760);
return this.host.on.apply(this.host, args);
},
/**
* Get all of the subscribers to this event and any sibling event
* @method getSubs
* @return {Array} first item is the on subscribers, second the after.
*/
getSubs: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "getSubs", 768);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 769);
var s = this._subscribers, a = this._afters, sib = this.sibling;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 771);
s = (sib) ? s.concat(sib._subscribers) : s.concat();
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 772);
a = (sib) ? a.concat(sib._afters) : a.concat();
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 774);
return [s, a];
},
/**
* Apply configuration properties. Only applies the CONFIG whitelist
* @method applyConfig
* @param o hash of properties to apply.
* @param force {boolean} if true, properties that exist on the event
* will be overwritten.
*/
applyConfig: function(o, force) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "applyConfig", 784);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 785);
mixConfigs(this, o, force);
},
/**
* Create the Subscription for subscribing function, context, and bound
* arguments. If this is a fireOnce event, the subscriber is immediately
* notified.
*
* @method _on
* @param fn {Function} Subscription callback
* @param [context] {Object} Override `this` in the callback
* @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()
* @param [when] {String} "after" to slot into after subscribers
* @return {EventHandle}
* @protected
*/
_on: function(fn, context, args, when) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_on", 801);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 804);
var s = new Y.Subscriber(fn, context, args, when);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 806);
if (this.fireOnce && this.fired) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 807);
if (this.async) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 808);
setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 810);
this._notify(s, this.firedWith);
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 814);
if (when == AFTER) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 815);
this._afters.push(s);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 817);
this._subscribers.push(s);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 820);
if (this._kds) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 821);
if (when == AFTER) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 822);
this.afters[s.id] = s;
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 824);
this.subscribers[s.id] = s;
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 828);
return new Y.EventHandle(this, s);
},
/**
* Listen for this event
* @method subscribe
* @param {Function} fn The function to execute.
* @return {EventHandle} Unsubscribe handle.
* @deprecated use on.
*/
subscribe: function(fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "subscribe", 838);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 839);
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 840);
return this._on(fn, context, a, true);
},
/**
* Listen for this event
* @method on
* @param {Function} fn The function to execute.
* @param {object} context optional execution context.
* @param {mixed} arg* 0..n additional arguments to supply to the subscriber
* when the event fires.
* @return {EventHandle} An object with a detach method to detch the handler(s).
*/
on: function(fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "on", 852);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 853);
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 855);
if (this.monitored && this.host) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 856);
this.host._monitor('attach', this, {
args: arguments
});
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 860);
return this._on(fn, context, a, true);
},
/**
* Listen for this event after the normal subscribers have been notified and
* the default behavior has been applied. If a normal subscriber prevents the
* default behavior, it also prevents after listeners from firing.
* @method after
* @param {Function} fn The function to execute.
* @param {object} context optional execution context.
* @param {mixed} arg* 0..n additional arguments to supply to the subscriber
* when the event fires.
* @return {EventHandle} handle Unsubscribe handle.
*/
after: function(fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "after", 874);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 875);
var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 876);
return this._on(fn, context, a, AFTER);
},
/**
* Detach listeners.
* @method detach
* @param {Function} fn The subscribed function to remove, if not supplied
* all will be removed.
* @param {Object} context The context object passed to subscribe.
* @return {int} returns the number of subscribers unsubscribed.
*/
detach: function(fn, context) {
// unsubscribe handle
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detach", 887);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 889);
if (fn && fn.detach) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 890);
return fn.detach();
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 893);
var i, s,
found = 0,
subs = this._subscribers,
afters = this._afters;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 898);
for (i = subs.length; i >= 0; i--) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 899);
s = subs[i];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 900);
if (s && (!fn || fn === s.fn)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 901);
this._delete(s, subs, i);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 902);
found++;
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 906);
for (i = afters.length; i >= 0; i--) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 907);
s = afters[i];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 908);
if (s && (!fn || fn === s.fn)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 909);
this._delete(s, afters, i);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 910);
found++;
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 914);
return found;
},
/**
* Detach listeners.
* @method unsubscribe
* @param {Function} fn The subscribed function to remove, if not supplied
* all will be removed.
* @param {Object} context The context object passed to subscribe.
* @return {int|undefined} returns the number of subscribers unsubscribed.
* @deprecated use detach.
*/
unsubscribe: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "unsubscribe", 926);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 927);
return this.detach.apply(this, arguments);
},
/**
* Notify a single subscriber
* @method _notify
* @param {Subscriber} s the subscriber.
* @param {Array} args the arguments array to apply to the listener.
* @protected
*/
_notify: function(s, args, ef) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_notify", 937);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 940);
var ret;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 942);
ret = s.notify(args, this);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 944);
if (false === ret || this.stopped > 1) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 945);
return false;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 948);
return true;
},
/**
* Logger abstraction to centralize the application of the silent flag
* @method log
* @param {string} msg message to log.
* @param {string} cat log category.
*/
log: function(msg, cat) {
},
/**
* Notifies the subscribers. The callback functions will be executed
* from the context specified when the event was created, and with the
* following parameters:
* <ul>
* <li>The type of event</li>
* <li>All of the arguments fire() was executed with as an array</li>
* <li>The custom object (if any) that was passed into the subscribe()
* method</li>
* </ul>
* @method fire
* @param {Object*} arguments an arbitrary set of parameters to pass to
* the handler.
* @return {boolean} false if one of the subscribers returned false,
* true otherwise.
*
*/
fire: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "fire", 977);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 978);
if (this.fireOnce && this.fired) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 979);
return true;
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 982);
var args = nativeSlice.call(arguments, 0);
// this doesn't happen if the event isn't published
// this.host._monitor('fire', this.type, args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 987);
this.fired = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 989);
if (this.fireOnce) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 990);
this.firedWith = args;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 993);
if (this.emitFacade) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 994);
return this.fireComplex(args);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 996);
return this.fireSimple(args);
}
}
},
/**
* Set up for notifying subscribers of non-emitFacade events.
*
* @method fireSimple
* @param args {Array} Arguments passed to fire()
* @return Boolean false if a subscriber returned false
* @protected
*/
fireSimple: function(args) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "fireSimple", 1009);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1010);
this.stopped = 0;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1011);
this.prevented = 0;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1012);
if (this.hasSubs()) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1013);
var subs = this.getSubs();
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1014);
this._procSubs(subs[0], args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1015);
this._procSubs(subs[1], args);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1017);
this._broadcast(args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1018);
return this.stopped ? false : true;
},
// Requires the event-custom-complex module for full funcitonality.
fireComplex: function(args) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "fireComplex", 1022);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1023);
args[0] = args[0] || {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1024);
return this.fireSimple(args);
},
/**
* Notifies a list of subscribers.
*
* @method _procSubs
* @param subs {Array} List of subscribers
* @param args {Array} Arguments passed to fire()
* @param ef {}
* @return Boolean false if a subscriber returns false or stops the event
* propagation via e.stopPropagation(),
* e.stopImmediatePropagation(), or e.halt()
* @private
*/
_procSubs: function(subs, args, ef) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_procSubs", 1039);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1040);
var s, i, l;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1042);
for (i = 0, l = subs.length; i < l; i++) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1043);
s = subs[i];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1044);
if (s && s.fn) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1045);
if (false === this._notify(s, args, ef)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1046);
this.stopped = 2;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1048);
if (this.stopped == 2) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1049);
return false;
}
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1054);
return true;
},
/**
* Notifies the YUI instance if the event is configured with broadcast = 1,
* and both the YUI instance and Y.Global if configured with broadcast = 2.
*
* @method _broadcast
* @param args {Array} Arguments sent to fire()
* @private
*/
_broadcast: function(args) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_broadcast", 1065);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1066);
if (!this.stopped && this.broadcast) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1068);
var a = args.concat();
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1069);
a.unshift(this.type);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1071);
if (this.host !== Y) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1072);
Y.fire.apply(Y, a);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1075);
if (this.broadcast == 2) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1076);
Y.Global.fire.apply(Y.Global, a);
}
}
},
/**
* Removes all listeners
* @method unsubscribeAll
* @return {int} The number of listeners unsubscribed.
* @deprecated use detachAll.
*/
unsubscribeAll: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "unsubscribeAll", 1087);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1088);
return this.detachAll.apply(this, arguments);
},
/**
* Removes all listeners
* @method detachAll
* @return {int} The number of listeners unsubscribed.
*/
detachAll: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detachAll", 1096);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1097);
return this.detach();
},
/**
* Deletes the subscriber from the internal store of on() and after()
* subscribers.
*
* @method _delete
* @param s subscriber object.
* @param subs (optional) on or after subscriber array
* @param index (optional) The index found.
* @private
*/
_delete: function(s, subs, i) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_delete", 1110);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1111);
var when = s._when;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1113);
if (!subs) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1114);
subs = (when === AFTER) ? this._afters : this._subscribers;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1115);
i = YArray.indexOf(subs, s, 0);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1118);
if (s && subs[i] === s) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1119);
subs.splice(i, 1);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1122);
if (this._kds) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1123);
if (when === AFTER) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1124);
delete this.afters[s.id];
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1126);
delete this.subscribers[s.id];
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1130);
if (this.monitored && this.host) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1131);
this.host._monitor('detach', this, {
ce: this,
sub: s
});
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1137);
if (s) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1138);
s.deleted = true;
}
}
};
/**
* Stores the subscriber information to be used when the event fires.
* @param {Function} fn The wrapped function to execute.
* @param {Object} context The value of the keyword 'this' in the listener.
* @param {Array} args* 0..n additional arguments to supply the listener.
*
* @class Subscriber
* @constructor
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1151);
Y.Subscriber = function(fn, context, args, when) {
/**
* The callback that will be execute when the event fires
* This is wrapped by Y.rbind if obj was supplied.
* @property fn
* @type Function
*/
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "Subscriber", 1151);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1159);
this.fn = fn;
/**
* Optional 'this' keyword for the listener
* @property context
* @type Object
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1166);
this.context = context;
/**
* Unique subscriber id
* @property id
* @type String
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1173);
this.id = Y.stamp(this);
/**
* Additional arguments to propagate to the subscriber
* @property args
* @type Array
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1180);
this.args = args;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1182);
this._when = when;
/**
* Custom events for a given fire transaction.
* @property events
* @type {EventTarget}
*/
// this.events = null;
/**
* This listener only reacts to the event once
* @property once
*/
// this.once = false;
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1199);
Y.Subscriber.prototype = {
constructor: Y.Subscriber,
_notify: function(c, args, ce) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_notify", 1202);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1203);
if (this.deleted && !this.postponed) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1204);
if (this.postponed) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1205);
delete this.fn;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1206);
delete this.context;
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1208);
delete this.postponed;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1209);
return null;
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1212);
var a = this.args, ret;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1213);
switch (ce.signature) {
case 0:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1215);
ret = this.fn.call(c, ce.type, args, c);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1216);
break;
case 1:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1218);
ret = this.fn.call(c, args[0] || null, c);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1219);
break;
default:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1221);
if (a || args) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1222);
args = args || [];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1223);
a = (a) ? args.concat(a) : args;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1224);
ret = this.fn.apply(c, a);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1226);
ret = this.fn.call(c);
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1230);
if (this.once) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1231);
ce._delete(this);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1234);
return ret;
},
/**
* Executes the subscriber.
* @method notify
* @param args {Array} Arguments array for the subscriber.
* @param ce {CustomEvent} The custom event that sent the notification.
*/
notify: function(args, ce) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "notify", 1243);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1244);
var c = this.context,
ret = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1247);
if (!c) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1248);
c = (ce.contextFn) ? ce.contextFn() : ce.context;
}
// only catch errors if we will not re-throw them.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1252);
if (Y.config && Y.config.throwFail) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1253);
ret = this._notify(c, args, ce);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1255);
try {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1256);
ret = this._notify(c, args, ce);
} catch (e) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1258);
Y.error(this + ' failed: ' + e.message, e);
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1262);
return ret;
},
/**
* Returns true if the fn and obj match this objects properties.
* Used by the unsubscribe method to match the right subscriber.
*
* @method contains
* @param {Function} fn the function to execute.
* @param {Object} context optional 'this' keyword for the listener.
* @return {boolean} true if the supplied arguments match this
* subscriber's signature.
*/
contains: function(fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "contains", 1275);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1276);
if (context) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1277);
return ((this.fn == fn) && this.context == context);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1279);
return (this.fn == fn);
}
},
valueOf : function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "valueOf", 1283);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1284);
return this.id;
}
};
/**
* Return value from all subscribe operations
* @class EventHandle
* @constructor
* @param {CustomEvent} evt the custom event.
* @param {Subscriber} sub the subscriber.
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1295);
Y.EventHandle = function(evt, sub) {
/**
* The custom event
*
* @property evt
* @type CustomEvent
*/
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "EventHandle", 1295);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1303);
this.evt = evt;
/**
* The subscriber object
*
* @property sub
* @type Subscriber
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1311);
this.sub = sub;
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1314);
Y.EventHandle.prototype = {
batch: function(f, c) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "batch", 1315);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1316);
f.call(c || this, this);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1317);
if (Y.Lang.isArray(this.evt)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1318);
Y.Array.each(this.evt, function(h) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 2)", 1318);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1319);
h.batch.call(c || h, f);
});
}
},
/**
* Detaches this subscriber
* @method detach
* @return {int} the number of detached listeners
*/
detach: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detach", 1329);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1330);
var evt = this.evt, detached = 0, i;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1331);
if (evt) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1332);
if (Y.Lang.isArray(evt)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1333);
for (i = 0; i < evt.length; i++) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1334);
detached += evt[i].detach();
}
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1337);
evt._delete(this.sub);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1338);
detached = 1;
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1343);
return detached;
},
/**
* Monitor the event state for the subscribed event. The first parameter
* is what should be monitored, the rest are the normal parameters when
* subscribing to an event.
* @method monitor
* @param what {string} what to monitor ('attach', 'detach', 'publish').
* @return {EventHandle} return value from the monitor event subscription.
*/
monitor: function(what) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "monitor", 1354);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1355);
return this.evt.monitor.apply(this.evt, arguments);
}
};
/**
* Custom event engine, DOM event listener abstraction layer, synthetic DOM
* events.
* @module event-custom
* @submodule event-custom-base
*/
/**
* EventTarget provides the implementation for any object to
* publish, subscribe and fire to custom events, and also
* alows other EventTargets to target the object with events
* sourced from the other object.
* EventTarget is designed to be used with Y.augment to wrap
* EventCustom in an interface that allows events to be listened to
* and fired by name. This makes it possible for implementing code to
* subscribe to an event that either has not been created yet, or will
* not be created at all.
* @class EventTarget
* @param opts a configuration object
* @config emitFacade {boolean} if true, all events will emit event
* facade payloads by default (default false)
* @config prefix {String} the prefix to apply to non-prefixed event names
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1383);
var L = Y.Lang,
PREFIX_DELIMITER = ':',
CATEGORY_DELIMITER = '|',
AFTER_PREFIX = '~AFTER~',
WILD_TYPE_RE = /(.*?)(:)(.*?)/,
_wildType = Y.cached(function(type) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 3)", 1389);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1390);
return type.replace(WILD_TYPE_RE, "*$2$3");
}),
/**
* If the instance has a prefix attribute and the
* event type is not prefixed, the instance prefix is
* applied to the supplied type.
* @method _getType
* @private
*/
_getType = Y.cached(function(type, pre) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 4)", 1400);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1402);
if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1403);
return type;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1406);
return pre + PREFIX_DELIMITER + type;
}),
/**
* Returns an array with the detach key (if provided),
* and the prefixed event name from _getType
* Y.on('detachcategory| menu:click', fn)
* @method _parseType
* @private
*/
_parseType = Y.cached(function(type, pre) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 5)", 1416);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1418);
var t = type, detachcategory, after, i;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1420);
if (!L.isString(t)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1421);
return t;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1424);
i = t.indexOf(AFTER_PREFIX);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1426);
if (i > -1) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1427);
after = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1428);
t = t.substr(AFTER_PREFIX.length);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1431);
i = t.indexOf(CATEGORY_DELIMITER);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1433);
if (i > -1) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1434);
detachcategory = t.substr(0, (i));
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1435);
t = t.substr(i+1);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1436);
if (t == '*') {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1437);
t = null;
}
}
// detach category, full type with instance prefix, is this an after listener, short type
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1442);
return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];
}),
ET = function(opts) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "ET", 1445);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1448);
var o = (L.isObject(opts)) ? opts : {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1450);
this._yuievt = this._yuievt || {
id: Y.guid(),
events: {},
targets: {},
config: o,
chain: ('chain' in o) ? o.chain : Y.config.chain,
bubbling: false,
defaults: {
context: o.context || this,
host: this,
emitFacade: o.emitFacade,
fireOnce: o.fireOnce,
queuable: o.queuable,
monitored: o.monitored,
broadcast: o.broadcast,
defaultTargetOnly: o.defaultTargetOnly,
bubbles: ('bubbles' in o) ? o.bubbles : true
}
};
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1479);
ET.prototype = {
constructor: ET,
/**
* Listen to a custom event hosted by this object one time.
* This is the equivalent to <code>on</code> except the
* listener is immediatelly detached when it is executed.
* @method once
* @param {String} type The name of the event
* @param {Function} fn The callback to execute in response to the event
* @param {Object} [context] Override `this` object in callback
* @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
* @return {EventHandle} A subscription handle capable of detaching the
* subscription
*/
once: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "once", 1494);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1495);
var handle = this.on.apply(this, arguments);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1496);
handle.batch(function(hand) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 6)", 1496);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1497);
if (hand.sub) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1498);
hand.sub.once = true;
}
});
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1501);
return handle;
},
/**
* Listen to a custom event hosted by this object one time.
* This is the equivalent to <code>after</code> except the
* listener is immediatelly detached when it is executed.
* @method onceAfter
* @param {String} type The name of the event
* @param {Function} fn The callback to execute in response to the event
* @param {Object} [context] Override `this` object in callback
* @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
* @return {EventHandle} A subscription handle capable of detaching that
* subscription
*/
onceAfter: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "onceAfter", 1516);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1517);
var handle = this.after.apply(this, arguments);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1518);
handle.batch(function(hand) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 7)", 1518);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1519);
if (hand.sub) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1520);
hand.sub.once = true;
}
});
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1523);
return handle;
},
/**
* Takes the type parameter passed to 'on' and parses out the
* various pieces that could be included in the type. If the
* event type is passed without a prefix, it will be expanded
* to include the prefix one is supplied or the event target
* is configured with a default prefix.
* @method parseType
* @param {String} type the type
* @param {String} [pre=this._yuievt.config.prefix] the prefix
* @since 3.3.0
* @return {Array} an array containing:
* * the detach category, if supplied,
* * the prefixed event type,
* * whether or not this is an after listener,
* * the supplied event type
*/
parseType: function(type, pre) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "parseType", 1542);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1543);
return _parseType(type, pre || this._yuievt.config.prefix);
},
/**
* Subscribe a callback function to a custom event fired by this object or
* from an object that bubbles its events to this object.
*
* Callback functions for events published with `emitFacade = true` will
* receive an `EventFacade` as the first argument (typically named "e").
* These callbacks can then call `e.preventDefault()` to disable the
* behavior published to that event's `defaultFn`. See the `EventFacade`
* API for all available properties and methods. Subscribers to
* non-`emitFacade` events will receive the arguments passed to `fire()`
* after the event name.
*
* To subscribe to multiple events at once, pass an object as the first
* argument, where the key:value pairs correspond to the eventName:callback,
* or pass an array of event names as the first argument to subscribe to
* all listed events with the same callback.
*
* Returning `false` from a callback is supported as an alternative to
* calling `e.preventDefault(); e.stopPropagation();`. However, it is
* recommended to use the event methods whenever possible.
*
* @method on
* @param {String} type The name of the event
* @param {Function} fn The callback to execute in response to the event
* @param {Object} [context] Override `this` object in callback
* @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
* @return {EventHandle} A subscription handle capable of detaching that
* subscription
*/
on: function(type, fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "on", 1575);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1577);
var yuievt = this._yuievt,
parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,
detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,
Node = Y.Node, n, domevent, isArr;
// full name, args, detachcategory, after
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1583);
this._monitor('attach', parts[1], {
args: arguments,
category: parts[0],
after: parts[2]
});
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1589);
if (L.isObject(type)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1591);
if (L.isFunction(type)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1592);
return Y.Do.before.apply(Y.Do, arguments);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1595);
f = fn;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1596);
c = context;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1597);
args = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1598);
ret = [];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1600);
if (L.isArray(type)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1601);
isArr = true;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1604);
after = type._after;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1605);
delete type._after;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1607);
Y.each(type, function(v, k) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 8)", 1607);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1609);
if (L.isObject(v)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1610);
f = v.fn || ((L.isFunction(v)) ? v : f);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1611);
c = v.context || c;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1614);
var nv = (after) ? AFTER_PREFIX : '';
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1616);
args[0] = nv + ((isArr) ? v : k);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1617);
args[1] = f;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1618);
args[2] = c;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1620);
ret.push(this.on.apply(this, args));
}, this);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1624);
return (yuievt.chain) ? this : new Y.EventHandle(ret);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1627);
detachcategory = parts[0];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1628);
after = parts[2];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1629);
shorttype = parts[3];
// extra redirection so we catch adaptor events too. take a look at this.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1632);
if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1633);
args = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1634);
args.splice(2, 0, Node.getDOMNode(this));
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1635);
return Y.on.apply(Y, args);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1638);
type = parts[1];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1640);
if (Y.instanceOf(this, YUI)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1642);
adapt = Y.Env.evt.plugins[type];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1643);
args = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1644);
args[0] = shorttype;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1646);
if (Node) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1647);
n = args[2];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1649);
if (Y.instanceOf(n, Y.NodeList)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1650);
n = Y.NodeList.getDOMNodes(n);
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1651);
if (Y.instanceOf(n, Node)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1652);
n = Node.getDOMNode(n);
}}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1655);
domevent = (shorttype in Node.DOM_EVENTS);
// Captures both DOM events and event plugins.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1658);
if (domevent) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1659);
args[2] = n;
}
}
// check for the existance of an event adaptor
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1664);
if (adapt) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1665);
handle = adapt.on.apply(Y, args);
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1666);
if ((!type) || domevent) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1667);
handle = Y.Event._attach(args);
}}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1672);
if (!handle) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1673);
ce = yuievt.events[type] || this.publish(type);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1674);
handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1677);
if (detachcategory) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1678);
store[detachcategory] = store[detachcategory] || {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1679);
store[detachcategory][type] = store[detachcategory][type] || [];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1680);
store[detachcategory][type].push(handle);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1683);
return (yuievt.chain) ? this : handle;
},
/**
* subscribe to an event
* @method subscribe
* @deprecated use on
*/
subscribe: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "subscribe", 1692);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1693);
return this.on.apply(this, arguments);
},
/**
* Detach one or more listeners the from the specified event
* @method detach
* @param type {string|Object} Either the handle to the subscriber or the
* type of event. If the type
* is not specified, it will attempt to remove
* the listener from all hosted events.
* @param fn {Function} The subscribed function to unsubscribe, if not
* supplied, all subscribers will be removed.
* @param context {Object} The custom object passed to subscribe. This is
* optional, but if supplied will be used to
* disambiguate multiple listeners that are the same
* (e.g., you subscribe many object using a function
* that lives on the prototype)
* @return {EventTarget} the host
*/
detach: function(type, fn, context) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detach", 1712);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1713);
var evts = this._yuievt.events, i,
Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));
// detachAll disabled on the Y instance.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1717);
if (!type && (this !== Y)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1718);
for (i in evts) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1719);
if (evts.hasOwnProperty(i)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1720);
evts[i].detach(fn, context);
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1723);
if (isNode) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1724);
Y.Event.purgeElement(Node.getDOMNode(this));
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1727);
return this;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1730);
var parts = _parseType(type, this._yuievt.config.prefix),
detachcategory = L.isArray(parts) ? parts[0] : null,
shorttype = (parts) ? parts[3] : null,
adapt, store = Y.Env.evt.handles, detachhost, cat, args,
ce,
keyDetacher = function(lcat, ltype, host) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "keyDetacher", 1736);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1737);
var handles = lcat[ltype], ce, i;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1738);
if (handles) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1739);
for (i = handles.length - 1; i >= 0; --i) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1740);
ce = handles[i].evt;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1741);
if (ce.host === host || ce.el === host) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1742);
handles[i].detach();
}
}
}
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1748);
if (detachcategory) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1750);
cat = store[detachcategory];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1751);
type = parts[1];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1752);
detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1754);
if (cat) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1755);
if (type) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1756);
keyDetacher(cat, type, detachhost);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1758);
for (i in cat) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1759);
if (cat.hasOwnProperty(i)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1760);
keyDetacher(cat, i, detachhost);
}
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1765);
return this;
}
// If this is an event handle, use it to detach
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1769);
if (L.isObject(type) && type.detach) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1770);
type.detach();
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1771);
return this;
// extra redirection so we catch adaptor events too. take a look at this.
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1773);
if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1774);
args = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1775);
args[2] = Node.getDOMNode(this);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1776);
Y.detach.apply(Y, args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1777);
return this;
}}}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1780);
adapt = Y.Env.evt.plugins[shorttype];
// The YUI instance handles DOM events and adaptors
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1783);
if (Y.instanceOf(this, YUI)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1784);
args = nativeSlice.call(arguments, 0);
// use the adaptor specific detach code if
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1786);
if (adapt && adapt.detach) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1787);
adapt.detach.apply(Y, args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1788);
return this;
// DOM event fork
} else {_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1790);
if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1791);
args[0] = type;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1792);
Y.Event.detach.apply(Y.Event, args);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1793);
return this;
}}
}
// ce = evts[type];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1798);
ce = evts[parts[1]];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1799);
if (ce) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1800);
ce.detach(fn, context);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1803);
return this;
},
/**
* detach a listener
* @method unsubscribe
* @deprecated use detach
*/
unsubscribe: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "unsubscribe", 1811);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1812);
return this.detach.apply(this, arguments);
},
/**
* Removes all listeners from the specified event. If the event type
* is not specified, all listeners from all hosted custom events will
* be removed.
* @method detachAll
* @param type {String} The type, or name of the event
*/
detachAll: function(type) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "detachAll", 1822);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1823);
return this.detach(type);
},
/**
* Removes all listeners from the specified event. If the event type
* is not specified, all listeners from all hosted custom events will
* be removed.
* @method unsubscribeAll
* @param type {String} The type, or name of the event
* @deprecated use detachAll
*/
unsubscribeAll: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "unsubscribeAll", 1834);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1835);
return this.detachAll.apply(this, arguments);
},
/**
* Creates a new custom event of the specified type. If a custom event
* by that name already exists, it will not be re-created. In either
* case the custom event is returned.
*
* @method publish
*
* @param type {String} the type, or name of the event
* @param opts {object} optional config params. Valid properties are:
*
* <ul>
* <li>
* 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false)
* </li>
* <li>
* 'bubbles': whether or not this event bubbles (true)
* Events can only bubble if emitFacade is true.
* </li>
* <li>
* 'context': the default execution context for the listeners (this)
* </li>
* <li>
* 'defaultFn': the default function to execute when this event fires if preventDefault was not called
* </li>
* <li>
* 'emitFacade': whether or not this event emits a facade (false)
* </li>
* <li>
* 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click'
* </li>
* <li>
* 'fireOnce': if an event is configured to fire once, new subscribers after
* the fire will be notified immediately.
* </li>
* <li>
* 'async': fireOnce event listeners will fire synchronously if the event has already
* fired unless async is true.
* </li>
* <li>
* 'preventable': whether or not preventDefault() has an effect (true)
* </li>
* <li>
* 'preventedFn': a function that is executed when preventDefault is called
* </li>
* <li>
* 'queuable': whether or not this event can be queued during bubbling (false)
* </li>
* <li>
* 'silent': if silent is true, debug messages are not provided for this event.
* </li>
* <li>
* 'stoppedFn': a function that is executed when stopPropagation is called
* </li>
*
* <li>
* 'monitored': specifies whether or not this event should send notifications about
* when the event has been attached, detached, or published.
* </li>
* <li>
* 'type': the event type (valid option if not provided as the first parameter to publish)
* </li>
* </ul>
*
* @return {CustomEvent} the custom event
*
*/
publish: function(type, opts) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "publish", 1904);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1905);
var events, ce, ret, defaults,
edata = this._yuievt,
pre = edata.config.prefix;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1909);
if (L.isObject(type)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1910);
ret = {};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1911);
Y.each(type, function(v, k) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "(anonymous 9)", 1911);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1912);
ret[k] = this.publish(k, v || opts);
}, this);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1915);
return ret;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1918);
type = (pre) ? _getType(type, pre) : type;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1920);
events = edata.events;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1921);
ce = events[type];
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1923);
this._monitor('publish', type, {
args: arguments
});
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1927);
if (ce) {
// ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event');
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1929);
if (opts) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1930);
ce.applyConfig(opts, true);
}
} else {
// TODO: Lazy publish goes here.
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1934);
defaults = edata.defaults;
// apply defaults
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1937);
ce = new Y.CustomEvent(type, defaults);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1938);
if (opts) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1939);
ce.applyConfig(opts, true);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1942);
events[type] = ce;
}
// make sure we turn the broadcast flag off if this
// event was published as a result of bubbling
// if (opts instanceof Y.CustomEvent) {
// events[type].broadcast = false;
// }
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1951);
return events[type];
},
/**
* This is the entry point for the event monitoring system.
* You can monitor 'attach', 'detach', 'fire', and 'publish'.
* When configured, these events generate an event. click ->
* click_attach, click_detach, click_publish -- these can
* be subscribed to like other events to monitor the event
* system. Inividual published events can have monitoring
* turned on or off (publish can't be turned off before it
* it published) by setting the events 'monitor' config.
*
* @method _monitor
* @param what {String} 'attach', 'detach', 'fire', or 'publish'
* @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object.
* @param o {Object} Information about the event interaction, such as
* fire() args, subscription category, publish config
* @private
*/
_monitor: function(what, eventType, o) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "_monitor", 1971);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1972);
var monitorevt, ce, type;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1974);
if (eventType) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1975);
if (typeof eventType === "string") {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1976);
type = eventType;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1977);
ce = this.getEvent(eventType, true);
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1979);
ce = eventType;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1980);
type = eventType.type;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1983);
if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1984);
monitorevt = type + '_' + what;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1985);
o.monitored = what;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 1986);
this.fire.call(this, monitorevt, o);
}
}
},
/**
* Fire a custom event by name. The callback functions will be executed
* from the context specified when the event was created, and with the
* following parameters.
*
* If the custom event object hasn't been created, then the event hasn't
* been published and it has no subscribers. For performance sake, we
* immediate exit in this case. This means the event won't bubble, so
* if the intention is that a bubble target be notified, the event must
* be published on this object first.
*
* The first argument is the event type, and any additional arguments are
* passed to the listeners as parameters. If the first of these is an
* object literal, and the event is configured to emit an event facade,
* that object is mixed into the event facade and the facade is provided
* in place of the original object.
*
* @method fire
* @param type {String|Object} The type of the event, or an object that contains
* a 'type' property.
* @param arguments {Object*} an arbitrary set of parameters to pass to
* the handler. If the first of these is an object literal and the event is
* configured to emit an event facade, the event facade will replace that
* parameter after the properties the object literal contains are copied to
* the event facade.
* @return {EventTarget} the event host
*/
fire: function(type) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "fire", 2018);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2020);
var typeIncluded = L.isString(type),
t = (typeIncluded) ? type : (type && type.type),
yuievt = this._yuievt,
pre = yuievt.config.prefix,
ce, ret,
ce2,
args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2028);
t = (pre) ? _getType(t, pre) : t;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2030);
ce = this.getEvent(t, true);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2031);
ce2 = this.getSibling(t, ce);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2033);
if (ce2 && !ce) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2034);
ce = this.publish(t);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2037);
this._monitor('fire', (ce || t), {
args: args
});
// this event has not been published or subscribed to
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2042);
if (!ce) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2043);
if (yuievt.hasTargets) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2044);
return this.bubble({ type: t }, args, this);
}
// otherwise there is nothing to be done
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2048);
ret = true;
} else {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2050);
ce.sibling = ce2;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2051);
ret = ce.fire.apply(ce, args);
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2054);
return (yuievt.chain) ? this : ret;
},
getSibling: function(type, ce) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "getSibling", 2057);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2058);
var ce2;
// delegate to *:type events if there are subscribers
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2060);
if (type.indexOf(PREFIX_DELIMITER) > -1) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2061);
type = _wildType(type);
// console.log(type);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2063);
ce2 = this.getEvent(type, true);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2064);
if (ce2) {
// console.log("GOT ONE: " + type);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2066);
ce2.applyConfig(ce);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2067);
ce2.bubbles = false;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2068);
ce2.broadcast = 0;
// ret = ce2.fire.apply(ce2, a);
}
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2073);
return ce2;
},
/**
* Returns the custom event of the provided type has been created, a
* falsy value otherwise
* @method getEvent
* @param type {String} the type, or name of the event
* @param prefixed {String} if true, the type is prefixed already
* @return {CustomEvent} the custom event or null
*/
getEvent: function(type, prefixed) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "getEvent", 2084);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2085);
var pre, e;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2086);
if (!prefixed) {
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2087);
pre = this._yuievt.config.prefix;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2088);
type = (pre) ? _getType(type, pre) : type;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2090);
e = this._yuievt.events;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2091);
return e[type] || null;
},
/**
* Subscribe to a custom event hosted by this object. The
* supplied callback will execute after any listeners add
* via the subscribe method, and after the default function,
* if configured for the event, has executed.
*
* @method after
* @param {String} type The name of the event
* @param {Function} fn The callback to execute in response to the event
* @param {Object} [context] Override `this` object in callback
* @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
* @return {EventHandle} A subscription handle capable of detaching the
* subscription
*/
after: function(type, fn) {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "after", 2108);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2110);
var a = nativeSlice.call(arguments, 0);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2112);
switch (L.type(type)) {
case 'function':
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2114);
return Y.Do.after.apply(Y.Do, arguments);
case 'array':
// YArray.each(a[0], function(v) {
// v = AFTER_PREFIX + v;
// });
// break;
case 'object':
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2121);
a[0]._after = true;
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2122);
break;
default:
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2124);
a[0] = AFTER_PREFIX + type;
}
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2127);
return this.on.apply(this, a);
},
/**
* Executes the callback before a DOM event, custom event
* or method. If the first argument is a function, it
* is assumed the target is a method. For DOM and custom
* events, this is an alias for Y.on.
*
* For DOM and custom events:
* type, callback, context, 0-n arguments
*
* For methods:
* callback, object (method host), methodName, context, 0-n arguments
*
* @method before
* @return detach handle
*/
before: function() {
_yuitest_coverfunc("build/event-custom-base/event-custom-base.js", "before", 2146);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2147);
return this.on.apply(this, arguments);
}
};
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2152);
Y.EventTarget = ET;
// make Y an event target
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2155);
Y.mix(Y, ET.prototype);
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2156);
ET.call(Y, { bubbles: false });
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2158);
YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();
/**
* Hosts YUI page level events. This is where events bubble to
* when the broadcast config is set to 2. This property is
* only available if the custom event module is loaded.
* @property Global
* @type EventTarget
* @for YUI
*/
_yuitest_coverline("build/event-custom-base/event-custom-base.js", 2168);
Y.Global = YUI.Env.globalEvents;
// @TODO implement a global namespace function on Y.Global?
/**
`Y.on()` can do many things:
<ul>
<li>Subscribe to custom events `publish`ed and `fire`d from Y</li>
<li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and
`fire`d from any object in the YUI instance sandbox</li>
<li>Subscribe to DOM events</li>
<li>Subscribe to the execution of a method on any object, effectively
treating that method as an event</li>
</ul>
For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.
Y.on('io:complete', function () {
Y.MyApp.updateStatus('Transaction complete');
});
To subscribe to DOM events, pass the name of a DOM event as the first argument
and a CSS selector string as the third argument after the callback function.
Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,
array, or simply omitted (the default is the `window` object).
Y.on('click', function (e) {
e.preventDefault();
// proceed with ajax form submission
var url = this.get('action');
...
}, '#my-form');
The `this` object in DOM event callbacks will be the `Node` targeted by the CSS
selector or other identifier.
`on()` subscribers for DOM events or custom events `publish`ed with a
`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
event object passed as the first parameter to the subscription callback.
To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
<a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>.
NOTE: The formal parameter list below is for events, not for function
injection. See `Y.Do.before` for that signature.
@method on
@param {String} type DOM or custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
subscription
@see Do.before
@for YUI
**/
/**
Listen for an event one time. Equivalent to `on()`, except that
the listener is immediately detached when executed.
See the <a href="#methods_on">`on()` method</a> for additional subscription
options.
@see on
@method once
@param {String} type DOM or custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
subscription
@for YUI
**/
/**
Listen for an event one time. Equivalent to `once()`, except, like `after()`,
the subscription callback executes after all `on()` subscribers and the event's
`defaultFn` (if configured) have executed. Like `after()` if any `on()` phase
subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`
subscribers will execute.
The listener is immediately detached when executed.
See the <a href="#methods_on">`on()` method</a> for additional subscription
options.
@see once
@method onceAfter
@param {String} type The custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
subscription
@for YUI
**/
/**
Like `on()`, this method creates a subscription to a custom event or to the
execution of a method on an object.
For events, `after()` subscribers are executed after the event's
`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.
See the <a href="#methods_on">`on()` method</a> for additional subscription
options.
NOTE: The subscription signature shown is for events, not for function
injection. See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a>
for that signature.
@see on
@see Do.after
@method after
@param {String} type The custom event name
@param {Function} fn The callback to execute in response to the event
@param {Object} [context] Override `this` object in callback
@param {Any} [args*] 0..n additional arguments to supply to the subscriber
@return {EventHandle} A subscription handle capable of detaching the
subscription
@for YUI
**/
}, '@VERSION@', {"requires": ["oop"]});
|
src/svg-icons/action/credit-card.js | barakmitz/material-ui | import React from 'react';
import pure from 'recompose/pure';
import SvgIcon from '../../SvgIcon';
let ActionCreditCard = (props) => (
<SvgIcon {...props}>
<path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/>
</SvgIcon>
);
ActionCreditCard = pure(ActionCreditCard);
ActionCreditCard.displayName = 'ActionCreditCard';
ActionCreditCard.muiName = 'SvgIcon';
export default ActionCreditCard;
|
src/components/NotFound/NotFound.js | Shidil/react-redux-starter | import React from 'react';
class NoMatchComponent extends React.Component {
render() {
return (
<div className="404-view">
<h1>404 Not Found</h1>
</div>
);
}
}
export default NoMatchComponent;
|
src/js/components/DataChart/stories/Everything.js | grommet/grommet | import React from 'react';
import { Box, DataChart } from 'grommet';
const data = [];
for (let i = 0; i < 13; i += 1) {
const v = -Math.sin(i / 2.0);
const v2 = Math.cos(i / 2.0);
data.push({
date: `2020-07-${((i % 30) + 1).toString().padStart(2, 0)}`,
amount: Math.floor(v * 10),
need: Math.floor(v2 * 9),
needMax: Math.floor(v2 * 9) + i / 2,
needMin: Math.floor(v2 * 9) - i / 2,
growth: i,
});
}
export const Everything = () => (
// Uncomment <Grommet> lines when using outside of storybook
// <Grommet theme={grommet}>
<Box align="center" justify="start" pad="large">
<DataChart
data={data}
series={['date', 'amount', 'need', 'growth']}
bounds="align"
chart={[
{
property: 'amount',
type: 'area',
thickness: 'xsmall',
color: 'graph-2',
opacity: 'medium',
},
{
property: 'amount',
type: 'line',
thickness: 'xxsmall',
round: true,
},
{ property: 'amount', type: 'bar', thickness: 'hair' },
{ property: 'amount', type: 'point', thickness: 'small' },
{
property: ['needMin', 'needMax'],
type: 'area',
thickness: 'xsmall',
color: 'graph-3',
opacity: 'medium',
},
{
property: 'need',
type: 'line',
thickness: 'xxsmall',
dash: true,
round: true,
},
{ property: 'need', type: 'point', thickness: 'small' },
{ property: 'growth', type: 'line', thickness: 'hair' },
]}
axis={{ x: 'date', y: { property: 'amount', granularity: 'medium' } }}
guide={{ y: { granularity: 'medium' }, x: { granularity: 'fine' } }}
gap="xsmall"
pad="small"
legend
detail
/>
</Box>
// </Grommet>
);
export default {
title: 'Visualizations/DataChart/Everything',
};
|
app/main.js | apache/couchdb-fauxton | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
import app from './app';
import React from 'react';
import ReactDOM from 'react-dom';
import FauxtonAPI from './core/api';
import LoadAddons from './load_addons';
import Backbone from 'backbone';
import $ from 'jquery';
import AppWrapper from './addons/fauxton/appwrapper';
import { createStore, applyMiddleware, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
FauxtonAPI.addMiddleware(thunk);
const store = createStore(
combineReducers(FauxtonAPI.reducers),
applyMiddleware(...FauxtonAPI.middlewares)
);
FauxtonAPI.reduxDispatch = (action) => {
store.dispatch(action);
};
FauxtonAPI.reduxState = () => {
return store.getState();
};
app.addons = LoadAddons;
FauxtonAPI.router = app.router = new FauxtonAPI.Router(app.addons);
// Trigger the initial route and enable HTML5 History API support, set the
// root folder to '/' by default. Change in app.js.
Backbone.history.start({ pushState: false, root: app.root });
// feature detect IE
if ('ActiveXObject' in window) {
$.ajaxSetup({ cache: false });
}
// Walks up the element tree to look for a link to see if it is part
// of the click nodes
const findLink = (target) => {
if (!target) {
return null;
}
if (target.tagName === 'A') {
return target;
}
return findLink(target.parentNode);
};
// All navigation that is relative should be passed through the navigate
// method, to be processed by the router. If the link has a `data-bypass`
// attribute, bypass the delegation completely.
document.addEventListener("click", evt => {
const target = findLink(evt.target);
if (!target) {
return;
}
//"a:not([data-bypass])"
const dataBypass = target.getAttribute('data-bypass');
if (dataBypass) {
return;
}
// Get the absolute anchor href.
const href = { prop: target.href, attr: target.getAttribute("href") };
if (!href.prop) {
return;
}
// Get the absolute root
const root = location.protocol + "//" + location.host;
// Ensure the root is part of the anchor href, meaning it's relative
if (href.prop && href.prop.slice(0, root.length) === root) {
// Stop the default event to ensure the link will not cause a page
// refresh.
evt.preventDefault();
//User app navigate so that navigate goes through a central place
app.router.navigate(href.attr, true);
}
});
ReactDOM.render(
<Provider store={store}>
<AppWrapper router={app.router}/>
</Provider>,
document.getElementById('app')
);
|
es/Stepper/Step.js | uplevel-technology/material-ui-next | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import React from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {},
horizontal: {
paddingLeft: theme.spacing.unit,
paddingRight: theme.spacing.unit,
'&:first-child': {
paddingLeft: 0
},
'&:last-child': {
paddingRight: 0
}
},
alternativeLabel: {
flex: 1,
position: 'relative',
marginLeft: 0
}
});
function Step(props) {
const {
active,
alternativeLabel,
children,
classes,
className: classNameProp,
completed,
connector,
disabled,
index,
last,
orientation,
optional
} = props,
other = _objectWithoutProperties(props, ['active', 'alternativeLabel', 'children', 'classes', 'className', 'completed', 'connector', 'disabled', 'index', 'last', 'orientation', 'optional']);
const className = classNames(classes.root, classes[orientation], {
[classes.alternativeLabel]: alternativeLabel
}, classNameProp);
return React.createElement(
'div',
_extends({ className: className }, other),
React.Children.map(children, child => React.cloneElement(child, _extends({
active,
alternativeLabel,
completed,
disabled,
icon: index + 1,
last,
orientation,
optional
}, child.props))),
connector && alternativeLabel && !last && React.cloneElement(connector, { orientation, alternativeLabel })
);
}
Step.defaultProps = {
active: false,
completed: false,
disabled: false,
optional: false
};
export default withStyles(styles)(Step); |
client/components/SearchBox.js | mygithub1216/MERN_SelfCar_Dashboard | import React from 'react';
import TextField from 'material-ui/TextField';
import {white, blue500} from 'material-ui/styles/colors';
import IconButton from 'material-ui/IconButton';
import Search from 'material-ui/svg-icons/action/search';
const SearchBox = () => {
const styles = {
iconButton: {
float: 'left',
paddingTop: 17
},
textField: {
color: white,
backgroundColor: blue500,
borderRadius: 2,
height: 35
},
inputStyle: {
color: white,
paddingLeft: 5
},
hintStyle: {
height: 16,
paddingLeft: 5,
color: white
}
};
return (
<div>
<IconButton style={styles.iconButton} >
<Search color={white} />
</IconButton>
<TextField
hintText="Search..."
underlineShow={false}
fullWidth={true}
style={styles.textField}
inputStyle={styles.inputStyle}
hintStyle={styles.hintStyle}
/>
</div>
);
};
export default SearchBox;
|
src/components/windows8/original/Windows8Original.js | fpoumian/react-devicon | import React from 'react'
import PropTypes from 'prop-types'
import SVGDeviconInline from '../../_base/SVGDeviconInline'
import iconSVG from './Windows8Original.svg'
/** Windows8Original */
function Windows8Original({ width, height, className }) {
return (
<SVGDeviconInline
className={'Windows8Original' + ' ' + className}
iconSVG={iconSVG}
width={width}
height={height}
/>
)
}
Windows8Original.propTypes = {
className: PropTypes.string,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
}
export default Windows8Original
|
src/components/Header/Header.js | DVLP/react-starter-kit | /*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { Component } from 'react';
import styles from './Header.css';
import withStyles from '../../decorators/withStyles';
import Link from '../Link';
import Navigation from '../Navigation';
@withStyles(styles)
class Header extends Component {
render() {
return (
<div className="Header">
<div className="Header-container">
<a className="Header-brand" href="/" onClick={Link.handleClick}>
<img className="Header-brandImg" src={require('./logo-small.png')} width="38" height="38" alt="React" />
<span className="Header-brandTxt">Your Company</span>
</a>
<Navigation className="Header-nav" />
<div className="Header-banner">
<h1 className="Header-bannerTitle">React</h1>
<p className="Header-bannerDesc">Complex web apps made easy</p>
</div>
</div>
</div>
);
}
}
export default Header;
|
node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/app.js | A-deLuna/Iterative-Improvement-presentation | /* Modernizr 2.0.6 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-iepp
*/
;window.Modernizr=function(a,b,c){function w(a,b){return!!~(""+a).indexOf(b)}function v(a,b){return typeof a===b}function u(a,b){return t(prefixes.join(a+";")+(b||""))}function t(a){j.cssText=a}var d="2.0.6",e={},f=b.documentElement,g=b.head||b.getElementsByTagName("head")[0],h="modernizr",i=b.createElement(h),j=i.style,k,l=Object.prototype.toString,m={},n={},o={},p=[],q,r={}.hasOwnProperty,s;!v(r,c)&&!v(r.call,c)?s=function(a,b){return r.call(a,b)}:s=function(a,b){return b in a&&v(a.constructor.prototype[b],c)};for(var x in m)s(m,x)&&(q=x.toLowerCase(),e[q]=m[x](),p.push((e[q]?"":"no-")+q));t(""),i=k=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b<g)a.createElement(f[b])}a.iepp=a.iepp||{};var d=a.iepp,e=d.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",f=e.split("|"),g=f.length,h=new RegExp("(^|\\s)("+e+")","gi"),i=new RegExp("<(/*)("+e+")","gi"),j=/^\s*[\{\}]\s*$/,k=new RegExp("(^|[^\\n]*?\\s)("+e+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),l=b.createDocumentFragment(),m=b.documentElement,n=m.firstChild,o=b.createElement("body"),p=b.createElement("style"),q=/print|all/,r;d.getCSS=function(a,b){if(a+""===c)return"";var e=-1,f=a.length,g,h=[];while(++e<f){g=a[e];if(g.disabled)continue;b=g.media||b,q.test(b)&&h.push(d.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},d.parseCSS=function(a){var b=[],c;while((c=k.exec(a))!=null)b.push(((j.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(h,"$1.iepp_$2")+c[4]);return b.join("\n")},d.writeHTML=function(){var a=-1;r=r||b.body;while(++a<g){var c=b.getElementsByTagName(f[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+f[a])}l.appendChild(r),m.appendChild(o),o.className=r.className,o.id=r.id,o.innerHTML=r.innerHTML.replace(i,"<$1font")},d._beforePrint=function(){p.styleSheet.cssText=d.parseCSS(d.getCSS(b.styleSheets,"all")),d.writeHTML()},d.restoreHTML=function(){o.innerHTML="",m.removeChild(o),m.appendChild(r)},d._afterPrint=function(){d.restoreHTML(),p.styleSheet.cssText=""},s(b),s(l);d.disablePP||(n.insertBefore(p,n.firstChild),p.media="print",p.className="iepp-printshim",a.attachEvent("onbeforeprint",d._beforePrint),a.attachEvent("onafterprint",d._afterPrint))}(a,b),e._version=d;return e}(this,this.document);
(function (con) {
// the dummy function
function dummy() {};
// console methods that may exist
for(var methods = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(','), func; func = methods.pop();) {
con[func] = con[func] || dummy;
}
}(window.console = window.console || {}));
// we do this crazy little dance so that the `console` object
// inside the function is a name that can be shortened to a single
// letter by the compressor to make the compressed script as tiny
// as possible.
/*!
* jQuery JavaScript Library v1.6.3
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Wed Aug 31 10:35:15 2011 -0400
*/
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document,
navigator = window.navigator,
location = window.location;
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Used for trimming whitespace
trimLeft = /^\s+/,
trimRight = /\s+$/,
// Check for digits
rdigit = /\d/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
// Useragent RegExp
rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Matches dashed string for camelizing
rdashAlpha = /-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + "" ).toUpperCase();
},
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// The deferred used on DOM ready
readyList,
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
// [[Class]] -> type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
return this;
}
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = selector;
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = quickExpr.exec( selector );
}
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
doc = (context ? context.ownerDocument || context : document);
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
} else {
selector = [ doc.createElement( ret[1] ) ];
}
} else {
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
}
return jQuery.merge( this, selector );
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if (selector.selector !== undefined) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The current version of jQuery being used
jquery: "1.6.3",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return slice.call( this, 0 );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = this.constructor();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
} else {
jQuery.merge( ret, elems );
}
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
if ( name === "find" ) {
ret.selector = this.selector + (this.selector ? " " : "") + selector;
} else if ( name ) {
ret.selector = this.selector + "." + name + "(" + selector + ")";
}
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.done( fn );
return this;
},
eq: function( i ) {
return i === -1 ?
this.slice( i ) :
this.slice( i, +i + 1 );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
slice: function() {
return this.pushStack( slice.apply( this, arguments ),
"slice", slice.call(arguments).join(",") );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
}
}
},
bindReady: function() {
if ( readyList ) {
return;
}
readyList = jQuery._Deferred();
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
}
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;
try {
toplevel = window.frameElement == null;
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
// A crude way of determining if an object is a window
isWindow: function( obj ) {
return obj && typeof obj === "object" && "setInterval" in obj;
},
isNaN: function( obj ) {
return obj == null || !rdigit.test( obj ) || isNaN( obj );
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
try {
// Not own constructor property must be Object
if ( obj.constructor &&
!hasOwn.call(obj, "constructor") &&
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw msg;
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return (new Function( "return " + data ))();
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} else { // IE
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch( e ) {
xml = undefined;
}
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction( object );
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
break;
}
}
}
}
return object;
},
// Use native String.trim function wherever possible
trim: trim ?
function( text ) {
return text == null ?
"" :
trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
},
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type( array );
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
}
}
return ret;
},
inArray: function( elem, array ) {
if ( !array ) {
return -1;
}
if ( indexOf ) {
return indexOf.call( array, elem );
}
for ( var i = 0, length = array.length; i < length; i++ ) {
if ( array[ i ] === elem ) {
return i;
}
}
return -1;
},
merge: function( first, second ) {
var i = first.length,
j = 0;
if ( typeof second.length === "number" ) {
for ( var l = second.length; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var ret = [], retVal;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems.length; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value, key, ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( key in elems ) {
value = callback( elems[ key ], key, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return ret.concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
if ( typeof context === "string" ) {
var tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
var args = slice.call( arguments, 2 ),
proxy = function() {
return fn.apply( context, args.concat( slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
return proxy;
},
// Mutifunctional method to get and set values to a collection
// The value/s can optionally be executed if it's a function
access: function( elems, key, value, exec, fn, pass ) {
var length = elems.length;
// Setting many attributes
if ( typeof key === "object" ) {
for ( var k in key ) {
jQuery.access( elems, k, key[k], exec, fn, value );
}
return elems;
}
// Setting one attribute
if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = !pass && exec && jQuery.isFunction(value);
for ( var i = 0; i < length; i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
}
return elems;
}
// Getting an attribute
return length ? fn( elems[0], key ) : undefined;
},
now: function() {
return (new Date()).getTime();
},
// Use of jQuery.browser is frowned upon.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
[];
return { browser: match[1] || "", version: match[2] || "0" };
},
sub: function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
}
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init( selector, context ) {
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
context = jQuerySub( context );
}
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
},
browser: {}
});
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] = true;
jQuery.browser.version = browserMatch.version;
}
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari = true;
}
// IE doesn't match non-breaking spaces with \s
if ( rnotwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
jQuery.ready();
};
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
jQuery.ready();
}
};
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
jQuery.ready();
}
return jQuery;
})();
var // Promise methods
promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
// Static reference to slice
sliceDeferred = [].slice;
jQuery.extend({
// Create a simple deferred (one callbacks list)
_Deferred: function() {
var // callbacks list
callbacks = [],
// stored [ context , args ]
fired,
// to avoid firing when already doing so
firing,
// flag to know if the deferred has been cancelled
cancelled,
// the deferred itself
deferred = {
// done( f1, f2, ...)
done: function() {
if ( !cancelled ) {
var args = arguments,
i,
length,
elem,
type,
_fired;
if ( fired ) {
_fired = fired;
fired = 0;
}
for ( i = 0, length = args.length; i < length; i++ ) {
elem = args[ i ];
type = jQuery.type( elem );
if ( type === "array" ) {
deferred.done.apply( deferred, elem );
} else if ( type === "function" ) {
callbacks.push( elem );
}
}
if ( _fired ) {
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
}
}
return this;
},
// resolve with given context and args
resolveWith: function( context, args ) {
if ( !cancelled && !fired && !firing ) {
// make sure args are available (#8421)
args = args || [];
firing = 1;
try {
while( callbacks[ 0 ] ) {
callbacks.shift().apply( context, args );
}
}
finally {
fired = [ context, args ];
firing = 0;
}
}
return this;
},
// resolve with this as context and given arguments
resolve: function() {
deferred.resolveWith( this, arguments );
return this;
},
// Has this deferred been resolved?
isResolved: function() {
return !!( firing || fired );
},
// Cancel
cancel: function() {
cancelled = 1;
callbacks = [];
return this;
}
};
return deferred;
},
// Full fledged deferred (two callbacks list)
Deferred: function( func ) {
var deferred = jQuery._Deferred(),
failDeferred = jQuery._Deferred(),
promise;
// Add errorDeferred methods, then and promise
jQuery.extend( deferred, {
then: function( doneCallbacks, failCallbacks ) {
deferred.done( doneCallbacks ).fail( failCallbacks );
return this;
},
always: function() {
return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
},
fail: failDeferred.done,
rejectWith: failDeferred.resolveWith,
reject: failDeferred.resolve,
isRejected: failDeferred.isResolved,
pipe: function( fnDone, fnFail ) {
return jQuery.Deferred(function( newDefer ) {
jQuery.each( {
done: [ fnDone, "resolve" ],
fail: [ fnFail, "reject" ]
}, function( handler, data ) {
var fn = data[ 0 ],
action = data[ 1 ],
returned;
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject );
} else {
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
}
});
} else {
deferred[ handler ]( newDefer[ action ] );
}
});
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
if ( obj == null ) {
if ( promise ) {
return promise;
}
promise = obj = {};
}
var i = promiseMethods.length;
while( i-- ) {
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
}
return obj;
}
});
// Make sure only one callback list will be used
deferred.done( failDeferred.cancel ).fail( deferred.cancel );
// Unexpose cancel
delete deferred.cancel;
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
return deferred;
},
// Deferred helper
when: function( firstParam ) {
var args = arguments,
i = 0,
length = args.length,
count = length,
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
firstParam :
jQuery.Deferred();
function resolveFunc( i ) {
return function( value ) {
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
if ( !( --count ) ) {
// Strange bug in FF4:
// Values changed onto the arguments object sometimes end up as undefined values
// outside the $.when method. Cloning the object into a fresh array solves the issue
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
}
};
}
if ( length > 1 ) {
for( ; i < length; i++ ) {
if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
args[ i ].promise().then( resolveFunc(i), deferred.reject );
} else {
--count;
}
}
if ( !count ) {
deferred.resolveWith( deferred, args );
}
} else if ( deferred !== firstParam ) {
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
}
return deferred.promise();
}
});
jQuery.support = (function() {
var div = document.createElement( "div" ),
documentElement = document.documentElement,
all,
a,
select,
opt,
input,
marginDiv,
support,
fragment,
body,
testElementParent,
testElement,
testElementStyle,
tds,
events,
eventName,
i,
isSupported;
// Preliminary tests
div.setAttribute("className", "t");
div.innerHTML = " <link><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type=checkbox>";
all = div.getElementsByTagName( "*" );
a = div.getElementsByTagName( "a" )[ 0 ];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return {};
}
// First batch of supports tests
select = document.createElement( "select" );
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName( "input" )[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName( "tbody" ).length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName( "link" ).length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55$/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: ( input.value === "on" ),
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// Will be defined later
submitBubbles: true,
changeBubbles: true,
focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( "onclick", function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
});
div.cloneNode( true ).fireEvent( "onclick" );
}
// Check if a radio maintains it's value
// after being appended to the DOM
input = document.createElement("input");
input.value = "t";
input.setAttribute("type", "radio");
support.radioValue = input.value === "t";
input.setAttribute("checked", "checked");
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.firstChild );
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
div.innerHTML = "";
// Figure out if the W3C box model works as expected
div.style.width = div.style.paddingLeft = "1px";
body = document.getElementsByTagName( "body" )[ 0 ];
// We use our own, invisible, body unless the body is already present
// in which case we use a div (#9239)
testElement = document.createElement( body ? "div" : "body" );
testElementStyle = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0,
background: "none"
};
if ( body ) {
jQuery.extend( testElementStyle, {
position: "absolute",
left: "-1000px",
top: "-1000px"
});
}
for ( i in testElementStyle ) {
testElement.style[ i ] = testElementStyle[ i ];
}
testElement.appendChild( div );
testElementParent = body || documentElement;
testElementParent.insertBefore( testElement, testElementParent.firstChild );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
support.boxModel = div.offsetWidth === 2;
if ( "zoom" in div.style ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.style.display = "inline";
div.style.zoom = 1;
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "";
div.innerHTML = "<div style='width:4px;'></div>";
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
}
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
tds = div.getElementsByTagName( "td" );
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Check if empty table cells still have offsetWidth/Height
// (IE < 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
div.innerHTML = "";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( document.defaultView && document.defaultView.getComputedStyle ) {
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
// Remove the body element we added
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for( i in {
submit: 1,
change: 1,
focusin: 1
} ) {
eventName = "on" + i;
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, "return;" );
isSupported = ( typeof div[ eventName ] === "function" );
}
support[ i + "Bubbles" ] = isSupported;
}
}
// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;
return support;
})();
// Keep track of boxModel
jQuery.boxModel = jQuery.support.boxModel;
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([a-z])([A-Z])/g;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ jQuery.expando ] = id = ++jQuery.uuid;
} else {
id = jQuery.expando;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
} else {
cache[ id ] = jQuery.extend(cache[ id ], name);
}
}
thisCache = cache[ id ];
// Internal jQuery data is stored in a separate object inside the object's data
// cache in order to avoid key collisions between internal data and user-defined
// data
if ( pvt ) {
if ( !thisCache[ internalKey ] ) {
thisCache[ internalKey ] = {};
}
thisCache = thisCache[ internalKey ];
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
// not attempt to inspect the internal events object using jQuery.data, as this
// internal data object is undocumented and subject to change.
if ( name === "events" && !thisCache[name] ) {
return thisCache[ internalKey ] && thisCache[ internalKey ].events;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
}
} else {
ret = thisCache;
}
return ret;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache,
// Reference to internal data cache key
internalKey = jQuery.expando,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
// See jQuery.data for more information
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
if ( thisCache ) {
// Support interoperable removal of hyphenated or camelcased keys
if ( !thisCache[ name ] ) {
name = jQuery.camelCase( name );
}
delete thisCache[ name ];
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !isEmptyDataObject(thisCache) ) {
return;
}
}
}
// See jQuery.data for more information
if ( pvt ) {
delete cache[ id ][ internalKey ];
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject(cache[ id ]) ) {
return;
}
}
var internalCache = cache[ id ][ internalKey ];
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
// Ensure that `cache` is not a window object #10080
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
delete cache[ id ];
} else {
cache[ id ] = null;
}
// We destroyed the entire user cache at once because it's faster than
// iterating through each key, but we need to continue to persist internal
// data if it existed
if ( internalCache ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
cache[ id ][ internalKey ] = internalCache;
// Otherwise, we need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
} else if ( isNode ) {
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
} else {
elem[ jQuery.expando ] = null;
}
}
},
// For internal use only.
_data: function( elem, name, data ) {
return jQuery.data( elem, name, data, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
data = jQuery.data( this[0] );
if ( this[0].nodeType === 1 ) {
var attr = this[0].attributes, name;
for ( var i = 0, l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( this[0], name, data[ name ] );
}
}
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
// Try to fetch any internally stored data first
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
data = dataAttr( this[0], key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.each(function() {
var $this = jQuery( this ),
args = [ parts[0], value ];
$this.triggerHandler( "setData" + parts[1] + "!", args );
jQuery.data( this, key, value );
$this.triggerHandler( "changeData" + parts[1] + "!", args );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
!jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
// property to be considered empty objects; this property always exists in
// order to make sure JSON.stringify does not expose internal metadata
function isEmptyDataObject( obj ) {
for ( var name in obj ) {
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
function handleQueueMarkDefer( elem, type, src ) {
var deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
defer = jQuery.data( elem, deferDataKey, undefined, true );
if ( defer &&
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
// Give room for hard-coded callbacks to fire first
// and eventually mark/queue something else on the element
setTimeout( function() {
if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
!jQuery.data( elem, markDataKey, undefined, true ) ) {
jQuery.removeData( elem, deferDataKey, true );
defer.resolve();
}
}, 0 );
}
}
jQuery.extend({
_mark: function( elem, type ) {
if ( elem ) {
type = (type || "fx") + "mark";
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
}
},
_unmark: function( force, elem, type ) {
if ( force !== true ) {
type = elem;
elem = force;
force = false;
}
if ( elem ) {
type = type || "fx";
var key = type + "mark",
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
if ( count ) {
jQuery.data( elem, key, count, true );
} else {
jQuery.removeData( elem, key, true );
handleQueueMarkDefer( elem, type, "mark" );
}
}
},
queue: function( elem, type, data ) {
if ( elem ) {
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type, undefined, true );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data), true );
} else {
q.push( data );
}
}
return q || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift(),
defer;
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
if ( !queue.length ) {
jQuery.removeData( elem, type + "queue", true );
handleQueueMarkDefer( elem, type, "queue" );
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function() {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, object ) {
if ( typeof type !== "string" ) {
object = type;
type = undefined;
}
type = type || "fx";
var defer = jQuery.Deferred(),
elements = this,
i = elements.length,
count = 1,
deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
tmp;
function resolve() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
}
while( i-- ) {
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
count++;
tmp.done( resolve );
}
}
resolve();
return defer.promise();
}
});
var rclass = /[\n\t\r]/g,
rspace = /\s+/,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
nodeHook, boolHook;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.prop );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classNames, i, l, elem,
setClass, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
classNames = value.split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 ) {
if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
var classNames, i, l, elem, className, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
classNames = (value || "").split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
className = (" " + elem.className + " ").replace( rclass, " " );
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[ c ] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
return true;
}
}
return false;
},
val: function( value ) {
var hooks, ret,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return undefined;
}
var isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var self = jQuery(this), val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value,
index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
if ( one && !values.length && options.length ) {
return jQuery( options[ index ] ).val();
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attrFix: {
// Always normalize to ensure hook usage
tabindex: "tabIndex"
},
attr: function( elem, name, value, pass ) {
var nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery( elem )[ name ]( value );
}
// Fallback to prop when attributes are not supported
if ( !("getAttribute" in elem) ) {
return jQuery.prop( elem, name, value );
}
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// Normalize the name if needed
if ( notxml ) {
name = jQuery.attrFix[ name ] || name;
hooks = jQuery.attrHooks[ name ];
if ( !hooks ) {
// Use boolHook for boolean attributes
if ( rboolean.test( name ) ) {
hooks = boolHook;
// Use nodeHook if available( IE6/7 )
} else if ( nodeHook ) {
hooks = nodeHook;
}
}
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
return undefined;
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, "" + value );
return value;
}
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return ret === null ?
undefined :
ret;
}
},
removeAttr: function( elem, name ) {
var propName;
if ( elem.nodeType === 1 ) {
name = jQuery.attrFix[ name ] || name;
jQuery.attr( elem, name, "" );
elem.removeAttribute( name );
// Set corresponding property to false for boolean attributes
if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
elem[ propName ] = false;
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
},
// Use the value property for back compat
// Use the nodeHook for button elements in IE6/7 (#1954)
value: {
get: function( elem, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.get( elem, name );
}
return name in elem ?
elem.value :
null;
},
set: function( elem, value, name ) {
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
return nodeHook.set( elem, value, name );
}
// Does not return so that setAttribute is also used
elem.value = value;
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return (elem[ name ] = value);
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Add the tabindex propHook to attrHooks for back-compat
jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
// Align boolean attributes with corresponding properties
// Fall back to attribute presence where some booleans are not supported
var attrNode;
return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
var propName;
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
// value is true since we know at this point it's type boolean and not false
// Set boolean attributes to the same name and set the DOM property
propName = jQuery.propFix[ name ] || name;
if ( propName in elem ) {
// Only set the IDL specifically if it already exists on the element
elem[ propName ] = true;
}
elem.setAttribute( name, name.toLowerCase() );
}
return name;
}
};
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !jQuery.support.getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
// Return undefined if nodeValue is empty string
return ret && ret.nodeValue !== "" ?
ret.nodeValue :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
ret = document.createAttribute( name );
elem.setAttributeNode( ret );
}
return (ret.nodeValue = value + "");
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret === null ? undefined : ret;
}
});
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Normalize to lowercase since IE uppercases css property names
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
return (elem.style.cssText = "" + value);
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
return null;
}
});
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
}
}
});
});
var rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g,
rspaces = / /g,
rescape = /[^\w\s.|`]/g,
fcleanup = function( nm ) {
return nm.replace(rescape, "\\$&");
};
/*
* A number of helper functions used for managing events.
* Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = {
// Bind an event to an element
// Original by Dean Edwards
add: function( elem, types, handler, data ) {
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
if ( handler === false ) {
handler = returnFalse;
} else if ( !handler ) {
// Fixes bug #7229. Fix recommended by jdalton
return;
}
var handleObjIn, handleObj;
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
}
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure
var elemData = jQuery._data( elem );
// If no elemData is found then we must be trying to bind to one of the
// banned noData elements
if ( !elemData ) {
return;
}
var events = elemData.events,
eventHandle = elemData.handle;
if ( !events ) {
elemData.events = events = {};
}
if ( !eventHandle ) {
elemData.handle = eventHandle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
}
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native events in IE.
eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = types.split(" ");
var type, i = 0, namespaces;
while ( (type = types[ i++ ]) ) {
handleObj = handleObjIn ?
jQuery.extend({}, handleObjIn) :
{ handler: handler, data: data };
// Namespaced event handlers
if ( type.indexOf(".") > -1 ) {
namespaces = type.split(".");
type = namespaces.shift();
handleObj.namespace = namespaces.slice(0).sort().join(".");
} else {
namespaces = [];
handleObj.namespace = "";
}
handleObj.type = type;
if ( !handleObj.guid ) {
handleObj.guid = handler.guid;
}
// Get the current list of functions bound to this event
var handlers = events[ type ],
special = jQuery.event.special[ type ] || {};
// Init the event handler queue
if ( !handlers ) {
handlers = events[ type ] = [];
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add the function to the element's handler list
handlers.push( handleObj );
// Keep track of which events have been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
global: {},
// Detach an event or set of events from an element
remove: function( elem, types, handler, pos ) {
// don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
if ( handler === false ) {
handler = returnFalse;
}
var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
events = elemData && elemData.events;
if ( !elemData || !events ) {
return;
}
// types is actually an event object here
if ( types && types.type ) {
handler = types.handler;
types = types.type;
}
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
// Handle multiple events separated by a space
// jQuery(...).unbind("mouseover mouseout", fn);
types = types.split(" ");
while ( (type = types[ i++ ]) ) {
origType = type;
handleObj = null;
all = type.indexOf(".") < 0;
namespaces = [];
if ( !all ) {
// Namespaced event handlers
namespaces = type.split(".");
type = namespaces.shift();
namespace = new RegExp("(^|\\.)" +
jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
}
eventType = events[ type ];
if ( !eventType ) {
continue;
}
if ( !handler ) {
for ( j = 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( all || namespace.test( handleObj.namespace ) ) {
jQuery.event.remove( elem, origType, handleObj.handler, j );
eventType.splice( j--, 1 );
}
}
continue;
}
special = jQuery.event.special[ type ] || {};
for ( j = pos || 0; j < eventType.length; j++ ) {
handleObj = eventType[ j ];
if ( handler.guid === handleObj.guid ) {
// remove the given handler for the given type
if ( all || namespace.test( handleObj.namespace ) ) {
if ( pos == null ) {
eventType.splice( j--, 1 );
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
if ( pos != null ) {
break;
}
}
}
// remove generic event handler if no more handlers exist
if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
ret = null;
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
var handle = elemData.handle;
if ( handle ) {
handle.elem = null;
}
delete elemData.events;
delete elemData.handle;
if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem, undefined, true );
}
}
},
// Events that are safe to short-circuit if no handlers are attached.
// Native DOM events should not be added, they may have inline handlers.
customEvent: {
"getData": true,
"setData": true,
"changeData": true
},
trigger: function( event, data, elem, onlyHandlers ) {
// Event object or event type
var type = event.type || event,
namespaces = [],
exclusive;
if ( type.indexOf("!") >= 0 ) {
// Exclusive events trigger only for the exact event (no namespaces)
type = type.slice(0, -1);
exclusive = true;
}
if ( type.indexOf(".") >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
// No jQuery handlers for this event type, and it can't have inline handlers
return;
}
// Caller can pass in an Event, Object, or just an event type string
event = typeof event === "object" ?
// jQuery.Event object
event[ jQuery.expando ] ? event :
// Object literal
new jQuery.Event( type, event ) :
// Just the event type (string)
new jQuery.Event( type );
event.type = type;
event.exclusive = exclusive;
event.namespace = namespaces.join(".");
event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
// triggerHandler() and global events don't bubble or run the default action
if ( onlyHandlers || !elem ) {
event.preventDefault();
event.stopPropagation();
}
// Handle a global trigger
if ( !elem ) {
// TODO: Stop taunting the data cache; remove global events and always attach to document
jQuery.each( jQuery.cache, function() {
// internalKey variable is just used to make it easier to find
// and potentially change this stuff later; currently it just
// points to jQuery.expando
var internalKey = jQuery.expando,
internalCache = this[ internalKey ];
if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
jQuery.event.trigger( event, data, internalCache.handle.elem );
}
});
return;
}
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// Clean up the event in case it is being reused
event.result = undefined;
event.target = elem;
// Clone any incoming data and prepend the event, creating the handler arg list
data = data != null ? jQuery.makeArray( data ) : [];
data.unshift( event );
var cur = elem,
// IE doesn't like method names with a colon (#3533, #8272)
ontype = type.indexOf(":") < 0 ? "on" + type : "";
// Fire event on the current element, then bubble up the DOM tree
do {
var handle = jQuery._data( cur, "handle" );
event.currentTarget = cur;
if ( handle ) {
handle.apply( cur, data );
}
// Trigger an inline bound script
if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
event.result = false;
event.preventDefault();
}
// Bubble up to document, then to window
cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
} while ( cur && !event.isPropagationStopped() );
// If nobody prevented the default action, do it now
if ( !event.isDefaultPrevented() ) {
var old,
special = jQuery.event.special[ type ] || {};
if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction)() check here because IE6/7 fails that test.
// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
try {
if ( ontype && elem[ type ] ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
if ( old ) {
elem[ ontype ] = null;
}
jQuery.event.triggered = type;
elem[ type ]();
}
} catch ( ieError ) {}
if ( old ) {
elem[ ontype ] = old;
}
jQuery.event.triggered = undefined;
}
}
return event.result;
},
handle: function( event ) {
event = jQuery.event.fix( event || window.event );
// Snapshot the handlers list since a called handler may add/remove events.
var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
run_all = !event.exclusive && !event.namespace,
args = Array.prototype.slice.call( arguments, 0 );
// Use the fix-ed Event rather than the (read-only) native event
args[0] = event;
event.currentTarget = this;
for ( var j = 0, l = handlers.length; j < l; j++ ) {
var handleObj = handlers[ j ];
// Triggered event must 1) be non-exclusive and have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event.
if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
// Pass in a reference to the handler function itself
// So that we can later remove it
event.handler = handleObj.handler;
event.data = handleObj.data;
event.handleObj = handleObj;
var ret = handleObj.handler.apply( this, args );
if ( ret !== undefined ) {
event.result = ret;
if ( ret === false ) {
event.preventDefault();
event.stopPropagation();
}
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
return event.result;
},
props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// store a copy of the original event object
// and "clone" to set read-only properties
var originalEvent = event;
event = jQuery.Event( originalEvent );
for ( var i = this.props.length, prop; i; ) {
prop = this.props[ --i ];
event[ prop ] = originalEvent[ prop ];
}
// Fix target property, if necessary
if ( !event.target ) {
// Fixes #1925 where srcElement might not be defined either
event.target = event.srcElement || document;
}
// check if target is a textnode (safari)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && event.fromElement ) {
event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
}
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
var eventDocument = event.target.ownerDocument || document,
doc = eventDocument.documentElement,
body = eventDocument.body;
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// Add which for key events
if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
event.which = event.charCode != null ? event.charCode : event.keyCode;
}
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
if ( !event.metaKey && event.ctrlKey ) {
event.metaKey = event.ctrlKey;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && event.button !== undefined ) {
event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
}
return event;
},
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this,
liveConvert( handleObj.origType, handleObj.selector ),
jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
},
remove: function( handleObj ) {
jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
}
},
beforeunload: {
setup: function( data, namespaces, eventHandle ) {
// We only want to do this special case on windows
if ( jQuery.isWindow( this ) ) {
this.onbeforeunload = eventHandle;
}
},
teardown: function( namespaces, eventHandle ) {
if ( this.onbeforeunload === eventHandle ) {
this.onbeforeunload = null;
}
}
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
if ( elem.detachEvent ) {
elem.detachEvent( "on" + type, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !this.preventDefault ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if stopPropagation exists run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// otherwise set the cancelBubble property of the original event to true (IE)
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
// Check if mouse(over|out) are still within the same parent element
var related = event.relatedTarget,
inside = false,
eventType = event.type;
event.type = event.data;
if ( related !== this ) {
if ( related ) {
inside = jQuery.contains( this, related );
}
if ( !inside ) {
jQuery.event.handle.apply( this, arguments );
event.type = eventType;
}
}
},
// In case of event delegation, we only need to rename the event.type,
// liveHandler will take care of the rest.
delegate = function( event ) {
event.type = event.data;
jQuery.event.handle.apply( this, arguments );
};
// Create mouseenter and mouseleave events
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
setup: function( data ) {
jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
},
teardown: function( data ) {
jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
}
};
});
// submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function( data, namespaces ) {
if ( !jQuery.nodeName( this, "form" ) ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
var elem = e.target,
type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
trigger( "submit", this, arguments );
}
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
var elem = e.target,
type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
trigger( "submit", this, arguments );
}
});
} else {
return false;
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var changeFilters,
getVal = function( elem ) {
var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
val = elem.checked;
} else if ( type === "select-multiple" ) {
val = elem.selectedIndex > -1 ?
jQuery.map( elem.options, function( elem ) {
return elem.selected;
}).join("-") :
"";
} else if ( jQuery.nodeName( elem, "select" ) ) {
val = elem.selectedIndex;
}
return val;
},
testChange = function testChange( e ) {
var elem = e.target, data, val;
if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
return;
}
data = jQuery._data( elem, "_change_data" );
val = getVal(elem);
// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery._data( elem, "_change_data", val );
}
if ( data === undefined || val === data ) {
return;
}
if ( data != null || val ) {
e.type = "change";
e.liveFired = undefined;
jQuery.event.trigger( e, arguments[1], elem );
}
};
jQuery.event.special.change = {
filters: {
focusout: testChange,
beforedeactivate: testChange,
click: function( e ) {
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
testChange.call( this, e );
}
},
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
type === "select-multiple" ) {
testChange.call( this, e );
}
},
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
// information
beforeactivate: function( e ) {
var elem = e.target;
jQuery._data( elem, "_change_data", getVal(elem) );
}
},
setup: function( data, namespaces ) {
if ( this.type === "file" ) {
return false;
}
for ( var type in changeFilters ) {
jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
}
return rformElems.test( this.nodeName );
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialChange" );
return rformElems.test( this.nodeName );
}
};
changeFilters = jQuery.event.special.change.filters;
// Handle when the input is .focus()'d
changeFilters.focus = changeFilters.beforeactivate;
}
function trigger( type, elem, args ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
// Don't pass args or remember liveFired; they apply to the donor event.
var event = jQuery.extend( {}, args[ 0 ] );
event.type = type;
event.originalEvent = {};
event.liveFired = undefined;
jQuery.event.handle.call( elem, event );
if ( event.isDefaultPrevented() ) {
args[ 0 ].preventDefault();
}
}
// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0;
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
function handler( donor ) {
// Donor event is always a native one; fix it and switch its type.
// Let focusin/out handler cancel the donor focus/blur event.
var e = jQuery.event.fix( donor );
e.type = fix;
e.originalEvent = {};
jQuery.event.trigger( e, null, e.target );
if ( e.isDefaultPrevented() ) {
donor.preventDefault();
}
}
});
}
jQuery.each(["bind", "one"], function( i, name ) {
jQuery.fn[ name ] = function( type, data, fn ) {
var handler;
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ name ](key, data, type[key], fn);
}
return this;
}
if ( arguments.length === 2 || data === false ) {
fn = data;
data = undefined;
}
if ( name === "one" ) {
handler = function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
};
handler.guid = fn.guid || jQuery.guid++;
} else {
handler = fn;
}
if ( type === "unload" && name !== "one" ) {
this.one( type, data, fn );
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.add( this[i], type, handler, data );
}
}
return this;
};
});
jQuery.fn.extend({
unbind: function( type, fn ) {
// Handle object literals
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
if ( this[0] ) {
return jQuery.event.trigger( type, data, this[0], true );
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments,
guid = fn.guid || jQuery.guid++,
i = 0,
toggler = function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
event.preventDefault();
// and execute the function
return args[ lastToggle ].apply( this, arguments ) || false;
};
// link all the functions, so any of them can unbind this click handler
toggler.guid = guid;
while ( i < args.length ) {
args[ i++ ].guid = guid;
}
return this.click( toggler );
},
hover: function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
}
});
var liveMap = {
focus: "focusin",
blur: "focusout",
mouseenter: "mouseover",
mouseleave: "mouseout"
};
jQuery.each(["live", "die"], function( i, name ) {
jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
var type, i = 0, match, namespaces, preType,
selector = origSelector || this.selector,
context = origSelector ? this : jQuery( this.context );
if ( typeof types === "object" && !types.preventDefault ) {
for ( var key in types ) {
context[ name ]( key, data, types[key], selector );
}
return this;
}
if ( name === "die" && !types &&
origSelector && origSelector.charAt(0) === "." ) {
context.unbind( origSelector );
return this;
}
if ( data === false || jQuery.isFunction( data ) ) {
fn = data || returnFalse;
data = undefined;
}
types = (types || "").split(" ");
while ( (type = types[ i++ ]) != null ) {
match = rnamespaces.exec( type );
namespaces = "";
if ( match ) {
namespaces = match[0];
type = type.replace( rnamespaces, "" );
}
if ( type === "hover" ) {
types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
continue;
}
preType = type;
if ( liveMap[ type ] ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;
} else {
type = (liveMap[ type ] || type) + namespaces;
}
if ( name === "live" ) {
// bind live handler
for ( var j = 0, l = context.length; j < l; j++ ) {
jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
}
} else {
// unbind live handler
context.unbind( "live." + liveConvert( type, selector ), fn );
}
}
return this;
};
});
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery._data( this, "events" );
// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
return;
}
if ( event.namespace ) {
namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
}
event.liveFired = this;
var live = events.live.slice(0);
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
selectors.push( handleObj.selector );
} else {
live.splice( j--, 1 );
}
}
match = jQuery( event.target ).closest( selectors, event.currentTarget );
for ( i = 0, l = match.length; i < l; i++ ) {
close = match[i];
for ( j = 0; j < live.length; j++ ) {
handleObj = live[j];
if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
elem = close.elem;
related = null;
// Those two events require additional checking
if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
event.type = handleObj.preType;
related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
// Make sure not to accidentally match a child element with the same selector
if ( related && jQuery.contains( elem, related ) ) {
related = elem;
}
}
if ( !related || related !== elem ) {
elems.push({ elem: elem, handleObj: handleObj, level: close.level });
}
}
}
}
for ( i = 0, l = elems.length; i < l; i++ ) {
match = elems[i];
if ( maxLevel && match.level > maxLevel ) {
break;
}
event.currentTarget = match.elem;
event.data = match.handleObj.data;
event.handleObj = match.handleObj;
ret = match.handleObj.origHandler.apply( match.elem, arguments );
if ( ret === false || event.isPropagationStopped() ) {
maxLevel = match.level;
if ( ret === false ) {
stop = false;
}
if ( event.isImmediatePropagationStopped() ) {
break;
}
}
}
return stop;
}
function liveConvert( type, selector ) {
return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
if ( fn == null ) {
fn = data;
data = null;
}
return arguments.length > 0 ?
this.bind( name, data, fn ) :
this.trigger( name );
};
if ( jQuery.attrFn ) {
jQuery.attrFn[ name ] = true;
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
done = 0,
toString = Object.prototype.toString,
hasDuplicate = false,
baseHasDuplicate = true,
rBackslash = /\\/g,
rNonWord = /\W/;
// Here we check if the JavaScript engine is using some sort of
// optimization where it does not always call our comparision
// function. If that is the case, discard the hasDuplicate value.
// Thus far that includes Google Chrome.
[0, 0].sort(function() {
baseHasDuplicate = false;
return 0;
});
var Sizzle = function( selector, context, results, seed ) {
results = results || [];
context = context || document;
var origContext = context;
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
return [];
}
if ( !selector || typeof selector !== "string" ) {
return results;
}
var m, set, checkSet, extra, ret, cur, pop, i,
prune = true,
contextXML = Sizzle.isXML( context ),
parts = [],
soFar = selector;
// Reset the position of the chunker regexp (start from head)
do {
chunker.exec( "" );
m = chunker.exec( soFar );
if ( m ) {
soFar = m[3];
parts.push( m[1] );
if ( m[2] ) {
extra = m[3];
break;
}
}
} while ( m );
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context );
} else {
set = Expr.relative[ parts[0] ] ?
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] ) {
selector += parts.shift();
}
set = posProcess( selector, set );
}
}
} else {
// Take a shortcut and set the context if the root selector is an ID
// (but not if it'll be faster if the inner selector is an ID)
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ?
Sizzle.filter( ret.expr, ret.set )[0] :
ret.set[0];
}
if ( context ) {
ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ?
Sizzle.filter( ret.expr, ret.set ) :
ret.set;
if ( parts.length > 0 ) {
checkSet = makeArray( set );
} else {
prune = false;
}
while ( parts.length ) {
cur = parts.pop();
pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, contextXML );
}
} else {
checkSet = parts = [];
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
Sizzle.error( cur || selector );
}
if ( toString.call(checkSet) === "[object Array]" ) {
if ( !prune ) {
results.push.apply( results, checkSet );
} else if ( context && context.nodeType === 1 ) {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
results.push( set[i] );
}
}
} else {
for ( i = 0; checkSet[i] != null; i++ ) {
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
results.push( set[i] );
}
}
}
} else {
makeArray( checkSet, results );
}
if ( extra ) {
Sizzle( extra, origContext, results, seed );
Sizzle.uniqueSort( results );
}
return results;
};
Sizzle.uniqueSort = function( results ) {
if ( sortOrder ) {
hasDuplicate = baseHasDuplicate;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( var i = 1; i < results.length; i++ ) {
if ( results[i] === results[ i - 1 ] ) {
results.splice( i--, 1 );
}
}
}
}
return results;
};
Sizzle.matches = function( expr, set ) {
return Sizzle( expr, null, null, set );
};
Sizzle.matchesSelector = function( node, expr ) {
return Sizzle( expr, null, null, [node] ).length > 0;
};
Sizzle.find = function( expr, context, isXML ) {
var set;
if ( !expr ) {
return [];
}
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
var match,
type = Expr.order[i];
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
var left = match[1];
match.splice( 1, 1 );
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace( rBackslash, "" );
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = typeof context.getElementsByTagName !== "undefined" ?
context.getElementsByTagName( "*" ) :
[];
}
return { set: set, expr: expr };
};
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
var found, item,
filter = Expr.filter[ type ],
left = match[1];
anyFound = false;
match.splice(1,1);
if ( left.substr( left.length - 1 ) === "\\" ) {
continue;
}
if ( curLoop === result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr === old ) {
if ( anyFound == null ) {
Sizzle.error( expr );
} else {
break;
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function( elem ) {
return elem.getAttribute( "href" );
},
type: function( elem ) {
return elem.getAttribute( "type" );
}
},
relative: {
"+": function(checkSet, part){
var isPartStr = typeof part === "string",
isTag = isPartStr && !rNonWord.test( part ),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag ) {
part = part.toLowerCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
elem || false :
elem === part;
}
}
if ( isPartStrNotTag ) {
Sizzle.filter( part, checkSet, true );
}
},
">": function( checkSet, part ) {
var elem,
isPartStr = typeof part === "string",
i = 0,
l = checkSet.length;
if ( isPartStr && !rNonWord.test( part ) ) {
part = part.toLowerCase();
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
}
}
} else {
for ( ; i < l; i++ ) {
elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
"~": function( checkSet, part, isXML ) {
var nodeCheck,
doneName = done++,
checkFn = dirCheck;
if ( typeof part === "string" && !rNonWord.test( part ) ) {
part = part.toLowerCase();
nodeCheck = part;
checkFn = dirNodeCheck;
}
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
find: {
ID: function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
},
NAME: function( match, context ) {
if ( typeof context.getElementsByName !== "undefined" ) {
var ret = [],
results = context.getElementsByName( match[1] );
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function( match, context ) {
if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( match[1] );
}
}
},
preFilter: {
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
match = " " + match[1].replace( rBackslash, "" ) + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
if ( !inplace ) {
result.push( elem );
}
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
return false;
},
ID: function( match ) {
return match[1].replace( rBackslash, "" );
},
TAG: function( match, curLoop ) {
return match[1].replace( rBackslash, "" ).toLowerCase();
},
CHILD: function( match ) {
if ( match[1] === "nth" ) {
if ( !match[2] ) {
Sizzle.error( match[0] );
}
match[2] = match[2].replace(/^\+|\s*/g, '');
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
// calculate the numbers (first)n+(last) including if they are negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
else if ( match[2] ) {
Sizzle.error( match[0] );
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
var name = match[1] = match[1].replace( rBackslash, "" );
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
// Handle if an un-quoted value was used
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function( match, curLoop, inplace, result, not ) {
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple one
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
return true;
}
return match;
},
POS: function( match ) {
match.unshift( true );
return match;
}
},
filters: {
enabled: function( elem ) {
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function( elem ) {
return elem.disabled === true;
},
checked: function( elem ) {
return elem.checked === true;
},
selected: function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
parent: function( elem ) {
return !!elem.firstChild;
},
empty: function( elem ) {
return !elem.firstChild;
},
has: function( elem, i, match ) {
return !!Sizzle( match[3], elem ).length;
},
header: function( elem ) {
return (/h\d/i).test( elem.nodeName );
},
text: function( elem ) {
var attr = elem.getAttribute( "type" ), type = elem.type;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
},
radio: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
},
checkbox: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
},
file: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
},
password: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
},
submit: function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && "submit" === elem.type;
},
image: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
},
reset: function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && "reset" === elem.type;
},
button: function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && "button" === elem.type || name === "button";
},
input: function( elem ) {
return (/input|select|textarea|button/i).test( elem.nodeName );
},
focus: function( elem ) {
return elem === elem.ownerDocument.activeElement;
}
},
setFilters: {
first: function( elem, i ) {
return i === 0;
},
last: function( elem, i, match, array ) {
return i === array.length - 1;
},
even: function( elem, i ) {
return i % 2 === 0;
},
odd: function( elem, i ) {
return i % 2 === 1;
},
lt: function( elem, i, match ) {
return i < match[3] - 0;
},
gt: function( elem, i, match ) {
return i > match[3] - 0;
},
nth: function( elem, i, match ) {
return match[3] - 0 === i;
},
eq: function( elem, i, match ) {
return match[3] - 0 === i;
}
},
filter: {
PSEUDO: function( elem, match, i, array ) {
var name = match[1],
filter = Expr.filters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
} else if ( name === "contains" ) {
return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
} else if ( name === "not" ) {
var not = match[3];
for ( var j = 0, l = not.length; j < l; j++ ) {
if ( not[j] === elem ) {
return false;
}
}
return true;
} else {
Sizzle.error( name );
}
},
CHILD: function( elem, match ) {
var type = match[1],
node = elem;
switch ( type ) {
case "only":
case "first":
while ( (node = node.previousSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
if ( type === "first" ) {
return true;
}
node = elem;
case "last":
while ( (node = node.nextSibling) ) {
if ( node.nodeType === 1 ) {
return false;
}
}
return true;
case "nth":
var first = match[2],
last = match[3];
if ( first === 1 && last === 0 ) {
return true;
}
var doneName = match[0],
parent = elem.parentNode;
if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
var count = 0;
for ( node = parent.firstChild; node; node = node.nextSibling ) {
if ( node.nodeType === 1 ) {
node.nodeIndex = ++count;
}
}
parent.sizcache = doneName;
}
var diff = elem.nodeIndex - last;
if ( first === 0 ) {
return diff === 0;
} else {
return ( diff % first === 0 && diff / first >= 0 );
}
}
},
ID: function( elem, match ) {
return elem.nodeType === 1 && elem.getAttribute("id") === match;
},
TAG: function( elem, match ) {
return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
},
CLASS: function( elem, match ) {
return (" " + (elem.className || elem.getAttribute("class")) + " ")
.indexOf( match ) > -1;
},
ATTR: function( elem, match ) {
var name = match[1],
result = Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
elem[ name ] :
elem.getAttribute( name ),
value = result + "",
type = match[2],
check = match[4];
return result == null ?
type === "!=" :
type === "=" ?
value === check :
type === "*=" ?
value.indexOf(check) >= 0 :
type === "~=" ?
(" " + value + " ").indexOf(check) >= 0 :
!check ?
value && result !== false :
type === "!=" ?
value !== check :
type === "^=" ?
value.indexOf(check) === 0 :
type === "$=" ?
value.substr(value.length - check.length) === check :
type === "|=" ?
value === check || value.substr(0, check.length + 1) === check + "-" :
false;
},
POS: function( elem, match, i, array ) {
var name = match[2],
filter = Expr.setFilters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
}
}
}
};
var origPOS = Expr.match.POS,
fescape = function(all, num){
return "\\" + (num - 0 + 1);
};
for ( var type in Expr.match ) {
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
}
var makeArray = function( array, results ) {
array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
return results;
}
return array;
};
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
// Also verifies that the returned array holds DOM nodes
// (which is not the case in the Blackberry browser)
try {
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// Provide a fallback method if it does not work
} catch( e ) {
makeArray = function( array, results ) {
var i = 0,
ret = results || [];
if ( toString.call(array) === "[object Array]" ) {
Array.prototype.push.apply( ret, array );
} else {
if ( typeof array.length === "number" ) {
for ( var l = array.length; i < l; i++ ) {
ret.push( array[i] );
}
} else {
for ( ; array[i]; i++ ) {
ret.push( array[i] );
}
}
}
return ret;
};
}
var sortOrder, siblingCheck;
if ( document.documentElement.compareDocumentPosition ) {
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
return a.compareDocumentPosition ? -1 : 1;
}
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
};
} else {
sortOrder = function( a, b ) {
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
return 0;
// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;
}
var al, bl,
ap = [],
bp = [],
aup = a.parentNode,
bup = b.parentNode,
cur = aup;
// If the nodes are siblings (or identical) we can do a quick check
if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
} else if ( !aup ) {
return -1;
} else if ( !bup ) {
return 1;
}
// Otherwise they're somewhere else in the tree so we need
// to build up a full list of the parentNodes for comparison
while ( cur ) {
ap.unshift( cur );
cur = cur.parentNode;
}
cur = bup;
while ( cur ) {
bp.unshift( cur );
cur = cur.parentNode;
}
al = ap.length;
bl = bp.length;
// Start walking down the tree looking for a discrepancy
for ( var i = 0; i < al && i < bl; i++ ) {
if ( ap[i] !== bp[i] ) {
return siblingCheck( ap[i], bp[i] );
}
}
// We ended someplace up the tree so do a sibling check
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
};
siblingCheck = function( a, b, ret ) {
if ( a === b ) {
return ret;
}
var cur = a.nextSibling;
while ( cur ) {
if ( cur === b ) {
return -1;
}
cur = cur.nextSibling;
}
return 1;
};
}
// Utility function for retreiving the text value of an array of DOM nodes
Sizzle.getText = function( elems ) {
var ret = "", elem;
for ( var i = 0; elems[i]; i++ ) {
elem = elems[i];
// Get the text from text nodes and CDATA nodes
if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
ret += elem.nodeValue;
// Traverse everything else, except comment nodes
} else if ( elem.nodeType !== 8 ) {
ret += Sizzle.getText( elem.childNodes );
}
}
return ret;
};
// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
var form = document.createElement("div"),
id = "script" + (new Date()).getTime(),
root = document.documentElement;
form.innerHTML = "<a name='" + id + "'/>";
// Inject it into the root element, check its status, and remove it quickly
root.insertBefore( form, root.firstChild );
// The workaround has to do additional checks after a getElementById
// Which slows things down for other browsers (hence the branching)
if ( document.getElementById( id ) ) {
Expr.find.ID = function( match, context, isXML ) {
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ?
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
[m] :
undefined :
[];
}
};
Expr.filter.ID = function( elem, match ) {
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
return elem.nodeType === 1 && node && node.nodeValue === match;
};
}
root.removeChild( form );
// release memory in IE
root = form = null;
})();
(function(){
// Check to see if the browser returns only elements
// when doing getElementsByTagName("*")
// Create a fake element
var div = document.createElement("div");
div.appendChild( document.createComment("") );
// Make sure no comments are found
if ( div.getElementsByTagName("*").length > 0 ) {
Expr.find.TAG = function( match, context ) {
var results = context.getElementsByTagName( match[1] );
// Filter out possible comments
if ( match[1] === "*" ) {
var tmp = [];
for ( var i = 0; results[i]; i++ ) {
if ( results[i].nodeType === 1 ) {
tmp.push( results[i] );
}
}
results = tmp;
}
return results;
};
}
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function( elem ) {
return elem.getAttribute( "href", 2 );
};
}
// release memory in IE
div = null;
})();
if ( document.querySelectorAll ) {
(function(){
var oldSizzle = Sizzle,
div = document.createElement("div"),
id = "__sizzle__";
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;
}
Sizzle = function( query, context, extra, seed ) {
context = context || document;
// Only use querySelectorAll on non-XML documents
// (ID selectors don't work in non-HTML documents)
if ( !seed && !Sizzle.isXML(context) ) {
// See if we find a selector to speed up
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
// Speed-up: Sizzle("TAG")
if ( match[1] ) {
return makeArray( context.getElementsByTagName( query ), extra );
// Speed-up: Sizzle(".CLASS")
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
return makeArray( context.getElementsByClassName( match[2] ), extra );
}
}
if ( context.nodeType === 9 ) {
// Speed-up: Sizzle("body")
// The body element only exists once, optimize finding it
if ( query === "body" && context.body ) {
return makeArray( [ context.body ], extra );
// Speed-up: Sizzle("#ID")
} else if ( match && match[3] ) {
var elem = context.getElementById( match[3] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id === match[3] ) {
return makeArray( [ elem ], extra );
}
} else {
return makeArray( [], extra );
}
}
try {
return makeArray( context.querySelectorAll(query), extra );
} catch(qsaError) {}
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
var oldContext = context,
old = context.getAttribute( "id" ),
nid = old || id,
hasParent = context.parentNode,
relativeHierarchySelector = /^\s*[+~]/.test( query );
if ( !old ) {
context.setAttribute( "id", nid );
} else {
nid = nid.replace( /'/g, "\\$&" );
}
if ( relativeHierarchySelector && hasParent ) {
context = context.parentNode;
}
try {
if ( !relativeHierarchySelector || hasParent ) {
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
}
} catch(pseudoError) {
} finally {
if ( !old ) {
oldContext.removeAttribute( "id" );
}
}
}
}
return oldSizzle(query, context, extra, seed);
};
for ( var prop in oldSizzle ) {
Sizzle[ prop ] = oldSizzle[ prop ];
}
// release memory in IE
div = null;
})();
}
(function(){
var html = document.documentElement,
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
if ( matches ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9 fails this)
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
pseudoWorks = false;
try {
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( document.documentElement, "[test!='']:sizzle" );
} catch( pseudoError ) {
pseudoWorks = true;
}
Sizzle.matchesSelector = function( node, expr ) {
// Make sure that attribute selectors are quoted
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
if ( !Sizzle.isXML( node ) ) {
try {
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
var ret = matches.call( node, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || !disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9, so check for that
node.document && node.document.nodeType !== 11 ) {
return ret;
}
}
} catch(e) {}
}
return Sizzle(expr, null, null, [node]).length > 0;
};
}
})();
(function(){
var div = document.createElement("div");
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
// Opera can't find a second classname (in 9.6)
// Also, make sure that getElementsByClassName actually exists
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
return;
}
// Safari caches class attributes, doesn't catch changes (in 3.2)
div.lastChild.className = "e";
if ( div.getElementsByClassName("e").length === 1 ) {
return;
}
Expr.order.splice(1, 0, "CLASS");
Expr.find.CLASS = function( match, context, isXML ) {
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
return context.getElementsByClassName(match[1]);
}
};
// release memory in IE
div = null;
})();
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem.sizcache = doneName;
elem.sizset = i;
}
if ( elem.nodeName.toLowerCase() === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var match = false;
elem = elem[dir];
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
match = elem;
break;
}
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
if ( document.documentElement.contains ) {
Sizzle.contains = function( a, b ) {
return a !== b && (a.contains ? a.contains(b) : true);
};
} else if ( document.documentElement.compareDocumentPosition ) {
Sizzle.contains = function( a, b ) {
return !!(a.compareDocumentPosition(b) & 16);
};
} else {
Sizzle.contains = function() {
return false;
};
}
Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
var posProcess = function( selector, context ) {
var match,
tmpSet = [],
later = "",
root = context.nodeType ? [context] : context;
// Position selectors must be done after the filter
// And so must :not(positional) so we move all PSEUDOs to the end
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
later += match[0];
selector = selector.replace( Expr.match.PSEUDO, "" );
}
selector = Expr.relative[selector] ? selector + "*" : selector;
for ( var i = 0, l = root.length; i < l; i++ ) {
Sizzle( selector, root[i], tmpSet );
}
return Sizzle.filter( later, tmpSet );
};
// EXPOSE
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})();
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var self = this,
i, l;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
for ( i = 0, l = self.length; i < l; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
});
}
var ret = this.pushStack( "", "find", selector ),
length, n, r;
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( n = length; n < ret.length; n++ ) {
for ( r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && ( typeof selector === "string" ?
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var ret = [], i, l, cur = this[0];
// Array
if ( jQuery.isArray( selectors ) ) {
var match, selector,
matches = {},
level = 1;
if ( cur && selectors.length ) {
for ( i = 0, l = selectors.length; i < l; i++ ) {
selector = selectors[i];
if ( !matches[ selector ] ) {
matches[ selector ] = POS.test( selector ) ?
jQuery( selector, context || this.context ) :
selector;
}
}
while ( cur && cur.ownerDocument && cur !== context ) {
for ( selector in matches ) {
match = matches[ selector ];
if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
ret.push({ selector: selector, elem: cur, level: level });
}
}
cur = cur.parentNode;
level++;
}
}
return ret;
}
// String
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( i = 0, l = this.length; i < l; i++ ) {
cur = this[i];
while ( cur ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
} else {
cur = cur.parentNode;
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
break;
}
}
}
}
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
return this.pushStack( ret, "closest", selectors );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return jQuery.inArray( this[0], jQuery( elem ) );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
andSelf: function() {
return this.add( this.prevObject );
}
});
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return jQuery.nth( elem, 2, "nextSibling" );
},
prev: function( elem ) {
return jQuery.nth( elem, 2, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.makeArray( elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until ),
// The variable 'args' was introduced in
// https://github.com/jquery/jquery/commit/52a0238
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
// http://code.google.com/p/v8/issues/detail?id=1050
args = slice.call(arguments);
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, args.join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
nth: function( cur, result, dir, elem ) {
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType === 1 && ++num === result ) {
break;
}
}
return cur;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
});
}
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnocache = /<(?:script|object|embed|option|style)/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
};
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE can't serialize <link> and <script> tags normally
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "div<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( text ) {
if ( jQuery.isFunction(text) ) {
return this.each(function(i) {
var self = jQuery( this );
self.text( text.call(this, i, self.text()) );
});
}
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
return jQuery.text( this );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
return this.each(function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
var set = jQuery(arguments[0]);
set.push.apply( set, this.toArray() );
return this.pushStack( set, "before", arguments );
}
},
after: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
var set = this.pushStack( this, "after", arguments );
set.push.apply( set, jQuery(arguments[0]).toArray() );
return set;
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
jQuery.cleanData( [ elem ] );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
// See if we can take a shortcut and just use innerHTML
} else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, "<$1></$2>");
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
// If using innerHTML throws an exception, use the fallback method
} catch(e) {
this.empty().append( value );
}
} else if ( jQuery.isFunction( value ) ) {
this.each(function(i){
var self = jQuery( this );
self.html( value.call(this, i, self.html()) );
});
} else {
this.empty().append( value );
}
return this;
},
replaceWith: function( value ) {
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this), old = self.html();
self.replaceWith( value.call( this, i, old ) );
});
}
if ( typeof value !== "string" ) {
value = jQuery( value ).detach();
}
return this.each(function() {
var next = this.nextSibling,
parent = this.parentNode;
jQuery( this ).remove();
if ( next ) {
jQuery(next).before( value );
} else {
jQuery(parent).append( value );
}
});
} else {
return this.length ?
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
this;
}
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
var results, first, fragment, parent,
value = args[0],
scripts = [];
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
jQuery(this).domManip( args, table, callback, true );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
parent = value && value.parentNode;
// If we're in a fragment, just use that instead of building a new one
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
results = { fragment: parent };
} else {
results = jQuery.buildFragment( args, this, scripts );
}
fragment = results.fragment;
if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
first = fragment.firstChild;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
callback.call(
table ?
root(this[i], first) :
this[i],
// Make sure that we do not leak memory by inadvertently discarding
// the original fragment (which might have attached data) instead of
// using it; in addition, use the original fragment object for the last
// item instead of first because it can end up being emptied incorrectly
// in certain situations (Bug #8070).
// Fragments from the fragment cache must always be cloned and never used
// in place.
results.cacheable || (l > 1 && i < lastIndex) ?
jQuery.clone( fragment, true, true ) :
fragment
);
}
}
if ( scripts.length ) {
jQuery.each( scripts, evalScript );
}
}
return this;
}
});
function root( elem, cur ) {
return jQuery.nodeName(elem, "table") ?
(elem.getElementsByTagName("tbody")[0] ||
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
function cloneCopyEvent( src, dest ) {
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
return;
}
var internalKey = jQuery.expando,
oldData = jQuery.data( src ),
curData = jQuery.data( dest, oldData );
// Switch to use the internal data object, if it exists, for the next
// stage of data copying
if ( (oldData = oldData[ internalKey ]) ) {
var events = oldData.events;
curData = curData[ internalKey ] = jQuery.extend({}, oldData);
if ( events ) {
delete curData.handle;
curData.events = {};
for ( var type in events ) {
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
}
}
}
}
}
function cloneFixAttributes( src, dest ) {
var nodeName;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
// clearAttributes removes the attributes, which we don't want,
// but also removes the attachEvent events, which we *do* want
if ( dest.clearAttributes ) {
dest.clearAttributes();
}
// mergeAttributes, in contrast, only merges back on the
// original attributes, not the events
if ( dest.mergeAttributes ) {
dest.mergeAttributes( src );
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 fail to clone children inside object elements that use
// the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
if ( src.checked ) {
dest.defaultChecked = dest.checked = src.checked;
}
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
if ( dest.value !== src.value ) {
dest.value = src.value;
}
// IE6-8 fails to return the selected option to the default selected
// state when cloning options
} else if ( nodeName === "option" ) {
dest.selected = src.defaultSelected;
// IE6-8 fails to set the defaultValue to the correct value when
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
// Event data gets referenced instead of copied if the expando
// gets copied too
dest.removeAttribute( jQuery.expando );
}
jQuery.buildFragment = function( args, nodes, scripts ) {
var fragment, cacheable, cacheresults, doc;
// nodes may contain either an explicit document object,
// a jQuery collection or context object.
// If nodes[0] contains a valid object to assign to doc
if ( nodes && nodes[0] ) {
doc = nodes[0].ownerDocument || nodes[0];
}
// Ensure that an attr object doesn't incorrectly stand in as a document object
// Chrome and Firefox seem to allow this to occur and will throw exception
// Fixes #8950
if ( !doc.createDocumentFragment ) {
doc = document;
}
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];
if ( cacheresults && cacheresults !== 1 ) {
fragment = cacheresults;
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
}
return { fragment: fragment, cacheable: cacheable };
};
jQuery.fragments = {};
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [],
insert = jQuery( selector ),
parent = this.length === 1 && this[0].parentNode;
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
return this;
} else {
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, name, insert.selector );
}
};
});
function getAll( elem ) {
if ( "getElementsByTagName" in elem ) {
return elem.getElementsByTagName( "*" );
} else if ( "querySelectorAll" in elem ) {
return elem.querySelectorAll( "*" );
} else {
return [];
}
}
// Used in clean, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( elem.type === "checkbox" || elem.type === "radio" ) {
elem.defaultChecked = elem.checked;
}
}
// Finds all inputs and passes them to fixDefaultChecked
function findInputs( elem ) {
if ( jQuery.nodeName( elem, "input" ) ) {
fixDefaultChecked( elem );
} else if ( "getElementsByTagName" in elem ) {
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var clone = elem.cloneNode(true),
srcElements,
destElements,
i;
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// IE copies events bound via attachEvent when using cloneNode.
// Calling detachEvent on the clone will also remove the events
// from the original. In order to get around this, we use some
// proprietary methods to clear the events. Thanks to MooTools
// guys for this hotness.
cloneFixAttributes( elem, clone );
// Using Sizzle here is crazy slow, so we use getElementsByTagName
// instead
srcElements = getAll( elem );
destElements = getAll( clone );
// Weird iteration because IE will replace the length property
// with an element if you are cloning the body and one of the
// elements on the page has a name or id of "length"
for ( i = 0; srcElements[i]; ++i ) {
// Ensure that the destination node is not null; Fixes #9587
if ( destElements[i] ) {
cloneFixAttributes( srcElements[i], destElements[i] );
}
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
cloneCopyEvent( elem, clone );
if ( deepDataAndEvents ) {
srcElements = getAll( elem );
destElements = getAll( clone );
for ( i = 0; srcElements[i]; ++i ) {
cloneCopyEvent( srcElements[i], destElements[i] );
}
}
}
srcElements = destElements = null;
// Return the cloned set
return clone;
},
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
var ret = [], j;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
continue;
}
// Convert html string into DOM nodes
if ( typeof elem === "string" ) {
if ( !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, "<$1></$2>");
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( depth-- ) {
div = div.lastChild;
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
for ( j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
}
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
elem = div.childNodes;
}
}
// Resets defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
var len;
if ( !jQuery.support.appendChecked ) {
if ( elem[0] && typeof (len = elem.length) === "number" ) {
for ( j = 0; j < len; j++ ) {
findInputs( elem[j] );
}
} else {
findInputs( elem );
}
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
ret = jQuery.merge( ret, elem );
}
}
if ( fragment ) {
checkScriptType = function( elem ) {
return !elem.type || rscriptType.test( elem.type );
};
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 ) {
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
}
fragment.appendChild( ret[i] );
}
}
}
return ret;
},
cleanData: function( elems ) {
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
continue;
}
id = elem[ jQuery.expando ];
if ( id ) {
data = cache[ id ] && cache[ id ][ internalKey ];
if ( data && data.events ) {
for ( var type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
if ( data.handle ) {
data.handle.elem = null;
}
}
if ( deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
delete cache[ id ];
}
}
}
});
function evalScript( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
} else {
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
var ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
// fixed for IE9, see #8346
rupper = /([A-Z]|^ms)/g,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
rrelNum = /^([\-+])=([\-+.\de]+)/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssWidth = [ "Left", "Right" ],
cssHeight = [ "Top", "Bottom" ],
curCSS,
getComputedStyle,
currentStyle;
jQuery.fn.css = function( name, value ) {
// Setting 'undefined' is a no-op
if ( arguments.length === 2 && value === undefined ) {
return this;
}
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
});
};
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity", "opacity" );
return ret === "" ? "1" : ret;
} else {
return elem.style.opacity;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, origName = jQuery.camelCase( name ),
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra ) {
var ret, hooks;
// Make sure that we're working with the right name
name = jQuery.camelCase( name );
hooks = jQuery.cssHooks[ name ];
name = jQuery.cssProps[ name ] || name;
// cssFloat needs a special treatment
if ( name === "cssFloat" ) {
name = "float";
}
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
return ret;
// Otherwise, if a way to get the computed value exists, use that
} else if ( curCSS ) {
return curCSS( elem, name );
}
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
var old = {};
// Remember the old values, and insert the new ones
for ( var name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
callback.call( elem );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
}
});
// DEPRECATED, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;
jQuery.each(["height", "width"], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
var val;
if ( computed ) {
if ( elem.offsetWidth !== 0 ) {
return getWH( elem, name, extra );
} else {
jQuery.swap( elem, cssShow, function() {
val = getWH( elem, name, extra );
});
}
return val;
}
},
set: function( elem, value ) {
if ( rnumpx.test( value ) ) {
// ignore negative width and height values #1599
value = parseFloat( value );
if ( value >= 0 ) {
return value + "px";
}
} else {
return value;
}
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
( parseFloat( RegExp.$1 ) / 100 ) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style,
currentStyle = elem.currentStyle,
opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
filter = currentStyle && currentStyle.filter || style.filter || "";
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
// if "filter:" is present at all, clearType is disabled, we want to avoid this
// style.removeAttribute is IE Only, but so apparently is this code path...
style.removeAttribute( "filter" );
// if there there is no filter style applied in a css rule, we are done
if ( currentStyle && !currentStyle.filter ) {
return;
}
}
// otherwise, set new filter values
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
jQuery(function() {
// This hook cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
var ret;
jQuery.swap( elem, { "display": "inline-block" }, function() {
if ( computed ) {
ret = curCSS( elem, "margin-right", "marginRight" );
} else {
ret = elem.style.marginRight;
}
});
return ret;
}
};
}
});
if ( document.defaultView && document.defaultView.getComputedStyle ) {
getComputedStyle = function( elem, name ) {
var ret, defaultView, computedStyle;
name = name.replace( rupper, "-$1" ).toLowerCase();
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
return undefined;
}
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
ret = computedStyle.getPropertyValue( name );
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
ret = jQuery.style( elem, name );
}
}
return ret;
};
}
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
var left,
ret = elem.currentStyle && elem.currentStyle[ name ],
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style;
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
left = style.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
elem.runtimeStyle.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
elem.runtimeStyle.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
curCSS = getComputedStyle || currentStyle;
function getWH( elem, name, extra ) {
// Start with offset property
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
which = name === "width" ? cssWidth : cssHeight;
if ( val > 0 ) {
if ( extra !== "border" ) {
jQuery.each( which, function() {
if ( !extra ) {
val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
} else {
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
}
});
}
return val + "px";
}
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, name );
if ( val < 0 || val == null ) {
val = elem.style[ name ] || 0;
}
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
// Add padding, border, margin
if ( extra ) {
jQuery.each( which, function() {
val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
if ( extra !== "padding" ) {
val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
}
});
}
return val + "px";
}
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth,
height = elem.offsetHeight;
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rhash = /#.*$/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rquery = /\?/,
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
rselectTextarea = /^(?:select|textarea)/i,
rspacesAjax = /\s+/,
rts = /([?&])_=[^&]*/,
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Document location
ajaxLocation,
// Document location segments
ajaxLocParts,
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = ["*/"] + ["*"];
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation = document.createElement( "a" );
ajaxLocation.href = "";
ajaxLocation = ajaxLocation.href;
}
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
if ( jQuery.isFunction( func ) ) {
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
i = 0,
length = dataTypes.length,
dataType,
list,
placeBefore;
// For each dataType in the dataTypeExpression
for(; i < length; i++ ) {
dataType = dataTypes[ i ];
// We control if we're asked to add before
// any existing element
placeBefore = /^\+/.test( dataType );
if ( placeBefore ) {
dataType = dataType.substr( 1 ) || "*";
}
list = structure[ dataType ] = structure[ dataType ] || [];
// then we add to the structure accordingly
list[ placeBefore ? "unshift" : "push" ]( func );
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
dataType /* internal */, inspected /* internal */ ) {
dataType = dataType || options.dataTypes[ 0 ];
inspected = inspected || {};
inspected[ dataType ] = true;
var list = structure[ dataType ],
i = 0,
length = list ? list.length : 0,
executeOnly = ( structure === prefilters ),
selection;
for(; i < length && ( executeOnly || !selection ); i++ ) {
selection = list[ i ]( options, originalOptions, jqXHR );
// If we got redirected to another dataType
// we try there if executing only and not done already
if ( typeof selection === "string" ) {
if ( !executeOnly || inspected[ selection ] ) {
selection = undefined;
} else {
options.dataTypes.unshift( selection );
selection = inspectPrefiltersOrTransports(
structure, options, originalOptions, jqXHR, selection, inspected );
}
}
}
// If we're only executing or nothing was selected
// we try the catchall dataType if not done already
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
selection = inspectPrefiltersOrTransports(
structure, options, originalOptions, jqXHR, "*", inspected );
}
// unnecessary when only executing (prefilters)
// but it'll be ignored by the caller in that case
return selection;
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var key, deep,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
}
jQuery.fn.extend({
load: function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
// Don't do a request if no elements are being requested
} else if ( !this.length ) {
return this;
}
var off = url.indexOf( " " );
if ( off >= 0 ) {
var selector = url.slice( off, url.length );
url = url.slice( 0, off );
}
// Default to a GET request
var type = "GET";
// If the second parameter was provided
if ( params ) {
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( typeof params === "object" ) {
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
type = "POST";
}
}
var self = this;
// Request the remote document
jQuery.ajax({
url: url,
type: type,
dataType: "html",
data: params,
// Complete callback (responseText is used internally)
complete: function( jqXHR, status, responseText ) {
// Store the response as specified by the jqXHR object
responseText = jqXHR.responseText;
// If successful, inject the HTML into all the matched elements
if ( jqXHR.isResolved() ) {
// #4825: Get the actual response in case
// a dataFilter is present in ajaxSettings
jqXHR.done(function( r ) {
responseText = r;
});
// See if a selector was specified
self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div>")
// inject the contents of the document in, removing the scripts
// to avoid any 'Permission Denied' errors in IE
.append(responseText.replace(rscript, ""))
// Locate the specified elements
.find(selector) :
// If not, just inject the full result
responseText );
}
if ( callback ) {
self.each( callback, [ responseText, status, jqXHR ] );
}
}
});
return this;
},
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
return this.elements ? jQuery.makeArray( this.elements ) : this;
})
.filter(function(){
return this.name && !this.disabled &&
( this.checked || rselectTextarea.test( this.nodeName ) ||
rinput.test( this.type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val, i ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
jQuery.fn[ o ] = function( f ){
return this.bind( o, f );
};
});
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
type: method,
url: url,
data: data,
success: callback,
dataType: type
});
};
});
jQuery.extend({
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
if ( settings ) {
// Building a settings object
ajaxExtend( target, jQuery.ajaxSettings );
} else {
// Extending ajaxSettings
settings = target;
target = jQuery.ajaxSettings;
}
ajaxExtend( target, settings );
return target;
},
ajaxSettings: {
url: ajaxLocation,
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
traditional: false,
headers: {},
*/
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": allTypes
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
// List of data converters
// 1) key format is "source_type destination_type" (a single space in-between)
// 2) the catchall symbol "*" can be used for source_type
converters: {
// Convert anything to text
"* text": window.String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": jQuery.parseJSON,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
context: true,
url: true
}
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var // Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events
// It's the callbackContext if one was provided in the options
// and if it's a DOM node or a jQuery collection
globalEventContext = callbackContext !== s &&
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
jQuery( callbackContext ) : jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery._Deferred(),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// ifModified key
ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// Response headers
responseHeadersString,
responseHeaders,
// transport
transport,
// timeout handle
timeoutTimer,
// Cross-domain detection vars
parts,
// The jqXHR state
state = 0,
// To know if global events are to be dispatched
fireGlobals,
// Loop variable
i,
// Fake xhr
jqXHR = {
readyState: 0,
// Caches the header
setRequestHeader: function( name, value ) {
if ( !state ) {
var lname = name.toLowerCase();
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( state === 2 ) {
if ( !responseHeaders ) {
responseHeaders = {};
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match === undefined ? null : match;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Cancel the request
abort: function( statusText ) {
statusText = statusText || "abort";
if ( transport ) {
transport.abort( statusText );
}
done( 0, statusText );
return this;
}
};
// Callback for when everything is done
// It is defined here because jslint complains if it is declared
// at the end of the function (which would be more logical and readable)
function done( status, nativeStatusText, responses, headers ) {
// Called once
if ( state === 2 ) {
return;
}
// State is "done" now
state = 2;
// Clear timeout if it exists
if ( timeoutTimer ) {
clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
var isSuccess,
success,
error,
statusText = nativeStatusText,
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
lastModified,
etag;
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
jQuery.lastModified[ ifModifiedKey ] = lastModified;
}
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
jQuery.etag[ ifModifiedKey ] = etag;
}
}
// If not modified
if ( status === 304 ) {
statusText = "notmodified";
isSuccess = true;
// If we have data
} else {
try {
success = ajaxConvert( s, response );
statusText = "success";
isSuccess = true;
} catch(e) {
// We have a parsererror
statusText = "parsererror";
error = e;
}
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if( !statusText || status ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = "" + ( nativeStatusText || statusText );
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger( "ajaxStop" );
}
}
}
// Attach deferreds
deferred.promise( jqXHR );
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
jqXHR.complete = completeDeferred.done;
// Status-dependent callbacks
jqXHR.statusCode = function( map ) {
if ( map ) {
var tmp;
if ( state < 2 ) {
for( tmp in map ) {
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
}
} else {
tmp = map[ jqXHR.status ];
jqXHR.then( tmp, tmp );
}
}
return this;
};
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// We also use the url parameter if available
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
// Determine if a cross-domain request is in order
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
);
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefiler, stop there
if ( state === 2 ) {
return false;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger( "ajaxStart" );
}
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Get ifModifiedKey before adding the anti-cache parameter
ifModifiedKey = s.url;
// Add anti-cache in url if needed
if ( s.cache === false ) {
var ts = jQuery.now(),
// try replacing _= if it is there
ret = s.url.replace( rts, "$1_=" + ts );
// if nothing was replaced, add timestamp to the end
s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
ifModifiedKey = ifModifiedKey || s.url;
if ( jQuery.lastModified[ ifModifiedKey ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
}
if ( jQuery.etag[ ifModifiedKey ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
}
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
// Abort if not done already
jqXHR.abort();
return false;
}
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout( function(){
jqXHR.abort( "timeout" );
}, s.timeout );
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch (e) {
// Propagate exception as error if not done
if ( state < 2 ) {
done( -1, e );
// Simply rethrow otherwise
} else {
jQuery.error( e );
}
}
}
return jqXHR;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a, traditional ) {
var s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : value;
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( var prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
}
});
function buildParams( prefix, obj, traditional, add ) {
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// If array item is non-scalar (array or object), encode its
// numeric index to resolve deserialization ambiguity issues.
// Note that rack (as of 1.0.0) can't currently deserialize
// nested arrays properly, and attempting to do so may cause
// a server error. Possible fixes are to modify rack's
// deserialization algorithm or to provide an option or flag
// to force array serialization to be shallow.
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && obj != null && typeof obj === "object" ) {
// Serialize object item.
for ( var name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
// This is still on the jQuery object... for now
// Want to move this to jQuery.ajax some day
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields,
ct,
type,
finalDataType,
firstDataType;
// Fill responseXXX fields
for( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
var dataTypes = s.dataTypes,
converters = {},
i,
key,
length = dataTypes.length,
tmp,
// Current and previous dataTypes
current = dataTypes[ 0 ],
prev,
// Conversion expression
conversion,
// Conversion function
conv,
// Conversion functions (transitive conversion)
conv1,
conv2;
// For each dataType in the chain
for( i = 1; i < length; i++ ) {
// Create converters map
// with lowercased keys
if ( i === 1 ) {
for( key in s.converters ) {
if( typeof key === "string" ) {
converters[ key.toLowerCase() ] = s.converters[ key ];
}
}
}
// Get the dataTypes
prev = current;
current = dataTypes[ i ];
// If current is auto dataType, update it to prev
if( current === "*" ) {
current = prev;
// If no auto and dataTypes are actually different
} else if ( prev !== "*" && prev !== current ) {
// Get the converter
conversion = prev + " " + current;
conv = converters[ conversion ] || converters[ "* " + current ];
// If there is no direct converter, search transitively
if ( !conv ) {
conv2 = undefined;
for( conv1 in converters ) {
tmp = conv1.split( " " );
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
conv2 = converters[ tmp[1] + " " + current ];
if ( conv2 ) {
conv1 = converters[ conv1 ];
if ( conv1 === true ) {
conv = conv2;
} else if ( conv2 === true ) {
conv = conv1;
}
break;
}
}
}
}
// If we found no converter, dispatch an error
if ( !( conv || conv2 ) ) {
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
}
// If found converter is not an equivalence
if ( conv !== true ) {
// Convert with 1 or 2 converters accordingly
response = conv ? conv( response ) : conv2( conv1(response) );
}
}
}
return response;
}
var jsc = jQuery.now(),
jsre = /(\=)\?(&|$)|\?\?/i;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
return jQuery.expando + "_" + ( jsc++ );
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
( typeof s.data === "string" );
if ( s.dataTypes[ 0 ] === "jsonp" ||
s.jsonp !== false && ( jsre.test( s.url ) ||
inspectData && jsre.test( s.data ) ) ) {
var responseContainer,
jsonpCallback = s.jsonpCallback =
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
previous = window[ jsonpCallback ],
url = s.url,
data = s.data,
replace = "$1" + jsonpCallback + "$2";
if ( s.jsonp !== false ) {
url = url.replace( jsre, replace );
if ( s.url === url ) {
if ( inspectData ) {
data = data.replace( jsre, replace );
}
if ( s.data === data ) {
// Add callback manually
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
}
}
}
s.url = url;
s.data = data;
// Install callback
window[ jsonpCallback ] = function( response ) {
responseContainer = [ response ];
};
// Clean-up function
jqXHR.always(function() {
// Set callback back to previous value
window[ jsonpCallback ] = previous;
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( previous ) ) {
window[ jsonpCallback ]( responseContainer[ 0 ] );
}
});
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( jsonpCallback + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Delegate to script
return "script";
}
});
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
s.global = false;
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script,
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement( "script" );
script.async = "async";
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( head && script.parentNode ) {
head.removeChild( script );
}
// Dereference the script
script = undefined;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709 and #4378).
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( 0, 1 );
}
}
};
}
});
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject ? function() {
// Abort all pending requests
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( 0, 1 );
}
} : false,
xhrId = 0,
xhrCallbacks;
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
(function( xhr ) {
jQuery.extend( jQuery.support, {
ajax: !!xhr,
cors: !!xhr && ( "withCredentials" in xhr )
});
})( jQuery.ajaxSettings.xhr() );
// Create transport if the browser can provide an xhr
if ( jQuery.support.ajax ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var xhr = s.xhr(),
handle,
i;
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers[ "X-Requested-With" ] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( _ ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status,
statusText,
responseHeaders,
responses,
xml;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occured
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
responses.text = xhr.responseText;
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
}
// Filter status for non standard behaviors
// If the request is local and we have data: assume a success
// (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
// if we're in sync mode or it's in cache
// and has been retrieved directly (IE6 & IE7)
// we need to manually fire the callback
if ( !s.async || xhr.readyState === 4 ) {
callback();
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback(0,1);
}
}
};
}
});
}
var elemdisplay = {},
iframe, iframeDoc,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
timerId,
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
],
fxNow;
jQuery.fn.extend({
show: function( speed, easing, callback ) {
var elem, display;
if ( speed || speed === 0 ) {
return this.animate( genFx("show", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = elem.style.display;
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
display = elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = elem.style.display;
if ( display === "" || display === "none" ) {
elem.style.display = jQuery._data(elem, "olddisplay") || "";
}
}
}
return this;
}
},
hide: function( speed, easing, callback ) {
if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
if ( this[i].style ) {
var display = jQuery.css( this[i], "display" );
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
jQuery._data( this[i], "olddisplay", display );
}
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
if ( this[i].style ) {
this[i].style.display = "none";
}
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2, callback ) {
var bool = typeof fn === "boolean";
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
this._toggle.apply( this, arguments );
} else if ( fn == null || bool ) {
this.each(function() {
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
});
} else {
this.animate(genFx("toggle", 3), fn, fn2, callback);
}
return this;
},
fadeTo: function( speed, to, easing, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
}
// Do not change referenced properties as per-property easing will be lost
prop = jQuery.extend( {}, prop );
return this[ optall.queue === false ? "each" : "queue" ](function() {
// XXX 'this' does not always have a nodeName when running the
// test suite
if ( optall.queue === false ) {
jQuery._mark( this );
}
var opt = jQuery.extend( {}, optall ),
isElement = this.nodeType === 1,
hidden = isElement && jQuery(this).is(":hidden"),
name, val, p,
display, e,
parts, start, end, unit;
// will store per property easing and be used to determine when an animation is complete
opt.animatedProperties = {};
for ( p in prop ) {
// property name normalization
name = jQuery.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
}
val = prop[ name ];
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
if ( jQuery.isArray( val ) ) {
opt.animatedProperties[ name ] = val[ 1 ];
val = prop[ name ] = val[ 0 ];
} else {
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
}
if ( val === "hide" && hidden || val === "show" && !hidden ) {
return opt.complete.call( this );
}
if ( isElement && ( name === "height" || name === "width" ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height
// animated
if ( jQuery.css( this, "display" ) === "inline" &&
jQuery.css( this, "float" ) === "none" ) {
if ( !jQuery.support.inlineBlockNeedsLayout ) {
this.style.display = "inline-block";
} else {
display = defaultDisplay( this.nodeName );
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( display === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.display = "inline";
this.style.zoom = 1;
}
}
}
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
for ( p in prop ) {
e = new jQuery.fx( this, opt, p );
val = prop[ p ];
if ( rfxtypes.test(val) ) {
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
} else {
parts = rfxnum.exec( val );
start = e.cur();
if ( parts ) {
end = parseFloat( parts[2] );
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" ) {
jQuery.style( this, p, (end || 1) + unit);
start = ((end || 1) / e.cur()) * start;
jQuery.style( this, p, start + unit);
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
}
// For JS strict compliance
return true;
});
},
stop: function( clearQueue, gotoEnd ) {
if ( clearQueue ) {
this.queue([]);
}
this.each(function() {
var timers = jQuery.timers,
i = timers.length;
// clear marker counters if we know they won't be
if ( !gotoEnd ) {
jQuery._unmark( true, this );
}
while ( i-- ) {
if ( timers[i].elem === this ) {
if (gotoEnd) {
// force the next step to be the last
timers[i](true);
}
timers.splice(i, 1);
}
}
});
// start the next in the queue if the last step wasn't forced
if ( !gotoEnd ) {
this.dequeue();
}
return this;
}
});
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout( clearFxNow, 0 );
return ( fxNow = jQuery.now() );
}
function clearFxNow() {
fxNow = undefined;
}
// Generate parameters to create a standard animation
function genFx( type, num ) {
var obj = {};
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
obj[ this ] = type;
});
return obj;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show", 1),
slideUp: genFx("hide", 1),
slideToggle: genFx("toggle", 1),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.extend({
speed: function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
// Queueing
opt.old = opt.complete;
opt.complete = function( noUnmark ) {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue !== false ) {
jQuery.dequeue( this );
} else if ( noUnmark !== false ) {
jQuery._unmark( this );
}
};
return opt;
},
easing: {
linear: function( p, n, firstNum, diff ) {
return firstNum + diff * p;
},
swing: function( p, n, firstNum, diff ) {
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
}
},
timers: [],
fx: function( elem, options, prop ) {
this.options = options;
this.elem = elem;
this.prop = prop;
options.orig = options.orig || {};
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function() {
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
},
// Get the current size
cur: function() {
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}
var parsed,
r = jQuery.css( this.elem, this.prop );
// Empty strings, null, undefined and "auto" are converted to 0,
// complex values such as "rotate(1rad)" are returned as is,
// simple values such as "10px" are parsed to Float.
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
},
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx;
this.startTime = fxNow || createFxNow();
this.start = from;
this.end = to;
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
this.now = this.start;
this.pos = this.state = 0;
function t( gotoEnd ) {
return self.step(gotoEnd);
}
t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) {
timerId = setInterval( fx.tick, fx.interval );
}
},
// Simple 'show' function
show: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
// Start by showing the element
jQuery( this.elem ).show();
},
// Simple 'hide' function
hide: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function( gotoEnd ) {
var t = fxNow || createFxNow(),
done = true,
elem = this.elem,
options = this.options,
i, n;
if ( gotoEnd || t >= options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
options.animatedProperties[ this.prop ] = true;
for ( i in options.animatedProperties ) {
if ( options.animatedProperties[i] !== true ) {
done = false;
}
}
if ( done ) {
// Reset the overflow
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
jQuery.each( [ "", "X", "Y" ], function (index, value) {
elem.style[ "overflow" + value ] = options.overflow[index];
});
}
// Hide the element if the "hide" operation was done
if ( options.hide ) {
jQuery(elem).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( options.hide || options.show ) {
for ( var p in options.animatedProperties ) {
jQuery.style( elem, p, options.orig[p] );
}
}
// Execute the complete function
options.complete.call( elem );
}
return false;
} else {
// classical easing cannot be used with an Infinity duration
if ( options.duration == Infinity ) {
this.now = t;
} else {
n = t - this.startTime;
this.state = n / options.duration;
// Perform the easing function, defaults to swing
this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
this.now = this.start + ((this.end - this.start) * this.pos);
}
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
tick: function() {
for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
if ( !timers[i]() ) {
timers.splice(i--, 1);
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
},
interval: 13,
stop: function() {
clearInterval( timerId );
timerId = null;
},
speeds: {
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function( fx ) {
jQuery.style( fx.elem, "opacity", fx.now );
},
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
// Try to restore the default display value of an element
function defaultDisplay( nodeName ) {
if ( !elemdisplay[ nodeName ] ) {
var body = document.body,
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
display = elem.css( "display" );
elem.remove();
// If the simple way fails,
// get element's real default display by attaching it to a temp iframe
if ( display === "none" || display === "" ) {
// No iframe to use yet, so create it
if ( !iframe ) {
iframe = document.createElement( "iframe" );
iframe.frameBorder = iframe.width = iframe.height = 0;
}
body.appendChild( iframe );
// Create a cacheable copy of the iframe document on first call.
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
// document to it; WebKit & Firefox won't allow reusing the iframe document.
if ( !iframeDoc || !iframe.createElement ) {
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
iframeDoc.close();
}
elem = iframeDoc.createElement( nodeName );
iframeDoc.body.appendChild( elem );
display = jQuery.css( elem, "display" );
body.removeChild( iframe );
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return elemdisplay[ nodeName ];
}
var rtable = /^t(?:able|d|h)$/i,
rroot = /^(?:body|html)$/i;
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
try {
box = elem.getBoundingClientRect();
} catch(e) {}
var doc = elem.ownerDocument,
docElem = doc.documentElement;
// Make sure we're not dealing with a disconnected DOM node
if ( !box || !jQuery.contains( docElem, elem ) ) {
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
}
var body = doc.body,
win = getWindow(doc),
clientTop = docElem.clientTop || body.clientTop || 0,
clientLeft = docElem.clientLeft || body.clientLeft || 0,
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
top = box.top + scrollTop - clientTop,
left = box.left + scrollLeft - clientLeft;
return { top: top, left: left };
};
} else {
jQuery.fn.offset = function( options ) {
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
jQuery.offset.initialize();
var computedStyle,
offsetParent = elem.offsetParent,
prevOffsetParent = elem,
doc = elem.ownerDocument,
docElem = doc.documentElement,
body = doc.body,
defaultView = doc.defaultView,
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
top = elem.offsetTop,
left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
break;
}
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
top -= elem.scrollTop;
left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop;
left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent;
offsetParent = elem.offsetParent;
}
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevComputedStyle = computedStyle;
}
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
top += body.offsetTop;
left += body.offsetLeft;
}
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.offset = {
initialize: function() {
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
container.innerHTML = html;
body.insertBefore( container, body.firstChild );
innerDiv = container.firstChild;
checkDiv = innerDiv.firstChild;
td = innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
checkDiv.style.position = "fixed";
checkDiv.style.top = "20px";
// safari subtracts parent border width here which is 5px
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
checkDiv.style.position = checkDiv.style.top = "";
innerDiv.style.overflow = "hidden";
innerDiv.style.position = "relative";
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
body.removeChild( container );
jQuery.offset.initialize = jQuery.noop;
},
bodyOffset: function( body ) {
var top = body.offsetTop,
left = body.offsetLeft;
jQuery.offset.initialize();
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
}
return { top: top, left: left };
},
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if (options.top != null) {
props.top = (options.top - curOffset.top) + curTop;
}
if (options.left != null) {
props.left = (options.left - curOffset.left) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[0] ) {
return null;
}
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
// Add offsetParent borders
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name;
jQuery.fn[ method ] = function( val ) {
var elem, win;
if ( val === undefined ) {
elem = this[ 0 ];
if ( !elem ) {
return null;
}
win = getWindow( elem );
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
win.document.body[ method ] :
elem[ method ];
}
// Set the scroll offset
return this.each(function() {
win = getWindow( this );
if ( win ) {
win.scrollTo(
!i ? val : jQuery( win ).scrollLeft(),
i ? val : jQuery( win ).scrollTop()
);
} else {
this[ method ] = val;
}
});
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function( i, name ) {
var type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn[ "inner" + name ] = function() {
var elem = this[0];
return elem && elem.style ?
parseFloat( jQuery.css( elem, type, "padding" ) ) :
null;
};
// outerHeight and outerWidth
jQuery.fn[ "outer" + name ] = function( margin ) {
var elem = this[0];
return elem && elem.style ?
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
null;
};
jQuery.fn[ type ] = function( size ) {
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
var docElemProp = elem.document.documentElement[ "client" + name ],
body = elem.document.body;
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
body && body[ "client" + name ] || docElemProp;
// Get document width or height
} else if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
return Math.max(
elem.documentElement["client" + name],
elem.body["scroll" + name], elem.documentElement["scroll" + name],
elem.body["offset" + name], elem.documentElement["offset" + name]
);
// Get or set width or height on the element
} else if ( size === undefined ) {
var orig = jQuery.css( elem, type ),
ret = parseFloat( orig );
return jQuery.isNaN( ret ) ? orig : ret;
// Set the width or height on the element (default to pixels if value is unitless)
} else {
return this.css( type, typeof size === "string" ? size : size + "px" );
}
};
});
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
})(window);
// Underscore.js 1.1.7
// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {};
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var slice = ArrayProto.slice,
unshift = ArrayProto.unshift,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeForEach = ArrayProto.forEach,
nativeMap = ArrayProto.map,
nativeReduce = ArrayProto.reduce,
nativeReduceRight = ArrayProto.reduceRight,
nativeFilter = ArrayProto.filter,
nativeEvery = ArrayProto.every,
nativeSome = ArrayProto.some,
nativeIndexOf = ArrayProto.indexOf,
nativeLastIndexOf = ArrayProto.lastIndexOf,
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); };
// Export the Underscore object for **CommonJS**, with backwards-compatibility
// for the old `require()` API. If we're not in CommonJS, add `_` to the
// global object.
if (typeof module !== 'undefined' && module.exports) {
module.exports = _;
_._ = _;
} else {
// Exported as a string, for Closure Compiler "advanced" mode.
root['_'] = _;
}
// Current version.
_.VERSION = '1.1.7';
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var each = _.each = _.forEach = function(obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, l = obj.length; i < l; i++) {
if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
}
} else {
for (var key in obj) {
if (hasOwnProperty.call(obj, key)) {
if (iterator.call(context, obj[key], key, obj) === breaker) return;
}
}
}
};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
_.map = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) {
results[results.length] = iterator.call(context, value, index, list);
});
return results;
};
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
var initial = memo !== void 0;
if (obj == null) obj = [];
if (nativeReduce && obj.reduce === nativeReduce) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial) {
memo = value;
initial = true;
} else {
memo = iterator.call(context, memo, value, index, list);
}
});
if (!initial) throw new TypeError("Reduce of empty array with no initial value");
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
if (obj == null) obj = [];
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
return _.reduce(reversed, iterator, memo, context);
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, iterator, context) {
var result;
any(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
_.filter = _.select = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
each(obj, function(value, index, list) {
if (!iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
});
return result;
};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
iterator = iterator || _.identity;
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
each(obj, function(value, index, list) {
if (result |= iterator.call(context, value, index, list)) return breaker;
});
return !!result;
};
// Determine if a given value is included in the array or object using `===`.
// Aliased as `contains`.
_.include = _.contains = function(obj, target) {
var found = false;
if (obj == null) return found;
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
any(obj, function(value) {
if (found = value === target) return true;
});
return found;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
return _.map(obj, function(value) {
return (method.call ? method || value : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, function(value){ return value[key]; });
};
// Return the maximum element or (element-based computation).
_.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
var result = {computed : -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
var result = {computed : Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed < result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Sort the object's values by a criterion produced by an iterator.
_.sortBy = function(obj, iterator, context) {
return _.pluck(_.map(obj, function(value, index, list) {
return {
value : value,
criteria : iterator.call(context, value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria, b = right.criteria;
return a < b ? -1 : a > b ? 1 : 0;
}), 'value');
};
// Groups the object's values by a criterion produced by an iterator
_.groupBy = function(obj, iterator) {
var result = {};
each(obj, function(value, index) {
var key = iterator(value, index);
(result[key] || (result[key] = [])).push(value);
});
return result;
};
// Use a comparator function to figure out at what index an object should
// be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator) {
iterator || (iterator = _.identity);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >> 1;
iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
}
return low;
};
// Safely convert anything iterable into a real, live array.
_.toArray = function(iterable) {
if (!iterable) return [];
if (iterable.toArray) return iterable.toArray();
if (_.isArray(iterable)) return slice.call(iterable);
if (_.isArguments(iterable)) return slice.call(iterable);
return _.values(iterable);
};
// Return the number of elements in an object.
_.size = function(obj) {
return _.toArray(obj).length;
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head`. The **guard** check allows it to work
// with `_.map`.
_.first = _.head = function(array, n, guard) {
return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
};
// Returns everything but the first entry of the array. Aliased as `tail`.
// Especially useful on the arguments object. Passing an **index** will return
// the rest of the values in the array from that index onward. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = function(array, index, guard) {
return slice.call(array, (index == null) || guard ? 1 : index);
};
// Get the last element of an array.
_.last = function(array) {
return array[array.length - 1];
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, function(value){ return !!value; });
};
// Return a completely flattened version of an array.
_.flatten = function(array) {
return _.reduce(array, function(memo, value) {
if (_.isArray(value)) return memo.concat(_.flatten(value));
memo[memo.length] = value;
return memo;
}, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted) {
return _.reduce(array, function(memo, el, i) {
if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo[memo.length] = el;
return memo;
}, []);
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(_.flatten(arguments));
};
// Produce an array that contains every item shared between all the
// passed-in arrays. (Aliased as "intersect" for back-compat.)
_.intersection = _.intersect = function(array) {
var rest = slice.call(arguments, 1);
return _.filter(_.uniq(array), function(item) {
return _.every(rest, function(other) {
return _.indexOf(other, item) >= 0;
});
});
};
// Take the difference between one array and another.
// Only the elements present in just the first array will remain.
_.difference = function(array, other) {
return _.filter(array, function(value){ return !_.include(other, value); });
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var args = slice.call(arguments);
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
return results;
};
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i, l;
if (isSorted) {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
for (i = 0, l = array.length; i < l; i++) if (array[i] === item) return i;
return -1;
};
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item) {
if (array == null) return -1;
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
var i = array.length;
while (i--) if (array[i] === item) return i;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = arguments[2] || 1;
var len = Math.max(Math.ceil((stop - start) / step), 0);
var idx = 0;
var range = new Array(len);
while(idx < len) {
range[idx++] = start;
start += step;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Binding with arguments is also known as `curry`.
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
// We check for `func.bind` first, to fail fast when `func` is undefined.
_.bind = function(func, obj) {
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
var args = slice.call(arguments, 2);
return function() {
return func.apply(obj, args.concat(slice.call(arguments)));
};
};
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
_.bindAll = function(obj) {
var funcs = slice.call(arguments, 1);
if (funcs.length == 0) funcs = _.functions(obj);
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
};
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(func, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Internal function used to implement `_.throttle` and `_.debounce`.
var limit = function(func, wait, debounce) {
var timeout;
return function() {
var context = this, args = arguments;
var throttler = function() {
timeout = null;
func.apply(context, args);
};
if (debounce) clearTimeout(timeout);
if (debounce || !timeout) timeout = setTimeout(throttler, wait);
};
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
_.throttle = function(func, wait) {
return limit(func, wait, false);
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds.
_.debounce = function(func, wait) {
return limit(func, wait, true);
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = function(func) {
var ran = false, memo;
return function() {
if (ran) return memo;
ran = true;
return memo = func.apply(this, arguments);
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return function() {
var args = [func].concat(slice.call(arguments));
return wrapper.apply(this, args);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var funcs = slice.call(arguments);
return function() {
var args = slice.call(arguments);
for (var i = funcs.length - 1; i >= 0; i--) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
return function() {
if (--times < 1) { return func.apply(this, arguments); }
};
};
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = [];
for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
return _.map(obj, _.identity);
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
if (source[prop] !== void 0) obj[prop] = source[prop];
}
});
return obj;
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
if (obj[prop] == null) obj[prop] = source[prop];
}
});
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
// Check object identity.
if (a === b) return true;
// Different types?
var atype = typeof(a), btype = typeof(b);
if (atype != btype) return false;
// Basic equality test (watch out for coercions).
if (a == b) return true;
// One is falsy and the other truthy.
if ((!a && b) || (a && !b)) return false;
// Unwrap any wrapped objects.
if (a._chain) a = a._wrapped;
if (b._chain) b = b._wrapped;
// One of them implements an isEqual()?
if (a.isEqual) return a.isEqual(b);
if (b.isEqual) return b.isEqual(a);
// Check dates' integer values.
if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime();
// Both are NaN?
if (_.isNaN(a) && _.isNaN(b)) return false;
// Compare regular expressions.
if (_.isRegExp(a) && _.isRegExp(b))
return a.source === b.source &&
a.global === b.global &&
a.ignoreCase === b.ignoreCase &&
a.multiline === b.multiline;
// If a is not an object by this point, we can't handle it.
if (atype !== 'object') return false;
// Check for different array lengths before comparing contents.
if (a.length && (a.length !== b.length)) return false;
// Nothing else worked, deep compare the contents.
var aKeys = _.keys(a), bKeys = _.keys(b);
// Different object sizes?
if (aKeys.length != bKeys.length) return false;
// Recursive comparison of contents.
for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false;
return true;
};
// Is a given array or object empty?
_.isEmpty = function(obj) {
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
for (var key in obj) if (hasOwnProperty.call(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType == 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) === '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
return obj === Object(obj);
};
// Is a given variable an arguments object?
_.isArguments = function(obj) {
return !!(obj && hasOwnProperty.call(obj, 'callee'));
};
// Is a given value a function?
_.isFunction = function(obj) {
return !!(obj && obj.constructor && obj.call && obj.apply);
};
// Is a given value a string?
_.isString = function(obj) {
return !!(obj === '' || (obj && obj.charCodeAt && obj.substr));
};
// Is a given value a number?
_.isNumber = function(obj) {
return !!(obj === 0 || (obj && obj.toExponential && obj.toFixed));
};
// Is the given value `NaN`? `NaN` happens to be the only value in JavaScript
// that does not equal itself.
_.isNaN = function(obj) {
return obj !== obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false;
};
// Is a given value a date?
_.isDate = function(obj) {
return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear);
};
// Is the given value a regular expression?
_.isRegExp = function(obj) {
return !!(obj && obj.test && obj.exec && (obj.ignoreCase || obj.ignoreCase === false));
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iterators.
_.identity = function(value) {
return value;
};
// Run a function **n** times.
_.times = function (n, iterator, context) {
for (var i = 0; i < n; i++) iterator.call(context, i);
};
// Add your own custom functions to the Underscore object, ensuring that
// they're correctly added to the OOP wrapper as well.
_.mixin = function(obj) {
each(_.functions(obj), function(name){
addToWrapper(name, _[name] = obj[name]);
});
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = idCounter++;
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(str, data) {
var c = _.templateSettings;
var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
'with(obj||{}){__p.push(\'' +
str.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(c.interpolate, function(match, code) {
return "'," + code.replace(/\\'/g, "'") + ",'";
})
.replace(c.evaluate || null, function(match, code) {
return "');" + code.replace(/\\'/g, "'")
.replace(/[\r\n\t]/g, ' ') + "__p.push('";
})
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
+ "');}return __p.join('');";
var func = new Function('obj', tmpl);
return data ? func(data) : func;
};
// The OOP Wrapper
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
var wrapper = function(obj) { this._wrapped = obj; };
// Expose `wrapper.prototype` as `_.prototype`
_.prototype = wrapper.prototype;
// Helper function to continue chaining intermediate results.
var result = function(obj, chain) {
return chain ? _(obj).chain() : obj;
};
// A method to easily add functions to the OOP wrapper.
var addToWrapper = function(name, func) {
wrapper.prototype[name] = function() {
var args = slice.call(arguments);
unshift.call(args, this._wrapped);
return result(func.apply(_, args), this._chain);
};
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
method.apply(this._wrapped, arguments);
return result(this._wrapped, this._chain);
};
});
// Add all accessor Array functions to the wrapper.
each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
return result(method.apply(this._wrapped, arguments), this._chain);
};
});
// Start chaining a wrapped Underscore object.
wrapper.prototype.chain = function() {
this._chain = true;
return this;
};
// Extracts the result from a wrapped and chained object.
wrapper.prototype.value = function() {
return this._wrapped;
};
})();
// Backbone.js 0.5.3
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://documentcloud.github.com/backbone
(function(){
// Initial Setup
// -------------
// Save a reference to the global object.
var root = this;
// Save the previous value of the `Backbone` variable.
var previousBackbone = root.Backbone;
// The top-level namespace. All public Backbone classes and modules will
// be attached to this. Exported for both CommonJS and the browser.
var Backbone;
if (typeof exports !== 'undefined') {
Backbone = exports;
} else {
Backbone = root.Backbone = {};
}
// Current version of the library. Keep in sync with `package.json`.
Backbone.VERSION = '0.5.3';
// Require Underscore, if we're on the server, and it's not already present.
var _ = root._;
if (!_ && (typeof require !== 'undefined')) _ = require('underscore')._;
// For Backbone's purposes, jQuery or Zepto owns the `$` variable.
var $ = root.jQuery || root.Zepto;
// Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
// to its previous owner. Returns a reference to this Backbone object.
Backbone.noConflict = function() {
root.Backbone = previousBackbone;
return this;
};
// Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option will
// fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and set a
// `X-Http-Method-Override` header.
Backbone.emulateHTTP = false;
// Turn on `emulateJSON` to support legacy servers that can't deal with direct
// `application/json` requests ... will encode the body as
// `application/x-www-form-urlencoded` instead and will send the model in a
// form param named `model`.
Backbone.emulateJSON = false;
// Backbone.Events
// -----------------
// A module that can be mixed in to *any object* in order to provide it with
// custom events. You may `bind` or `unbind` a callback function to an event;
// `trigger`-ing an event fires all callbacks in succession.
//
// var object = {};
// _.extend(object, Backbone.Events);
// object.bind('expand', function(){ alert('expanded'); });
// object.trigger('expand');
//
Backbone.Events = {
// Bind an event, specified by a string name, `ev`, to a `callback` function.
// Passing `"all"` will bind the callback to all events fired.
bind : function(ev, callback, context) {
var calls = this._callbacks || (this._callbacks = {});
var list = calls[ev] || (calls[ev] = []);
list.push([callback, context]);
return this;
},
// Remove one or many callbacks. If `callback` is null, removes all
// callbacks for the event. If `ev` is null, removes all bound callbacks
// for all events.
unbind : function(ev, callback) {
var calls;
if (!ev) {
this._callbacks = {};
} else if (calls = this._callbacks) {
if (!callback) {
calls[ev] = [];
} else {
var list = calls[ev];
if (!list) return this;
for (var i = 0, l = list.length; i < l; i++) {
if (list[i] && callback === list[i][0]) {
list[i] = null;
break;
}
}
}
}
return this;
},
// Trigger an event, firing all bound callbacks. Callbacks are passed the
// same arguments as `trigger` is, apart from the event name.
// Listening for `"all"` passes the true event name as the first argument.
trigger : function(eventName) {
var list, calls, ev, callback, args;
var both = 2;
if (!(calls = this._callbacks)) return this;
while (both--) {
ev = both ? eventName : 'all';
if (list = calls[ev]) {
for (var i = 0, l = list.length; i < l; i++) {
if (!(callback = list[i])) {
list.splice(i, 1); i--; l--;
} else {
args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
callback[0].apply(callback[1] || this, args);
}
}
}
}
return this;
}
};
// Backbone.Model
// --------------
// Create a new model, with defined attributes. A client id (`cid`)
// is automatically generated and assigned for you.
Backbone.Model = function(attributes, options) {
var defaults;
attributes || (attributes = {});
if (defaults = this.defaults) {
if (_.isFunction(defaults)) defaults = defaults.call(this);
attributes = _.extend({}, defaults, attributes);
}
this.attributes = {};
this._escapedAttributes = {};
this.cid = _.uniqueId('c');
this.set(attributes, {silent : true});
this._changed = false;
this._previousAttributes = _.clone(this.attributes);
if (options && options.collection) this.collection = options.collection;
this.initialize(attributes, options);
};
// Attach all inheritable methods to the Model prototype.
_.extend(Backbone.Model.prototype, Backbone.Events, {
// A snapshot of the model's previous attributes, taken immediately
// after the last `"change"` event was fired.
_previousAttributes : null,
// Has the item been changed since the last `"change"` event?
_changed : false,
// The default name for the JSON `id` attribute is `"id"`. MongoDB and
// CouchDB users may want to set this to `"_id"`.
idAttribute : 'id',
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize : function(){},
// Return a copy of the model's `attributes` object.
toJSON : function() {
return _.clone(this.attributes);
},
// Get the value of an attribute.
get : function(attr) {
return this.attributes[attr];
},
// Get the HTML-escaped value of an attribute.
escape : function(attr) {
var html;
if (html = this._escapedAttributes[attr]) return html;
var val = this.attributes[attr];
return this._escapedAttributes[attr] = escapeHTML(val == null ? '' : '' + val);
},
// Returns `true` if the attribute contains a value that is not null
// or undefined.
has : function(attr) {
return this.attributes[attr] != null;
},
// Set a hash of model attributes on the object, firing `"change"` unless you
// choose to silence it.
set : function(attrs, options) {
// Extract attributes and options.
options || (options = {});
if (!attrs) return this;
if (attrs.attributes) attrs = attrs.attributes;
var now = this.attributes, escaped = this._escapedAttributes;
// Run validation.
if (!options.silent && this.validate && !this._performValidation(attrs, options)) return false;
// Check for changes of `id`.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
// We're about to start triggering change events.
var alreadyChanging = this._changing;
this._changing = true;
// Update attributes.
for (var attr in attrs) {
var val = attrs[attr];
if (!_.isEqual(now[attr], val)) {
now[attr] = val;
delete escaped[attr];
this._changed = true;
if (!options.silent) this.trigger('change:' + attr, this, val, options);
}
}
// Fire the `"change"` event, if the model has been changed.
if (!alreadyChanging && !options.silent && this._changed) this.change(options);
this._changing = false;
return this;
},
// Remove an attribute from the model, firing `"change"` unless you choose
// to silence it. `unset` is a noop if the attribute doesn't exist.
unset : function(attr, options) {
if (!(attr in this.attributes)) return this;
options || (options = {});
var value = this.attributes[attr];
// Run validation.
var validObj = {};
validObj[attr] = void 0;
if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;
// Remove the attribute.
delete this.attributes[attr];
delete this._escapedAttributes[attr];
if (attr == this.idAttribute) delete this.id;
this._changed = true;
if (!options.silent) {
this.trigger('change:' + attr, this, void 0, options);
this.change(options);
}
return this;
},
// Clear all attributes on the model, firing `"change"` unless you choose
// to silence it.
clear : function(options) {
options || (options = {});
var attr;
var old = this.attributes;
// Run validation.
var validObj = {};
for (attr in old) validObj[attr] = void 0;
if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;
this.attributes = {};
this._escapedAttributes = {};
this._changed = true;
if (!options.silent) {
for (attr in old) {
this.trigger('change:' + attr, this, void 0, options);
}
this.change(options);
}
return this;
},
// Fetch the model from the server. If the server's representation of the
// model differs from its current attributes, they will be overriden,
// triggering a `"change"` event.
fetch : function(options) {
options || (options = {});
var model = this;
var success = options.success;
options.success = function(resp, status, xhr) {
if (!model.set(model.parse(resp, xhr), options)) return false;
if (success) success(model, resp);
};
options.error = wrapError(options.error, model, options);
return (this.sync || Backbone.sync).call(this, 'read', this, options);
},
// Set a hash of model attributes, and sync the model to the server.
// If the server returns an attributes hash that differs, the model's
// state will be `set` again.
save : function(attrs, options) {
options || (options = {});
if (attrs && !this.set(attrs, options)) return false;
var model = this;
var success = options.success;
options.success = function(resp, status, xhr) {
if (!model.set(model.parse(resp, xhr), options)) return false;
if (success) success(model, resp, xhr);
};
options.error = wrapError(options.error, model, options);
var method = this.isNew() ? 'create' : 'update';
return (this.sync || Backbone.sync).call(this, method, this, options);
},
// Destroy this model on the server if it was already persisted. Upon success, the model is removed
// from its collection, if it has one.
destroy : function(options) {
options || (options = {});
if (this.isNew()) return this.trigger('destroy', this, this.collection, options);
var model = this;
var success = options.success;
options.success = function(resp) {
model.trigger('destroy', model, model.collection, options);
if (success) success(model, resp);
};
options.error = wrapError(options.error, model, options);
return (this.sync || Backbone.sync).call(this, 'delete', this, options);
},
// Default URL for the model's representation on the server -- if you're
// using Backbone's restful methods, override this to change the endpoint
// that will be called.
url : function() {
var base = getUrl(this.collection) || this.urlRoot || urlError();
if (this.isNew()) return base;
return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id);
},
// **parse** converts a response into the hash of attributes to be `set` on
// the model. The default implementation is just to pass the response along.
parse : function(resp, xhr) {
return resp;
},
// Create a new model with identical attributes to this one.
clone : function() {
return new this.constructor(this);
},
// A model is new if it has never been saved to the server, and lacks an id.
isNew : function() {
return this.id == null;
},
// Call this method to manually fire a `change` event for this model.
// Calling this will cause all objects observing the model to update.
change : function(options) {
this.trigger('change', this, options);
this._previousAttributes = _.clone(this.attributes);
this._changed = false;
},
// Determine if the model has changed since the last `"change"` event.
// If you specify an attribute name, determine if that attribute has changed.
hasChanged : function(attr) {
if (attr) return this._previousAttributes[attr] != this.attributes[attr];
return this._changed;
},
// Return an object containing all the attributes that have changed, or false
// if there are no changed attributes. Useful for determining what parts of a
// view need to be updated and/or what attributes need to be persisted to
// the server.
changedAttributes : function(now) {
now || (now = this.attributes);
var old = this._previousAttributes;
var changed = false;
for (var attr in now) {
if (!_.isEqual(old[attr], now[attr])) {
changed = changed || {};
changed[attr] = now[attr];
}
}
return changed;
},
// Get the previous value of an attribute, recorded at the time the last
// `"change"` event was fired.
previous : function(attr) {
if (!attr || !this._previousAttributes) return null;
return this._previousAttributes[attr];
},
// Get all of the attributes of the model at the time of the previous
// `"change"` event.
previousAttributes : function() {
return _.clone(this._previousAttributes);
},
// Run validation against a set of incoming attributes, returning `true`
// if all is well. If a specific `error` callback has been passed,
// call that instead of firing the general `"error"` event.
_performValidation : function(attrs, options) {
var error = this.validate(attrs);
if (error) {
if (options.error) {
options.error(this, error, options);
} else {
this.trigger('error', this, error, options);
}
return false;
}
return true;
}
});
// Backbone.Collection
// -------------------
// Provides a standard collection class for our sets of models, ordered
// or unordered. If a `comparator` is specified, the Collection will maintain
// its models in sort order, as they're added and removed.
Backbone.Collection = function(models, options) {
options || (options = {});
if (options.comparator) this.comparator = options.comparator;
_.bindAll(this, '_onModelEvent', '_removeReference');
this._reset();
if (models) this.reset(models, {silent: true});
this.initialize.apply(this, arguments);
};
// Define the Collection's inheritable methods.
_.extend(Backbone.Collection.prototype, Backbone.Events, {
// The default model for a collection is just a **Backbone.Model**.
// This should be overridden in most cases.
model : Backbone.Model,
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize : function(){},
// The JSON representation of a Collection is an array of the
// models' attributes.
toJSON : function() {
return this.map(function(model){ return model.toJSON(); });
},
// Add a model, or list of models to the set. Pass **silent** to avoid
// firing the `added` event for every new model.
add : function(models, options) {
if (_.isArray(models)) {
for (var i = 0, l = models.length; i < l; i++) {
this._add(models[i], options);
}
} else {
this._add(models, options);
}
return this;
},
// Remove a model, or a list of models from the set. Pass silent to avoid
// firing the `removed` event for every model removed.
remove : function(models, options) {
if (_.isArray(models)) {
for (var i = 0, l = models.length; i < l; i++) {
this._remove(models[i], options);
}
} else {
this._remove(models, options);
}
return this;
},
// Get a model from the set by id.
get : function(id) {
if (id == null) return null;
return this._byId[id.id != null ? id.id : id];
},
// Get a model from the set by client id.
getByCid : function(cid) {
return cid && this._byCid[cid.cid || cid];
},
// Get the model at the given index.
at: function(index) {
return this.models[index];
},
// Force the collection to re-sort itself. You don't need to call this under normal
// circumstances, as the set will maintain sort order as each item is added.
sort : function(options) {
options || (options = {});
if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
this.models = this.sortBy(this.comparator);
if (!options.silent) this.trigger('reset', this, options);
return this;
},
// Pluck an attribute from each model in the collection.
pluck : function(attr) {
return _.map(this.models, function(model){ return model.get(attr); });
},
// When you have more items than you want to add or remove individually,
// you can reset the entire set with a new list of models, without firing
// any `added` or `removed` events. Fires `reset` when finished.
reset : function(models, options) {
models || (models = []);
options || (options = {});
this.each(this._removeReference);
this._reset();
this.add(models, {silent: true});
if (!options.silent) this.trigger('reset', this, options);
return this;
},
// Fetch the default set of models for this collection, resetting the
// collection when they arrive. If `add: true` is passed, appends the
// models to the collection instead of resetting.
fetch : function(options) {
options || (options = {});
var collection = this;
var success = options.success;
options.success = function(resp, status, xhr) {
collection[options.add ? 'add' : 'reset'](collection.parse(resp, xhr), options);
if (success) success(collection, resp);
};
options.error = wrapError(options.error, collection, options);
return (this.sync || Backbone.sync).call(this, 'read', this, options);
},
// Create a new instance of a model in this collection. After the model
// has been created on the server, it will be added to the collection.
// Returns the model, or 'false' if validation on a new model fails.
create : function(model, options) {
var coll = this;
options || (options = {});
model = this._prepareModel(model, options);
if (!model) return false;
var success = options.success;
options.success = function(nextModel, resp, xhr) {
coll.add(nextModel, options);
if (success) success(nextModel, resp, xhr);
};
model.save(null, options);
return model;
},
// **parse** converts a response into a list of models to be added to the
// collection. The default implementation is just to pass it through.
parse : function(resp, xhr) {
return resp;
},
// Proxy to _'s chain. Can't be proxied the same way the rest of the
// underscore methods are proxied because it relies on the underscore
// constructor.
chain: function () {
return _(this.models).chain();
},
// Reset all internal state. Called when the collection is reset.
_reset : function(options) {
this.length = 0;
this.models = [];
this._byId = {};
this._byCid = {};
},
// Prepare a model to be added to this collection
_prepareModel: function(model, options) {
if (!(model instanceof Backbone.Model)) {
var attrs = model;
model = new this.model(attrs, {collection: this});
if (model.validate && !model._performValidation(attrs, options)) model = false;
} else if (!model.collection) {
model.collection = this;
}
return model;
},
// Internal implementation of adding a single model to the set, updating
// hash indexes for `id` and `cid` lookups.
// Returns the model, or 'false' if validation on a new model fails.
_add : function(model, options) {
options || (options = {});
model = this._prepareModel(model, options);
if (!model) return false;
var already = this.getByCid(model);
if (already) throw new Error(["Can't add the same model to a set twice", already.id]);
this._byId[model.id] = model;
this._byCid[model.cid] = model;
var index = options.at != null ? options.at :
this.comparator ? this.sortedIndex(model, this.comparator) :
this.length;
this.models.splice(index, 0, model);
model.bind('all', this._onModelEvent);
this.length++;
if (!options.silent) model.trigger('add', model, this, options);
return model;
},
// Internal implementation of removing a single model from the set, updating
// hash indexes for `id` and `cid` lookups.
_remove : function(model, options) {
options || (options = {});
model = this.getByCid(model) || this.get(model);
if (!model) return null;
delete this._byId[model.id];
delete this._byCid[model.cid];
this.models.splice(this.indexOf(model), 1);
this.length--;
if (!options.silent) model.trigger('remove', model, this, options);
this._removeReference(model);
return model;
},
// Internal method to remove a model's ties to a collection.
_removeReference : function(model) {
if (this == model.collection) {
delete model.collection;
}
model.unbind('all', this._onModelEvent);
},
// Internal method called every time a model in the set fires an event.
// Sets need to update their indexes when models change ids. All other
// events simply proxy through. "add" and "remove" events that originate
// in other collections are ignored.
_onModelEvent : function(ev, model, collection, options) {
if ((ev == 'add' || ev == 'remove') && collection != this) return;
if (ev == 'destroy') {
this._remove(model, options);
}
if (model && ev === 'change:' + model.idAttribute) {
delete this._byId[model.previous(model.idAttribute)];
this._byId[model.id] = model;
}
this.trigger.apply(this, arguments);
}
});
// Underscore methods that we want to implement on the Collection.
var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect',
'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include',
'contains', 'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size',
'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty', 'groupBy'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {
Backbone.Collection.prototype[method] = function() {
return _[method].apply(_, [this.models].concat(_.toArray(arguments)));
};
});
// Backbone.Router
// -------------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
Backbone.Router = function(options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this.initialize.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var namedParam = /:([\w\d]+)/g;
var splatParam = /\*([\w\d]+)/g;
var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
// Set up all inheritable **Backbone.Router** properties and methods.
_.extend(Backbone.Router.prototype, Backbone.Events, {
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize : function(){},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route : function(route, name, callback) {
Backbone.history || (Backbone.history = new Backbone.History);
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
Backbone.history.route(route, _.bind(function(fragment) {
var args = this._extractParameters(route, fragment);
callback.apply(this, args);
this.trigger.apply(this, ['route:' + name].concat(args));
}, this));
},
// Simple proxy to `Backbone.history` to save a fragment into the history.
navigate : function(fragment, triggerRoute) {
Backbone.history.navigate(fragment, triggerRoute);
},
// Bind all defined routes to `Backbone.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes : function() {
if (!this.routes) return;
var routes = [];
for (var route in this.routes) {
routes.unshift([route, this.routes[route]]);
}
for (var i = 0, l = routes.length; i < l; i++) {
this.route(routes[i][0], routes[i][1], this[routes[i][1]]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp : function(route) {
route = route.replace(escapeRegExp, "\\$&")
.replace(namedParam, "([^\/]*)")
.replace(splatParam, "(.*?)");
return new RegExp('^' + route + '$');
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted parameters.
_extractParameters : function(route, fragment) {
return route.exec(fragment).slice(1);
}
});
// Backbone.History
// ----------------
// Handles cross-browser history management, based on URL fragments. If the
// browser does not support `onhashchange`, falls back to polling.
Backbone.History = function() {
this.handlers = [];
_.bindAll(this, 'checkUrl');
};
// Cached regex for cleaning hashes.
var hashStrip = /^#*/;
// Cached regex for detecting MSIE.
var isExplorer = /msie [\w.]+/;
// Has the history handling already been started?
var historyStarted = false;
// Set up all inheritable **Backbone.History** properties and methods.
_.extend(Backbone.History.prototype, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Get the cross-browser normalized URL fragment, either from the URL,
// the hash, or the override.
getFragment : function(fragment, forcePushState) {
if (fragment == null) {
if (this._hasPushState || forcePushState) {
fragment = window.location.pathname;
var search = window.location.search;
if (search) fragment += search;
if (fragment.indexOf(this.options.root) == 0) fragment = fragment.substr(this.options.root.length);
} else {
fragment = window.location.hash;
}
}
return decodeURIComponent(fragment.replace(hashStrip, ''));
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start : function(options) {
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
if (historyStarted) throw new Error("Backbone.history has already been started");
this.options = _.extend({}, {root: '/'}, this.options, options);
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && window.history && window.history.pushState);
var fragment = this.getFragment();
var docMode = document.documentMode;
var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
if (oldIE) {
this.iframe = $('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
this.navigate(fragment);
}
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
$(window).bind('popstate', this.checkUrl);
} else if ('onhashchange' in window && !oldIE) {
$(window).bind('hashchange', this.checkUrl);
} else {
setInterval(this.checkUrl, this.interval);
}
// Determine if we need to change the base url, for a pushState link
// opened by a non-pushState browser.
this.fragment = fragment;
historyStarted = true;
var loc = window.location;
var atRoot = loc.pathname == this.options.root;
if (this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
window.location.replace(this.options.root + '#' + this.fragment);
// Return immediately as browser will do redirect to new url
return true;
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = loc.hash.replace(hashStrip, '');
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment);
}
if (!this.options.silent) {
return this.loadUrl();
}
},
// Add a route to be tested when the fragment changes. Routes added later may
// override previous routes.
route : function(route, callback) {
this.handlers.unshift({route : route, callback : callback});
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl : function(e) {
var current = this.getFragment();
if (current == this.fragment && this.iframe) current = this.getFragment(this.iframe.location.hash);
if (current == this.fragment || current == decodeURIComponent(this.fragment)) return false;
if (this.iframe) this.navigate(current);
this.loadUrl() || this.loadUrl(window.location.hash);
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl : function(fragmentOverride) {
var fragment = this.fragment = this.getFragment(fragmentOverride);
var matched = _.any(this.handlers, function(handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
return matched;
},
// Save a fragment into the hash history. You are responsible for properly
// URL-encoding the fragment in advance. This does not trigger
// a `hashchange` event.
navigate : function(fragment, triggerRoute) {
var frag = (fragment || '').replace(hashStrip, '');
if (this.fragment == frag || this.fragment == decodeURIComponent(frag)) return;
if (this._hasPushState) {
var loc = window.location;
if (frag.indexOf(this.options.root) != 0) frag = this.options.root + frag;
this.fragment = frag;
window.history.pushState({}, document.title, loc.protocol + '//' + loc.host + frag);
} else {
window.location.hash = this.fragment = frag;
if (this.iframe && (frag != this.getFragment(this.iframe.location.hash))) {
this.iframe.document.open().close();
this.iframe.location.hash = frag;
}
}
if (triggerRoute) this.loadUrl(fragment);
}
});
// Backbone.View
// -------------
// Creating a Backbone.View creates its initial element outside of the DOM,
// if an existing element is not provided...
Backbone.View = function(options) {
this.cid = _.uniqueId('view');
this._configure(options || {});
this._ensureElement();
this.delegateEvents();
this.initialize.apply(this, arguments);
};
// Element lookup, scoped to DOM elements within the current view.
// This should be prefered to global lookups, if you're dealing with
// a specific view.
var selectorDelegate = function(selector) {
return $(selector, this.el);
};
// Cached regex to split keys for `delegate`.
var eventSplitter = /^(\S+)\s*(.*)$/;
// List of view options to be merged as properties.
var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName'];
// Set up all inheritable **Backbone.View** properties and methods.
_.extend(Backbone.View.prototype, Backbone.Events, {
// The default `tagName` of a View's element is `"div"`.
tagName : 'div',
// Attach the `selectorDelegate` function as the `$` property.
$ : selectorDelegate,
// Initialize is an empty function by default. Override it with your own
// initialization logic.
initialize : function(){},
// **render** is the core function that your view should override, in order
// to populate its element (`this.el`), with the appropriate HTML. The
// convention is for **render** to always return `this`.
render : function() {
return this;
},
// Remove this view from the DOM. Note that the view isn't present in the
// DOM by default, so calling this method may be a no-op.
remove : function() {
$(this.el).remove();
return this;
},
// For small amounts of DOM Elements, where a full-blown template isn't
// needed, use **make** to manufacture elements, one at a time.
//
// var el = this.make('li', {'class': 'row'}, this.model.escape('title'));
//
make : function(tagName, attributes, content) {
var el = document.createElement(tagName);
if (attributes) $(el).attr(attributes);
if (content) $(el).html(content);
return el;
},
// Set callbacks, where `this.callbacks` is a hash of
//
// *{"event selector": "callback"}*
//
// {
// 'mousedown .title': 'edit',
// 'click .button': 'save'
// }
//
// pairs. Callbacks will be bound to the view, with `this` set properly.
// Uses event delegation for efficiency.
// Omitting the selector binds the event to `this.el`.
// This only works for delegate-able events: not `focus`, `blur`, and
// not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents : function(events) {
if (!(events || (events = this.events))) return;
if (_.isFunction(events)) events = events.call(this);
$(this.el).unbind('.delegateEvents' + this.cid);
for (var key in events) {
var method = this[events[key]];
if (!method) throw new Error('Event "' + events[key] + '" does not exist');
var match = key.match(eventSplitter);
var eventName = match[1], selector = match[2];
method = _.bind(method, this);
eventName += '.delegateEvents' + this.cid;
if (selector === '') {
$(this.el).bind(eventName, method);
} else {
$(this.el).delegate(selector, eventName, method);
}
}
},
// Performs the initial configuration of a View with a set of options.
// Keys with special meaning *(model, collection, id, className)*, are
// attached directly to the view.
_configure : function(options) {
if (this.options) options = _.extend({}, this.options, options);
for (var i = 0, l = viewOptions.length; i < l; i++) {
var attr = viewOptions[i];
if (options[attr]) this[attr] = options[attr];
}
this.options = options;
},
// Ensure that the View has a DOM element to render into.
// If `this.el` is a string, pass it through `$()`, take the first
// matching element, and re-assign it to `el`. Otherwise, create
// an element from the `id`, `className` and `tagName` proeprties.
_ensureElement : function() {
if (!this.el) {
var attrs = this.attributes || {};
if (this.id) attrs.id = this.id;
if (this.className) attrs['class'] = this.className;
this.el = this.make(this.tagName, attrs);
} else if (_.isString(this.el)) {
this.el = $(this.el).get(0);
}
}
});
// The self-propagating extend function that Backbone classes use.
var extend = function (protoProps, classProps) {
var child = inherits(this, protoProps, classProps);
child.extend = this.extend;
return child;
};
// Set up inheritance for the model, collection, and view.
Backbone.Model.extend = Backbone.Collection.extend =
Backbone.Router.extend = Backbone.View.extend = extend;
// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
'create': 'POST',
'update': 'PUT',
'delete': 'DELETE',
'read' : 'GET'
};
// Backbone.sync
// -------------
// Override this function to change the manner in which Backbone persists
// models to the server. You will be passed the type of request, and the
// model in question. By default, uses makes a RESTful Ajax request
// to the model's `url()`. Some possible customizations could be:
//
// * Use `setTimeout` to batch rapid-fire updates into a single request.
// * Send up the models as XML instead of JSON.
// * Persist models via WebSockets instead of Ajax.
//
// Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
// as `POST`, with a `_method` parameter containing the true HTTP method,
// as well as all requests with the body as `application/x-www-form-urlencoded` instead of
// `application/json` with the model in a param named `model`.
// Useful when interfacing with server-side languages like **PHP** that make
// it difficult to read the body of `PUT` requests.
Backbone.sync = function(method, model, options) {
var type = methodMap[method];
// Default JSON-request options.
var params = _.extend({
type: type,
dataType: 'json'
}, options);
// Ensure that we have a URL.
if (!params.url) {
params.url = getUrl(model) || urlError();
}
// Ensure that we have the appropriate request data.
if (!params.data && model && (method == 'create' || method == 'update')) {
params.contentType = 'application/json';
params.data = JSON.stringify(model.toJSON());
}
// For older servers, emulate JSON by encoding the request into an HTML-form.
if (Backbone.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.data = params.data ? {model : params.data} : {};
}
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
// And an `X-HTTP-Method-Override` header.
if (Backbone.emulateHTTP) {
if (type === 'PUT' || type === 'DELETE') {
if (Backbone.emulateJSON) params.data._method = type;
params.type = 'POST';
params.beforeSend = function(xhr) {
xhr.setRequestHeader('X-HTTP-Method-Override', type);
};
}
}
// Don't process data on a non-GET request.
if (params.type !== 'GET' && !Backbone.emulateJSON) {
params.processData = false;
}
// Make the request.
return $.ajax(params);
};
// Helpers
// -------
// Shared empty constructor function to aid in prototype-chain creation.
var ctor = function(){};
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
var inherits = function(parent, protoProps, staticProps) {
var child;
// The constructor function for the new subclass is either defined by you
// (the "constructor" property in your `extend` definition), or defaulted
// by us to simply call `super()`.
if (protoProps && protoProps.hasOwnProperty('constructor')) {
child = protoProps.constructor;
} else {
child = function(){ return parent.apply(this, arguments); };
}
// Inherit class (static) properties from parent.
_.extend(child, parent);
// Set the prototype chain to inherit from `parent`, without calling
// `parent`'s constructor function.
ctor.prototype = parent.prototype;
child.prototype = new ctor();
// Add prototype properties (instance properties) to the subclass,
// if supplied.
if (protoProps) _.extend(child.prototype, protoProps);
// Add static properties to the constructor function, if supplied.
if (staticProps) _.extend(child, staticProps);
// Correctly set child's `prototype.constructor`.
child.prototype.constructor = child;
// Set a convenience property in case the parent's prototype is needed later.
child.__super__ = parent.prototype;
return child;
};
// Helper function to get a URL from a Model or Collection as a property
// or as a function.
var getUrl = function(object) {
if (!(object && object.url)) return null;
return _.isFunction(object.url) ? object.url() : object.url;
};
// Throw an error when a URL is needed, and none is supplied.
var urlError = function() {
throw new Error('A "url" property or function must be specified');
};
// Wrap an optional error callback with a fallback error event.
var wrapError = function(onError, model, options) {
return function(resp) {
if (onError) {
onError(model, resp, options);
} else {
model.trigger('error', model, resp, options);
}
};
};
// Helper function to escape a string for HTML rendering.
var escapeHTML = function(string) {
return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/');
};
}).call(this);
/**
* Castor - a cross site POSTing JavaScript logging library for Loggly
*
* Copyright (c) 2011 Loggly, Inc.
* All rights reserved.
*
* Author: Kord Campbell <[email protected]>
* Date: May 2, 2011
*
* Uses methods from janky.post, copyright(c) 2011 Thomas Rampelberg <[email protected]>
*
* Sample usage (replace with your own Loggly HTTP input URL):
<script src="/js/loggly.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload=function(){
castor = new loggly({ url: 'http://logs.loggly.com/inputs/a4e839e9-4227-49aa-9d28-e18e5ba5a818?rt=1', level: 'WARN'});
castor.log("url="+window.location.href + " browser=" + castor.user_agent + " height=" + castor.browser_size.height);
}
</script>
*/
(function() {
this.loggly = function(opts) {
this.user_agent = get_agent();
this.browser_size = get_size();
log_methods = {'error': 5, 'warn': 4, 'info': 3, 'debug': 2, 'log': 1};
if (!opts.url) throw new Error("Please include a Loggly HTTP URL.");
if (!opts.level) {
this.level = log_methods['info'];
} else {
this.level = log_methods[opts.level];
}
this.log = function(data) {
if (log_methods['log'] == this.level) {
opts.data = data;
janky(opts);
}
};
this.debug = function(data) {
if (log_methods['debug'] >= this.level) {
opts.data = data;
janky(opts);
}
};
this.info = function(data) {
if (log_methods['info'] >= this.level) {
opts.data = data;
janky(opts);
}
};
this.warn = function(data) {
if (log_methods['warn'] >= this.level) {
opts.data = data;
janky(opts);
}
};
this.error = function(data) {
if (log_methods['error'] >= this.level) {
opts.data = data;
janky(opts);
}
};
};
this.janky = function(opts) {
janky._form(function(iframe, form) {
form.setAttribute("action", opts.url);
form.setAttribute("method", "post");
janky._input(iframe, form, opts.data);
form.submit();
setTimeout(function(){
document.body.removeChild(iframe);
}, 2000);
});
};
this.janky._form = function(cb) {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.style.display = "none";
setTimeout(function() {
var form = iframe.contentWindow.document.createElement("form");
iframe.contentWindow.document.body.appendChild(form);
cb(iframe, form);
}, 0);
};
this.janky._input = function(iframe, form, data) {
var inp = iframe.contentWindow.document.createElement("input");
inp.setAttribute("type", "hidden");
inp.setAttribute("name", "source");
inp.value = "castor " + data;
form.appendChild(inp);
};
this.get_agent = function () {
return navigator.appCodeName + navigator.appName + navigator.appVersion;
};
this.get_size = function () {
var width = 0; var height = 0;
if( typeof( window.innerWidth ) == 'number' ) {
width = window.innerWidth; height = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
width = document.documentElement.clientWidth; height = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
width = document.body.clientWidth; height = document.body.clientHeight;
}
return {'height': height, 'width': width};
};
})();
jsworld={};jsworld.formatIsoDateTime=function(a,b){if(typeof a==="undefined")a=new Date;if(typeof b==="undefined")b=false;var c=jsworld.formatIsoDate(a)+" "+jsworld.formatIsoTime(a);if(b){var d=a.getHours()-a.getUTCHours();var e=Math.abs(d);var f=a.getUTCMinutes();var g=a.getMinutes();if(g!=f&&f<30&&d<0)e--;if(g!=f&&f>30&&d>0)e--;var h;if(g!=f)h=":30";else h=":00";var i;if(e<10)i="0"+e+h;else i=""+e+h;if(d<0)i="-"+i;else i="+"+i;c=c+i}return c};jsworld.formatIsoDate=function(a){if(typeof a==="undefined")a=new Date;var b=a.getFullYear();var c=a.getMonth()+1;var d=a.getDate();return b+"-"+jsworld._zeroPad(c,2)+"-"+jsworld._zeroPad(d,2)};jsworld.formatIsoTime=function(a){if(typeof a==="undefined")a=new Date;var b=a.getHours();var c=a.getMinutes();var d=a.getSeconds();return jsworld._zeroPad(b,2)+":"+jsworld._zeroPad(c,2)+":"+jsworld._zeroPad(d,2)};jsworld.parseIsoDateTime=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)(\d\d)(\d\d)[T ](\d\d)(\d\d)(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d)(\d\d)(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date/time string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);var f=parseInt(b[4],10);var g=parseInt(b[5],10);var h=parseInt(b[6],10);if(d<1||d>12||e<1||e>31||f<0||f>23||g<0||g>59||h<0||h>59)throw"Error: Invalid ISO-8601 date/time value";var i=new Date(c,d-1,e,f,g,h);if(i.getDate()!=e||i.getMonth()+1!=d)throw"Error: Invalid date";return i};jsworld.parseIsoDate=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)(\d\d)(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);if(d<1||d>12||e<1||e>31)throw"Error: Invalid ISO-8601 date value";var f=new Date(c,d-1,e);if(f.getDate()!=e||f.getMonth()+1!=d)throw"Error: Invalid date";return f};jsworld.parseIsoTime=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d):(\d\d):(\d\d)/);if(b===null)b=a.match(/^(\d\d)(\d\d)(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date/time string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);if(c<0||c>23||d<0||d>59||e<0||e>59)throw"Error: Invalid ISO-8601 time value";return new Date(0,0,0,c,d,e)};jsworld._trim=function(a){var b=" \n\r\t\f \u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";for(var c=0;c<a.length;c++){if(b.indexOf(a.charAt(c))===-1){a=a.substring(c);break}}for(c=a.length-1;c>=0;c--){if(b.indexOf(a.charAt(c))===-1){a=a.substring(0,c+1);break}}return b.indexOf(a.charAt(0))===-1?a:""};jsworld._isNumber=function(a){if(typeof a=="number")return true;if(typeof a!="string")return false;var b=a+"";return/^-?(\d+|\d*\.\d+)$/.test(b)};jsworld._isInteger=function(a){if(typeof a!="number"&&typeof a!="string")return false;var b=a+"";return/^-?\d+$/.test(b)};jsworld._isFloat=function(a){if(typeof a!="number"&&typeof a!="string")return false;var b=a+"";return/^-?\.\d+?$/.test(b)};jsworld._hasOption=function(a,b){if(typeof a!="string"||typeof b!="string")return false;if(b.indexOf(a)!=-1)return true;else return false};jsworld._stringReplaceAll=function(a,b,c){var d;if(b.length==1&&c.length==1){d="";for(var e=0;e<a.length;e++){if(a.charAt(e)==b.charAt(0))d=d+c.charAt(0);else d=d+a.charAt(e)}return d}else{d=a;var f=d.indexOf(b);while(f!=-1){d=d.replace(b,c);f=d.indexOf(b)}return d}};jsworld._stringStartsWith=function(a,b){if(a.length<b.length)return false;for(var c=0;c<b.length;c++){if(a.charAt(c)!=b.charAt(c))return false}return true};jsworld._getPrecision=function(a){if(typeof a!="string")return-1;var b=a.match(/\.(\d)/);if(b)return parseInt(b[1],10);else return-1};jsworld._splitNumber=function(a){if(typeof a=="number")a=a+"";var b={};if(a.charAt(0)=="-")a=a.substring(1);var c=a.split(".");if(!c[1])c[1]="";b.integer=c[0];b.fraction=c[1];return b};jsworld._formatIntegerPart=function(a,b,c){if(c==""||b=="-1")return a;var d=b.split(";");var e="";var f=a.length;var g;while(f>0){if(d.length>0)g=parseInt(d.shift(),10);if(isNaN(g))throw"Error: Invalid grouping";if(g==-1){e=a.substring(0,f)+e;break}f-=g;if(f<1){e=a.substring(0,f+g)+e;break}e=c+a.substring(f,f+g)+e}return e};jsworld._formatFractionPart=function(a,b){for(var c=0;a.length<b;c++)a=a+"0";return a};jsworld._zeroPad=function(a,b){var c=a+"";while(c.length<b)c="0"+c;return c};jsworld._spacePad=function(a,b){var c=a+"";while(c.length<b)c=" "+c;return c};jsworld.Locale=function(a){this._className="jsworld.Locale";this._parseList=function(a,b){var c=[];if(a==null){throw"Names not defined"}else if(typeof a=="object"){c=a}else if(typeof a=="string"){c=a.split(";",b);for(var d=0;d<c.length;d++){if(c[d][0]=='"'&&c[d][c[d].length-1]=='"')c[d]=c[d].slice(1,-1);else throw"Missing double quotes"}}else{throw"Names must be an array or a string"}if(c.length!=b)throw"Expected "+b+" items, got "+c.length;return c};this._validateFormatString=function(a){if(typeof a=="string"&&a.length>0)return a;else throw"Empty or no string"};if(a==null||typeof a!="object")throw"Error: Invalid/missing locale properties";if(typeof a.decimal_point!="string")throw"Error: Invalid/missing decimal_point property";this.decimal_point=a.decimal_point;if(typeof a.thousands_sep!="string")throw"Error: Invalid/missing thousands_sep property";this.thousands_sep=a.thousands_sep;if(typeof a.grouping!="string")throw"Error: Invalid/missing grouping property";this.grouping=a.grouping;if(typeof a.int_curr_symbol!="string")throw"Error: Invalid/missing int_curr_symbol property";if(!/[A-Za-z]{3}.?/.test(a.int_curr_symbol))throw"Error: Invalid int_curr_symbol property";this.int_curr_symbol=a.int_curr_symbol;if(typeof a.currency_symbol!="string")throw"Error: Invalid/missing currency_symbol property";this.currency_symbol=a.currency_symbol;if(typeof a.frac_digits!="number"&&a.frac_digits<0)throw"Error: Invalid/missing frac_digits property";this.frac_digits=a.frac_digits;if(a.mon_decimal_point===null||a.mon_decimal_point==""){if(this.frac_digits>0)throw"Error: Undefined mon_decimal_point property";else a.mon_decimal_point=""}if(typeof a.mon_decimal_point!="string")throw"Error: Invalid/missing mon_decimal_point property";this.mon_decimal_point=a.mon_decimal_point;if(typeof a.mon_thousands_sep!="string")throw"Error: Invalid/missing mon_thousands_sep property";this.mon_thousands_sep=a.mon_thousands_sep;if(typeof a.mon_grouping!="string")throw"Error: Invalid/missing mon_grouping property";this.mon_grouping=a.mon_grouping;if(typeof a.positive_sign!="string")throw"Error: Invalid/missing positive_sign property";this.positive_sign=a.positive_sign;if(typeof a.negative_sign!="string")throw"Error: Invalid/missing negative_sign property";this.negative_sign=a.negative_sign;if(a.p_cs_precedes!==0&&a.p_cs_precedes!==1)throw"Error: Invalid/missing p_cs_precedes property, must be 0 or 1";this.p_cs_precedes=a.p_cs_precedes;if(a.n_cs_precedes!==0&&a.n_cs_precedes!==1)throw"Error: Invalid/missing n_cs_precedes, must be 0 or 1";this.n_cs_precedes=a.n_cs_precedes;if(a.p_sep_by_space!==0&&a.p_sep_by_space!==1&&a.p_sep_by_space!==2)throw"Error: Invalid/missing p_sep_by_space property, must be 0, 1 or 2";this.p_sep_by_space=a.p_sep_by_space;if(a.n_sep_by_space!==0&&a.n_sep_by_space!==1&&a.n_sep_by_space!==2)throw"Error: Invalid/missing n_sep_by_space property, must be 0, 1, or 2";this.n_sep_by_space=a.n_sep_by_space;if(a.p_sign_posn!==0&&a.p_sign_posn!==1&&a.p_sign_posn!==2&&a.p_sign_posn!==3&&a.p_sign_posn!==4)throw"Error: Invalid/missing p_sign_posn property, must be 0, 1, 2, 3 or 4";this.p_sign_posn=a.p_sign_posn;if(a.n_sign_posn!==0&&a.n_sign_posn!==1&&a.n_sign_posn!==2&&a.n_sign_posn!==3&&a.n_sign_posn!==4)throw"Error: Invalid/missing n_sign_posn property, must be 0, 1, 2, 3 or 4";this.n_sign_posn=a.n_sign_posn;if(typeof a.int_frac_digits!="number"&&a.int_frac_digits<0)throw"Error: Invalid/missing int_frac_digits property";this.int_frac_digits=a.int_frac_digits;if(a.int_p_cs_precedes!==0&&a.int_p_cs_precedes!==1)throw"Error: Invalid/missing int_p_cs_precedes property, must be 0 or 1";this.int_p_cs_precedes=a.int_p_cs_precedes;if(a.int_n_cs_precedes!==0&&a.int_n_cs_precedes!==1)throw"Error: Invalid/missing int_n_cs_precedes property, must be 0 or 1";this.int_n_cs_precedes=a.int_n_cs_precedes;if(a.int_p_sep_by_space!==0&&a.int_p_sep_by_space!==1&&a.int_p_sep_by_space!==2)throw"Error: Invalid/missing int_p_sep_by_spacev, must be 0, 1 or 2";this.int_p_sep_by_space=a.int_p_sep_by_space;if(a.int_n_sep_by_space!==0&&a.int_n_sep_by_space!==1&&a.int_n_sep_by_space!==2)throw"Error: Invalid/missing int_n_sep_by_space property, must be 0, 1, or 2";this.int_n_sep_by_space=a.int_n_sep_by_space;if(a.int_p_sign_posn!==0&&a.int_p_sign_posn!==1&&a.int_p_sign_posn!==2&&a.int_p_sign_posn!==3&&a.int_p_sign_posn!==4)throw"Error: Invalid/missing int_p_sign_posn property, must be 0, 1, 2, 3 or 4";this.int_p_sign_posn=a.int_p_sign_posn;if(a.int_n_sign_posn!==0&&a.int_n_sign_posn!==1&&a.int_n_sign_posn!==2&&a.int_n_sign_posn!==3&&a.int_n_sign_posn!==4)throw"Error: Invalid/missing int_n_sign_posn property, must be 0, 1, 2, 3 or 4";this.int_n_sign_posn=a.int_n_sign_posn;if(a==null||typeof a!="object")throw"Error: Invalid/missing time locale properties";try{this.abday=this._parseList(a.abday,7)}catch(b){throw"Error: Invalid abday property: "+b}try{this.day=this._parseList(a.day,7)}catch(b){throw"Error: Invalid day property: "+b}try{this.abmon=this._parseList(a.abmon,12)}catch(b){throw"Error: Invalid abmon property: "+b}try{this.mon=this._parseList(a.mon,12)}catch(b){throw"Error: Invalid mon property: "+b}try{this.d_fmt=this._validateFormatString(a.d_fmt)}catch(b){throw"Error: Invalid d_fmt property: "+b}try{this.t_fmt=this._validateFormatString(a.t_fmt)}catch(b){throw"Error: Invalid t_fmt property: "+b}try{this.d_t_fmt=this._validateFormatString(a.d_t_fmt)}catch(b){throw"Error: Invalid d_t_fmt property: "+b}try{var c=this._parseList(a.am_pm,2);this.am=c[0];this.pm=c[1]}catch(b){this.am="";this.pm=""}this.getAbbreviatedWeekdayName=function(a){if(typeof a=="undefined"||a===null)return this.abday;if(!jsworld._isInteger(a)||a<0||a>6)throw"Error: Invalid weekday argument, must be an integer [0..6]";return this.abday[a]};this.getWeekdayName=function(a){if(typeof a=="undefined"||a===null)return this.day;if(!jsworld._isInteger(a)||a<0||a>6)throw"Error: Invalid weekday argument, must be an integer [0..6]";return this.day[a]};this.getAbbreviatedMonthName=function(a){if(typeof a=="undefined"||a===null)return this.abmon;if(!jsworld._isInteger(a)||a<0||a>11)throw"Error: Invalid month argument, must be an integer [0..11]";return this.abmon[a]};this.getMonthName=function(a){if(typeof a=="undefined"||a===null)return this.mon;if(!jsworld._isInteger(a)||a<0||a>11)throw"Error: Invalid month argument, must be an integer [0..11]";return this.mon[a]};this.getDecimalPoint=function(){return this.decimal_point};this.getCurrencySymbol=function(){return this.currency_symbol};this.getIntCurrencySymbol=function(){return this.int_curr_symbol.substring(0,3)};this.currencySymbolPrecedes=function(){if(this.p_cs_precedes==1)return true;else return false};this.intCurrencySymbolPrecedes=function(){if(this.int_p_cs_precedes==1)return true;else return false};this.getMonetaryDecimalPoint=function(){return this.mon_decimal_point};this.getFractionalDigits=function(){return this.frac_digits};this.getIntFractionalDigits=function(){return this.int_frac_digits}};jsworld.NumericFormatter=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.format=function(a,b){if(typeof a=="string")a=jsworld._trim(a);if(!jsworld._isNumber(a))throw"Error: The input is not a number";var c=parseFloat(a,10);var d=jsworld._getPrecision(b);if(d!=-1)c=Math.round(c*Math.pow(10,d))/Math.pow(10,d);var e=jsworld._splitNumber(String(c));var f;if(c===0)f="0";else f=jsworld._hasOption("^",b)?e.integer:jsworld._formatIntegerPart(e.integer,this.lc.grouping,this.lc.thousands_sep);var g=d!=-1?jsworld._formatFractionPart(e.fraction,d):e.fraction;var h=g.length?f+this.lc.decimal_point+g:f;if(jsworld._hasOption("~",b)||c===0){return h}else{if(jsworld._hasOption("+",b)||c<0){if(c>0)return"+"+h;else if(c<0)return"-"+h;else return h}else{return h}}}};jsworld.DateTimeFormatter=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance.";this.lc=a;this.formatDate=function(a){var b=null;if(typeof a=="string"){try{b=jsworld.parseIsoDate(a)}catch(c){b=jsworld.parseIsoDateTime(a)}}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.d_fmt)};this.formatTime=function(a){var b=null;if(typeof a=="string"){try{b=jsworld.parseIsoTime(a)}catch(c){b=jsworld.parseIsoDateTime(a)}}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.t_fmt)};this.formatDateTime=function(a){var b=null;if(typeof a=="string"){b=jsworld.parseIsoDateTime(a)}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.d_t_fmt)};this._applyFormatting=function(a,b){b=b.replace(/%%/g,"%");b=b.replace(/%a/g,this.lc.abday[a.getDay()]);b=b.replace(/%A/g,this.lc.day[a.getDay()]);b=b.replace(/%b/g,this.lc.abmon[a.getMonth()]);b=b.replace(/%B/g,this.lc.mon[a.getMonth()]);b=b.replace(/%d/g,jsworld._zeroPad(a.getDate(),2));b=b.replace(/%e/g,jsworld._spacePad(a.getDate(),2));b=b.replace(/%F/g,a.getFullYear()+"-"+jsworld._zeroPad(a.getMonth()+1,2)+"-"+jsworld._zeroPad(a.getDate(),2));b=b.replace(/%h/g,this.lc.abmon[a.getMonth()]);b=b.replace(/%H/g,jsworld._zeroPad(a.getHours(),2));b=b.replace(/%I/g,jsworld._zeroPad(this._hours12(a.getHours()),2));b=b.replace(/%k/g,a.getHours());b=b.replace(/%l/g,this._hours12(a.getHours()));b=b.replace(/%m/g,jsworld._zeroPad(a.getMonth()+1,2));b=b.replace(/%n/g,"\n");b=b.replace(/%M/g,jsworld._zeroPad(a.getMinutes(),2));b=b.replace(/%p/g,this._getAmPm(a.getHours()));b=b.replace(/%P/g,this._getAmPm(a.getHours()).toLocaleLowerCase());b=b.replace(/%R/g,jsworld._zeroPad(a.getHours(),2)+":"+jsworld._zeroPad(a.getMinutes(),2));b=b.replace(/%S/g,jsworld._zeroPad(a.getSeconds(),2));b=b.replace(/%T/g,jsworld._zeroPad(a.getHours(),2)+":"+jsworld._zeroPad(a.getMinutes(),2)+":"+jsworld._zeroPad(a.getSeconds(),2));b=b.replace(/%w/g,this.lc.day[a.getDay()]);b=b.replace(/%y/g,(new String(a.getFullYear())).substring(2));b=b.replace(/%Y/g,a.getFullYear());b=b.replace(/%Z/g,"");b=b.replace(/%[a-zA-Z]/g,"");return b};this._hours12=function(a){if(a===0)return 12;else if(a>12)return a-12;else return a};this._getAmPm=function(a){if(a===0||a>12)return this.lc.pm;else return this.lc.am}};jsworld.MonetaryFormatter=function(a,b,c){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.currencyFractionDigits={AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,COP:0,CRC:0,DJF:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,IRR:0,ISK:0,JOD:3,JPY:0,KMF:0,KRW:0,KWD:3,LAK:0,LBP:0,LYD:3,MGA:0,MMK:0,MNT:0,MRO:0,MUR:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,SYP:0,TND:3,TWD:0,TZS:0,UGX:0,UZS:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0};if(typeof b=="string"){this.currencyCode=b.toUpperCase();var d=this.currencyFractionDigits[this.currencyCode];if(typeof d!="number")d=2;this.lc.frac_digits=d;this.lc.int_frac_digits=d}else{this.currencyCode=this.lc.int_curr_symbol.substring(0,3).toUpperCase()}this.intSep=this.lc.int_curr_symbol.charAt(3);if(this.currencyCode==this.lc.int_curr_symbol.substring(0,3)){this.internationalFormatting=false;this.curSym=this.lc.currency_symbol}else{if(typeof c=="string"){this.curSym=c;this.internationalFormatting=false}else{this.internationalFormatting=true}}this.getCurrencySymbol=function(){return this.curSym};this.currencySymbolPrecedes=function(a){if(typeof a=="string"&&a=="i"){if(this.lc.int_p_cs_precedes==1)return true;else return false}else{if(this.internationalFormatting){if(this.lc.int_p_cs_precedes==1)return true;else return false}else{if(this.lc.p_cs_precedes==1)return true;else return false}}};this.getDecimalPoint=function(){return this.lc.mon_decimal_point};this.getFractionalDigits=function(a){if(typeof a=="string"&&a=="i"){return this.lc.int_frac_digits}else{if(this.internationalFormatting)return this.lc.int_frac_digits;else return this.lc.frac_digits}};this.format=function(a,b){var c;if(typeof a=="string"){a=jsworld._trim(a);c=parseFloat(a);if(typeof c!="number"||isNaN(c))throw"Error: Amount string not a number"}else if(typeof a=="number"){c=a}else{throw"Error: Amount not a number"}var d=jsworld._getPrecision(b);if(d==-1){if(this.internationalFormatting||jsworld._hasOption("i",b))d=this.lc.int_frac_digits;else d=this.lc.frac_digits}c=Math.round(c*Math.pow(10,d))/Math.pow(10,d);var e=jsworld._splitNumber(String(c));var f;if(c===0)f="0";else f=jsworld._hasOption("^",b)?e.integer:jsworld._formatIntegerPart(e.integer,this.lc.mon_grouping,this.lc.mon_thousands_sep);var g;if(d==-1){if(this.internationalFormatting||jsworld._hasOption("i",b))g=jsworld._formatFractionPart(e.fraction,this.lc.int_frac_digits);else g=jsworld._formatFractionPart(e.fraction,this.lc.frac_digits)}else{g=jsworld._formatFractionPart(e.fraction,d)}var h;if(this.lc.frac_digits>0||g.length)h=f+this.lc.mon_decimal_point+g;else h=f;if(jsworld._hasOption("~",b)){return h}else{var i=jsworld._hasOption("!",b)?true:false;var j=c<0?"-":"+";if(this.internationalFormatting||jsworld._hasOption("i",b)){if(i)return this._formatAsInternationalCurrencyWithNoSym(j,h);else return this._formatAsInternationalCurrency(j,h)}else{if(i)return this._formatAsLocalCurrencyWithNoSym(j,h);else return this._formatAsLocalCurrency(j,h)}}};this._formatAsLocalCurrency=function(a,b){if(a=="+"){if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return"("+b+this.curSym+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return"("+this.curSym+b+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return"("+b+" "+this.curSym+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return"("+this.curSym+" "+b+")"}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b+" "+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+" "+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+" "+b+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+this.curSym+b}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.curSym+b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.curSym+" "+b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.curSym+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.curSym+b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+" "+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign+" "+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+this.curSym+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.curSym+this.lc.positive_sign+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.curSym+this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.curSym+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.curSym+" "+this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return"("+b+this.curSym+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return"("+this.curSym+b+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return"("+b+" "+this.curSym+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return"("+this.curSym+" "+b+")"}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b+" "+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+" "+b+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+this.curSym+b}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.curSym+b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.curSym+" "+b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.curSym+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.curSym+b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+" "+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign+" "+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+this.curSym+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.curSym+this.lc.negative_sign+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.curSym+this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.curSym+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.curSym+" "+this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsInternationalCurrency=function(a,b){if(a=="+"){if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return"("+b+this.currencyCode+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return"("+this.currencyCode+b+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return"("+b+this.intSep+this.currencyCode+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return"("+this.currencyCode+this.intSep+b+")"}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b+this.intSep+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+this.intSep+b+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.currencyCode+b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.intSep+b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.currencyCode+b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign+this.intSep+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.intSep+this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return"("+b+this.currencyCode+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return"("+this.currencyCode+b+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return"("+b+this.intSep+this.currencyCode+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return"("+this.currencyCode+this.intSep+b+")"}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b+this.intSep+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+this.intSep+b+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.currencyCode+b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.intSep+b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.currencyCode+b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign+this.intSep+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.intSep+this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsLocalCurrencyWithNoSym=function(a,b){if(a=="+"){if(this.lc.p_sign_posn===0){return"("+b+")"}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.n_sign_posn===0){return"("+b+")"}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsInternationalCurrencyWithNoSym=function(a,b){if(a=="+"){if(this.lc.int_p_sign_posn===0){return"("+b+")"}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.int_n_sign_posn===0){return"("+b+")"}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC_MONETARY definition"}};jsworld.NumericParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.parse=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=jsworld._trim(a);b=jsworld._stringReplaceAll(a,this.lc.thousands_sep,"");b=jsworld._stringReplaceAll(b,this.lc.decimal_point,".");if(jsworld._isNumber(b))return parseFloat(b,10);else throw"Parse error: Invalid number string"}};jsworld.DateTimeParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance.";this.lc=a;this.parseTime=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.t_fmt,a);var c=false;if(b.hour!==null&&b.minute!==null&&b.second!==null){c=true}else if(b.hourAmPm!==null&&b.am!==null&&b.minute!==null&&b.second!==null){if(b.am){b.hour=parseInt(b.hourAmPm,10)}else{if(b.hourAmPm==12)b.hour=0;else b.hour=parseInt(b.hourAmPm,10)+12}c=true}if(c)return jsworld._zeroPad(b.hour,2)+":"+jsworld._zeroPad(b.minute,2)+":"+jsworld._zeroPad(b.second,2);else throw"Parse error: Invalid/ambiguous time string"};this.parseDate=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.d_fmt,a);var c=false;if(b.year!==null&&b.month!==null&&b.day!==null){c=true}if(c)return jsworld._zeroPad(b.year,4)+"-"+jsworld._zeroPad(b.month,2)+"-"+jsworld._zeroPad(b.day,2);else throw"Parse error: Invalid date string"};this.parseDateTime=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.d_t_fmt,a);var c=false;var d=false;if(b.hour!==null&&b.minute!==null&&b.second!==null){c=true}else if(b.hourAmPm!==null&&b.am!==null&&b.minute!==null&&b.second!==null){if(b.am){b.hour=parseInt(b.hourAmPm,10)}else{if(b.hourAmPm==12)b.hour=0;else b.hour=parseInt(b.hourAmPm,10)+12}c=true}if(b.year!==null&&b.month!==null&&b.day!==null){d=true}if(d&&c)return jsworld._zeroPad(b.year,4)+"-"+jsworld._zeroPad(b.month,2)+"-"+jsworld._zeroPad(b.day,2)+" "+jsworld._zeroPad(b.hour,2)+":"+jsworld._zeroPad(b.minute,2)+":"+jsworld._zeroPad(b.second,2);else throw"Parse error: Invalid/ambiguous date/time string"};this._extractTokens=function(a,b){var c={year:null,month:null,day:null,hour:null,hourAmPm:null,am:null,minute:null,second:null,weekday:null};while(a.length>0){if(a.charAt(0)=="%"&&a.charAt(1)!=""){var d=a.substring(0,2);if(d=="%%"){b=b.substring(1)}else if(d=="%a"){for(var e=0;e<this.lc.abday.length;e++){if(jsworld._stringStartsWith(b,this.lc.abday[e])){c.weekday=e;b=b.substring(this.lc.abday[e].length);break}}if(c.weekday===null)throw"Parse error: Unrecognised abbreviated weekday name (%a)"}else if(d=="%A"){for(var e=0;e<this.lc.day.length;e++){if(jsworld._stringStartsWith(b,this.lc.day[e])){c.weekday=e;b=b.substring(this.lc.day[e].length);break}}if(c.weekday===null)throw"Parse error: Unrecognised weekday name (%A)"}else if(d=="%b"||d=="%h"){for(var e=0;e<this.lc.abmon.length;e++){if(jsworld._stringStartsWith(b,this.lc.abmon[e])){c.month=e+1;b=b.substring(this.lc.abmon[e].length);break}}if(c.month===null)throw"Parse error: Unrecognised abbreviated month name (%b)"}else if(d=="%B"){for(var e=0;e<this.lc.mon.length;e++){if(jsworld._stringStartsWith(b,this.lc.mon[e])){c.month=e+1;b=b.substring(this.lc.mon[e].length);break}}if(c.month===null)throw"Parse error: Unrecognised month name (%B)"}else if(d=="%d"){if(/^0[1-9]|[1-2][0-9]|3[0-1]/.test(b)){c.day=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised day of the month (%d)"}else if(d=="%e"){var f=b.match(/^\s?(\d{1,2})/);c.day=parseInt(f,10);if(isNaN(c.day)||c.day<1||c.day>31)throw"Parse error: Unrecognised day of the month (%e)";b=b.substring(f.length)}else if(d=="%F"){if(/^\d\d\d\d/.test(b)){c.year=parseInt(b.substring(0,4),10);b=b.substring(4)}else{throw"Parse error: Unrecognised date (%F)"}if(jsworld._stringStartsWith(b,"-"))b=b.substring(1);else throw"Parse error: Unrecognised date (%F)";if(/^0[1-9]|1[0-2]/.test(b)){c.month=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised date (%F)";if(jsworld._stringStartsWith(b,"-"))b=b.substring(1);else throw"Parse error: Unrecognised date (%F)";if(/^0[1-9]|[1-2][0-9]|3[0-1]/.test(b)){c.day=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised date (%F)"}else if(d=="%H"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised hour (%H)"}else if(d=="%I"){if(/^0[1-9]|1[0-2]/.test(b)){c.hourAmPm=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised hour (%I)"}else if(d=="%k"){var g=b.match(/^(\d{1,2})/);c.hour=parseInt(g,10);if(isNaN(c.hour)||c.hour<0||c.hour>23)throw"Parse error: Unrecognised hour (%k)";b=b.substring(g.length)}else if(d=="%l"){var g=b.match(/^(\d{1,2})/);c.hourAmPm=parseInt(g,10);if(isNaN(c.hourAmPm)||c.hourAmPm<1||c.hourAmPm>12)throw"Parse error: Unrecognised hour (%l)";b=b.substring(g.length)}else if(d=="%m"){if(/^0[1-9]|1[0-2]/.test(b)){c.month=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised month (%m)"}else if(d=="%M"){if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised minute (%M)"}else if(d=="%n"){if(b.charAt(0)=="\n")b=b.substring(1);else throw"Parse error: Unrecognised new line (%n)"}else if(d=="%p"){if(jsworld._stringStartsWith(b,this.lc.am)){c.am=true;b=b.substring(this.lc.am.length)}else if(jsworld._stringStartsWith(b,this.lc.pm)){c.am=false;b=b.substring(this.lc.pm.length)}else throw"Parse error: Unrecognised AM/PM value (%p)"}else if(d=="%P"){if(jsworld._stringStartsWith(b,this.lc.am.toLowerCase())){c.am=true;b=b.substring(this.lc.am.length)}else if(jsworld._stringStartsWith(b,this.lc.pm.toLowerCase())){c.am=false;b=b.substring(this.lc.pm.length)}else throw"Parse error: Unrecognised AM/PM value (%P)"}else if(d=="%R"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%R)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%R)";if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%R)"}else if(d=="%S"){if(/^[0-5][0-9]/.test(b)){c.second=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised second (%S)"}else if(d=="%T"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%T)";if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%T)";if(/^[0-5][0-9]/.test(b)){c.second=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)"}else if(d=="%w"){if(/^\d/.test(b)){c.weekday=parseInt(b.substring(0,1),10);b=b.substring(1)}else throw"Parse error: Unrecognised weekday number (%w)"}else if(d=="%y"){if(/^\d\d/.test(b)){var h=parseInt(b.substring(0,2),10);if(h>50)c.year=1900+h;else c.year=2e3+h;b=b.substring(2)}else throw"Parse error: Unrecognised year (%y)"}else if(d=="%Y"){if(/^\d\d\d\d/.test(b)){c.year=parseInt(b.substring(0,4),10);b=b.substring(4)}else throw"Parse error: Unrecognised year (%Y)"}else if(d=="%Z"){if(a.length===0)break}a=a.substring(2)}else{if(a.charAt(0)!=b.charAt(0))throw'Parse error: Unexpected symbol "'+b.charAt(0)+'" in date/time string';a=a.substring(1);b=b.substring(1)}}return c}};jsworld.MonetaryParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.parse=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._detectCurrencySymbolType(a);var c,d;if(b=="local"){c="local";d=a.replace(this.lc.getCurrencySymbol(),"")}else if(b=="int"){c="int";d=a.replace(this.lc.getIntCurrencySymbol(),"")}else if(b=="none"){c="local";d=a}else throw"Parse error: Internal assert failure";d=jsworld._stringReplaceAll(d,this.lc.mon_thousands_sep,"");d=d.replace(this.lc.mon_decimal_point,".");d=d.replace(/\s*/g,"");d=this._removeLocalNonNegativeSign(d,c);d=this._normaliseNegativeSign(d,c);if(jsworld._isNumber(d))return parseFloat(d,10);else throw"Parse error: Invalid currency amount string"};this._detectCurrencySymbolType=function(a){if(this.lc.getCurrencySymbol().length>this.lc.getIntCurrencySymbol().length){if(a.indexOf(this.lc.getCurrencySymbol())!=-1)return"local";else if(a.indexOf(this.lc.getIntCurrencySymbol())!=-1)return"int";else return"none"}else{if(a.indexOf(this.lc.getIntCurrencySymbol())!=-1)return"int";else if(a.indexOf(this.lc.getCurrencySymbol())!=-1)return"local";else return"none"}};this._removeLocalNonNegativeSign=function(a,b){a=a.replace(this.lc.positive_sign,"");if((b=="local"&&this.lc.p_sign_posn===0||b=="int"&&this.lc.int_p_sign_posn===0)&&/\(\d+\.?\d*\)/.test(a)){a=a.replace("(","");a=a.replace(")","")}return a};this._normaliseNegativeSign=function(a,b){a=a.replace(this.lc.negative_sign,"-");if(b=="local"&&this.lc.n_sign_posn===0||b=="int"&&this.lc.int_n_sign_posn===0){if(/^\(\d+\.?\d*\)$/.test(a)){a=a.replace("(","");a=a.replace(")","");return"-"+a}}if(b=="local"&&this.lc.n_sign_posn==2||b=="int"&&this.lc.int_n_sign_posn==2){if(/^\d+\.?\d*-$/.test(a)){a=a.replace("-","");return"-"+a}}if(b=="local"&&this.lc.n_cs_precedes===0&&this.lc.n_sign_posn==3||b=="local"&&this.lc.n_cs_precedes===0&&this.lc.n_sign_posn==4||b=="int"&&this.lc.int_n_cs_precedes===0&&this.lc.int_n_sign_posn==3||b=="int"&&this.lc.int_n_cs_precedes===0&&this.lc.int_n_sign_posn==4){if(/^\d+\.?\d*-$/.test(a)){a=a.replace("-","");return"-"+a}}return a}}
if(typeof POSIX_LC == "undefined") var POSIX_LC = {};
POSIX_LC.en_US = {
"decimal_point" : ".",
"thousands_sep" : ",",
"grouping" : "3",
"abday" : ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
"day" : ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"abmon" : ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
"mon" : ["January","February","March","April","May","June","July","August","September","October","November","December"],
"d_fmt" : "%m/%e/%y",
"t_fmt" : "%I:%M:%S %p",
"d_t_fmt" : "%B %e, %Y %I:%M:%S %p %Z",
"am_pm" : ["AM","PM"],
"int_curr_symbol" : "USD ",
"currency_symbol" : "\u0024",
"mon_decimal_point" : ".",
"mon_thousands_sep" : ",",
"mon_grouping" : "3",
"positive_sign" : "",
"negative_sign" : "-",
"int_frac_digits" : 2,
"frac_digits" : 2,
"p_cs_precedes" : 1,
"n_cs_precedes" : 1,
"p_sep_by_space" : 0,
"n_sep_by_space" : 0,
"p_sign_posn" : 1,
"n_sign_posn" : 1,
"int_p_cs_precedes" : 1,
"int_n_cs_precedes" : 1,
"int_p_sep_by_space" : 0,
"int_n_sep_by_space" : 0,
"int_p_sign_posn" : 1,
"int_n_sign_posn" : 1
}
if(typeof POSIX_LC == "undefined") var POSIX_LC = {};
POSIX_LC.fr_FR = {
"decimal_point" : ",",
"thousands_sep" : "\u00a0",
"grouping" : "3",
"abday" : ["dim.","lun.","mar.",
"mer.","jeu.","ven.",
"sam."],
"day" : ["dimanche","lundi","mardi",
"mercredi","jeudi","vendredi",
"samedi"],
"abmon" : ["janv.","f\u00e9vr.","mars",
"avr.","mai","juin",
"juil.","ao\u00fbt","sept.",
"oct.","nov.","d\u00e9c."],
"mon" : ["janvier","f\u00e9vrier","mars",
"avril","mai","juin",
"juillet","ao\u00fbt","septembre",
"octobre","novembre","d\u00e9cembre"],
"d_fmt" : "%d/%m/%y",
"t_fmt" : "%H:%M:%S",
"d_t_fmt" : "%e %B %Y %H:%M:%S %Z",
"am_pm" : ["AM","PM"],
"int_curr_symbol" : "EUR ",
"currency_symbol" : "\u20ac",
"mon_decimal_point" : ",",
"mon_thousands_sep" : "\u00a0",
"mon_grouping" : "3",
"positive_sign" : "",
"negative_sign" : "-",
"int_frac_digits" : 2,
"frac_digits" : 2,
"p_cs_precedes" : 0,
"n_cs_precedes" : 0,
"p_sep_by_space" : 1,
"n_sep_by_space" : 1,
"p_sign_posn" : 1,
"n_sign_posn" : 1,
"int_p_cs_precedes" : 0,
"int_n_cs_precedes" : 0,
"int_p_sep_by_space" : 1,
"int_n_sep_by_space" : 1,
"int_p_sign_posn" : 1,
"int_n_sign_posn" : 1
};
/** https://github.com/csnover/js-iso8601 */(function(n,f){var u=n.parse,c=[1,4,5,6,7,10,11];n.parse=function(t){var i,o,a=0;if(o=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(t)){for(var v=0,r;r=c[v];++v)o[r]=+o[r]||0;o[2]=(+o[2]||1)-1,o[3]=+o[3]||1,o[8]!=="Z"&&o[9]!==f&&(a=o[10]*60+o[11],o[9]==="+"&&(a=0-a)),i=n.UTC(o[1],o[2],o[3],o[4],o[5]+a,o[6],o[7])}else i=u?u(t):NaN;return i}})(Date)
/*!
* geo-location-javascript v0.4.3
* http://code.google.com/p/geo-location-javascript/
*
* Copyright (c) 2009 Stan Wiechers
* Licensed under the MIT licenses.
*
* Revision: $Rev: 68 $:
* Author: $Author: whoisstan $:
* Date: $Date: 2010-02-15 13:42:19 +0100 (Mon, 15 Feb 2010) $:
*/
var geo_position_js=function() {
var pub = {};
var provider=null;
pub.getCurrentPosition = function(successCallback,errorCallback,options)
{
provider.getCurrentPosition(successCallback, errorCallback,options);
}
pub.init = function()
{
try
{
if (typeof(geo_position_js_simulator)!="undefined")
{
provider=geo_position_js_simulator;
}
else if (typeof(bondi)!="undefined" && typeof(bondi.geolocation)!="undefined")
{
provider=bondi.geolocation;
}
else if (typeof(navigator.geolocation)!="undefined")
{
provider=navigator.geolocation;
pub.getCurrentPosition = function(successCallback, errorCallback, options)
{
function _successCallback(p)
{
//for mozilla geode,it returns the coordinates slightly differently
if(typeof(p.latitude)!="undefined")
{
successCallback({timestamp:p.timestamp, coords: {latitude:p.latitude,longitude:p.longitude}});
}
else
{
successCallback(p);
}
}
provider.getCurrentPosition(_successCallback,errorCallback,options);
}
}
else if(typeof(window.google)!="undefined" && typeof(google.gears)!="undefined")
{
provider=google.gears.factory.create('beta.geolocation');
}
else if ( typeof(Mojo) !="undefined" && typeof(Mojo.Service.Request)!="Mojo.Service.Request")
{
provider=true;
pub.getCurrentPosition = function(successCallback, errorCallback, options)
{
parameters={};
if(options)
{
//http://developer.palm.com/index.php?option=com_content&view=article&id=1673#GPS-getCurrentPosition
if (options.enableHighAccuracy && options.enableHighAccuracy==true)
{
parameters.accuracy=1;
}
if (options.maximumAge)
{
parameters.maximumAge=options.maximumAge;
}
if (options.responseTime)
{
if(options.responseTime<5)
{
parameters.responseTime=1;
}
else if (options.responseTime<20)
{
parameters.responseTime=2;
}
else
{
parameters.timeout=3;
}
}
}
r=new Mojo.Service.Request('palm://com.palm.location', {
method:"getCurrentPosition",
parameters:parameters,
onSuccess: function(p){successCallback({timestamp:p.timestamp, coords: {latitude:p.latitude, longitude:p.longitude,heading:p.heading}});},
onFailure: function(e){
if (e.errorCode==1)
{
errorCallback({code:3,message:"Timeout"});
}
else if (e.errorCode==2)
{
errorCallback({code:2,message:"Position Unavailable"});
}
else
{
errorCallback({code:0,message:"Unknown Error: webOS-code"+errorCode});
}
}
});
}
}
else if (typeof(device)!="undefined" && typeof(device.getServiceObject)!="undefined")
{
provider=device.getServiceObject("Service.Location", "ILocation");
//override default method implementation
pub.getCurrentPosition = function(successCallback, errorCallback, options)
{
function callback(transId, eventCode, result) {
if (eventCode == 4)
{
errorCallback({message:"Position unavailable", code:2});
}
else
{
//no timestamp of location given?
successCallback({timestamp:null, coords: {latitude:result.ReturnValue.Latitude, longitude:result.ReturnValue.Longitude, altitude:result.ReturnValue.Altitude,heading:result.ReturnValue.Heading}});
}
}
//location criteria
var criteria = new Object();
criteria.LocationInformationClass = "BasicLocationInformation";
//make the call
provider.ILocation.GetLocation(criteria,callback);
}
}
}
catch (e){
alert("error="+e);
if(typeof(console)!="undefined")
{
console.log(e);
}
return false;
}
return provider!=null;
}
return pub;
}();
// Couldn't get unminified version to work , go here for docs => https://github.com/iamnoah/writeCapture
(function(E,a){var j=a.document;function A(Q){var Z=j.createElement("div");j.body.insertBefore(Z,null);E.replaceWith(Z,'<script type="text/javascript">'+Q+"<\/script>")}E=E||(function(Q){return{ajax:Q.ajax,$:function(Z){return Q(Z)[0]},replaceWith:function(Z,ad){var ac=Q(Z)[0];var ab=ac.nextSibling,aa=ac.parentNode;Q(ac).remove();if(ab){Q(ab).before(ad)}else{Q(aa).append(ad)}},onLoad:function(Z){Q(Z)},copyAttrs:function(af,ab){var ad=Q(ab),aa=af.attributes;for(var ac=0,Z=aa.length;ac<Z;ac++){if(aa[ac]&&aa[ac].value){try{ad.attr(aa[ac].name,aa[ac].value)}catch(ae){}}}}}})(a.jQuery);E.copyAttrs=E.copyAttrs||function(){};E.onLoad=E.onLoad||function(){throw"error: autoAsync cannot be used without jQuery or defining writeCaptureSupport.onLoad"};function P(ab,aa){for(var Z=0,Q=ab.length;Z<Q;Z++){if(aa(ab[Z])===false){return}}}function v(Q){return Object.prototype.toString.call(Q)==="[object Function]"}function p(Q){return Object.prototype.toString.call(Q)==="[object String]"}function u(aa,Z,Q){return Array.prototype.slice.call(aa,Z||0,Q||aa&&aa.length)}function D(ab,aa){var Q=false;P(ab,Z);function Z(ac){return !(Q=aa(ac))}return Q}function L(Q){this._queue=[];this._children=[];this._parent=Q;if(Q){Q._addChild(this)}}L.prototype={_addChild:function(Q){this._children.push(Q)},push:function(Q){this._queue.push(Q);this._bubble("_doRun")},pause:function(){this._bubble("_doPause")},resume:function(){this._bubble("_doResume")},_bubble:function(Z){var Q=this;while(!Q[Z]){Q=Q._parent}return Q[Z]()},_next:function(){if(D(this._children,Q)){return true}function Q(aa){return aa._next()}var Z=this._queue.shift();if(Z){Z()}return !!Z}};function i(Q){if(Q){return new L(Q)}L.call(this);this.paused=0}i.prototype=(function(){function Q(){}Q.prototype=L.prototype;return new Q()})();i.prototype._doRun=function(){if(!this.running){this.running=true;try{while(this.paused<1&&this._next()){}}finally{this.running=false}}};i.prototype._doPause=function(){this.paused++};i.prototype._doResume=function(){this.paused--;this._doRun()};function M(){}M.prototype={_html:"",open:function(){this._opened=true;if(this._delegate){this._delegate.open()}},write:function(Q){if(this._closed){return}this._written=true;if(this._delegate){this._delegate.write(Q)}else{this._html+=Q}},writeln:function(Q){this.write(Q+"\n")},close:function(){this._closed=true;if(this._delegate){this._delegate.close()}},copyTo:function(Q){this._delegate=Q;Q.foobar=true;if(this._opened){Q.open()}if(this._written){Q.write(this._html)}if(this._closed){Q.close()}}};var e=(function(){var Q={f:j.getElementById};try{Q.f.call(j,"abc");return true}catch(Z){return false}})();function I(Q){P(Q,function(Z){var aa=j.getElementById(Z.id);if(!aa){l("<proxyGetElementById - finish>","no element in writen markup with id "+Z.id);return}P(Z.el.childNodes,function(ab){aa.appendChild(ab)});if(aa.contentWindow){a.setTimeout(function(){Z.el.contentWindow.document.copyTo(aa.contentWindow.document)},1)}E.copyAttrs(Z.el,aa)})}function s(Z,Q){if(Q&&Q[Z]===false){return false}return Q&&Q[Z]||o[Z]}function x(Z,ai){var ae=[],ad=s("proxyGetElementById",ai),ag=s("writeOnGetElementById",ai),Q={write:j.write,writeln:j.writeln,finish:function(){},out:""};Z.state=Q;j.write=ah;j.writeln=aa;if(ad||ag){Q.getEl=j.getElementById;j.getElementById=ab;if(ag){findEl=af}else{findEl=ac;Q.finish=function(){I(ae)}}}function ah(aj){Q.out+=aj}function aa(aj){Q.out+=aj+"\n"}function ac(ak){var aj=j.createElement("div");ae.push({id:ak,el:aj});aj.contentWindow={document:new M()};return aj}function af(al){var aj=E.$(Z.target);var ak=j.createElement("div");aj.parentNode.insertBefore(ak,aj);E.replaceWith(ak,Q.out);Q.out="";return e?Q.getEl.call(j,al):Q.getEl(al)}function ab(ak){var aj=e?Q.getEl.call(j,ak):Q.getEl(ak);return aj||findEl(ak)}return Q}function V(Q){j.write=Q.write;j.writeln=Q.writeln;if(Q.getEl){j.getElementById=Q.getEl}return Q.out}function N(Q){return Q&&Q.replace(/^\s*<!(\[CDATA\[|--)/,"").replace(/(\]\]|--)>\s*$/,"")}function b(){}function d(Z,Q){console.error("Error",Q,"executing code:",Z)}var l=v(a.console&&console.error)?d:b;function S(aa,Z,Q){var ab=x(Z,Q);try{A(N(aa))}catch(ac){l(aa,ac)}finally{V(ab)}return ab}function O(Z){var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(Z);return Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)}function T(Q){return new RegExp(Q+"=(?:([\"'])([\\s\\S]*?)\\1|([^\\s>]+))","i")}function k(Q){var Z=T(Q);return function(aa){var ab=Z.exec(aa)||[];return ab[2]||ab[3]}}var r=/(<script[\s\S]*?>)([\s\S]*?)<\/script>/ig,n=T("src"),X=k("src"),q=k("type"),Y=k("language"),C="__document_write_ajax_callbacks__",B="__document_write_ajax_div-",g="window['"+C+"']['%d']();",m=a[C]={},w='<script type="text/javascript">'+g+"<\/script>",H=0;function c(){return(++H).toString()}function G(Z,aa){var Q;if(v(Z)){Q=Z;Z=null}Z=Z||{};Q=Q||Z&&Z.done;Z.done=aa?function(){aa(Q)}:Q;return Z}var z=new i();var y=[];var f=window._debugWriteCapture?function(){}:function(Q,aa,Z){y.push({type:Q,src:aa,data:Z})};var K=window._debugWriteCapture?function(){}:function(){y.push(arguments)};function W(Q){var Z=c();m[Z]=function(){Q();delete m[Z]};return Z}function J(Q){return w.replace(/%d/,W(Q))}function R(ac,ag,aa,ae){var ad=aa&&new i(aa)||z;ag=G(ag);var ab=s("done",ag);var Q="";var Z=s("fixUrls",ag);if(!v(Z)){Z=function(ah){return ah}}if(v(ab)){Q=J(function(){ad.push(ab)})}return ac.replace(r,af)+Q;function af(aj,av,ai){var an=X(av),am=q(av)||"",aB=Y(av)||"",aA=(!am&&!aB)||am.toLowerCase().indexOf("javascript")!==-1||aB.toLowerCase().indexOf("javascript")!==-1;f("replace",an,aj);if(!aA){return aj}var aw=W(ap),ao=B+aw,au,al={target:"#"+ao,parent:ae};function ap(){ad.push(au)}if(an){an=Z(an);av=av.replace(n,"");if(O(an)){au=az}else{if(s("asyncAll",ag)){au=ay()}else{au=at}}}else{au=ax}function ax(){ah(ai)}function at(){E.ajax({url:an,type:"GET",dataType:"text",async:false,success:function(aC){ah(aC)}})}function ak(aE,aC,aD){l("<XHR for "+an+">",aD);ad.resume()}function aq(){return J(function(){ad.resume()})}function ay(){var aE,aD;function aC(aG,aF){if(!aE){aD=aG;return}try{ah(aG,aq())}catch(aH){l(aG,aH)}}E.ajax({url:an,type:"GET",dataType:"text",async:true,success:aC,error:ak});return function(){aE=true;if(aD){ah(aD)}else{ad.pause()}}}function az(aC){var aE=x(al,ag);ad.pause();f("pause",an);E.ajax({url:an,type:"GET",dataType:"script",success:aD,error:ak});function aD(aH,aG,aF){f("out",an,aE.out);ar(V(aE),J(aE.finish)+aq());f("resume",an)}}function ah(aD,aC){var aE=S(aD,al,ag);aC=J(aE.finish)+(aC||"");ar(aE.out,aC)}function ar(aD,aC){E.replaceWith(al.target,R(aD,null,ad,al)+(aC||""))}return'<div style="display: none" id="'+ao+'"></div>'+av+g.replace(/%d/,aw)+"<\/script>"}}function F(Z,aa){var Q=z;P(Z,function(ab){Q.push(ac);function ac(){ab.action(R(ab.html,ab.options,Q),ab)}});if(aa){Q.push(aa)}}function U(Q){var Z=Q;while(Z&&Z.nodeType===1){Q=Z;Z=Z.lastChild;while(Z&&Z.nodeType!==1){Z=Z.previousSibling}}return Q}function h(Q){var aa=j.write,ad=j.writeln,Z,ab=[];j.writeln=function(ae){j.write(ae+"\n")};var ac;j.write=function(af){var ae=U(j.body);if(ae!==Z){Z=ae;ab.push(ac={el:ae,out:[]})}ac.out.push(af)};E.onLoad(function(){var ah,ak,af,aj,ai;Q=G(Q);ai=Q.done;Q.done=function(){j.write=aa;j.writeln=ad;if(ai){ai()}};for(var ag=0,ae=ab.length;ag<ae;ag++){ah=ab[ag].el;ak=j.createElement("div");ah.parentNode.insertBefore(ak,ah.nextSibling);af=ab[ag].out.join("");aj=ae-ag===1?R(af,Q):R(af);E.replaceWith(ak,aj)}})}var t="writeCapture";var o=a[t]={_original:a[t],fixUrls:function(Q){return Q.replace(/&/g,"&")},noConflict:function(){a[t]=this._original;return this},debug:y,proxyGetElementById:false,_forTest:{Q:i,GLOBAL_Q:z,$:E,matchAttr:k,slice:u,capture:x,uncapture:V,captureWrite:S},replaceWith:function(Q,aa,Z){E.replaceWith(Q,R(aa,Z))},html:function(Q,ab,Z){var aa=E.$(Q);aa.innerHTML="<span/>";E.replaceWith(aa.firstChild,R(ab,Z))},load:function(Q,aa,Z){E.ajax({url:aa,dataType:"text",type:"GET",success:function(ab){o.html(Q,ab,Z)}})},autoAsync:h,sanitize:R,sanitizeSerial:F}})(this.writeCaptureSupport,this);(function(g,d,n){var c={html:h};g.each(["append","prepend","after","before","wrap","wrapAll","replaceWith","wrapInner"],function(){c[this]=i(this)});function a(q){return Object.prototype.toString.call(q)=="[object String]"}function p(u,t,s,r){if(arguments.length==0){return o.call(this)}var q=c[u];if(u=="load"){return l.call(this,t,s,r)}if(!q){j(u)}return b.call(this,t,s,q)}g.fn.writeCapture=p;var k="__writeCaptureJsProxied-fghebd__";function o(){if(this[k]){return this}var r=this;function q(){var t=this,s=false;this[k]=true;g.each(c,function(v){var u=r[v];if(!u){return}t[v]=function(y,x,w){if(!s&&a(y)){try{s=true;return p.call(t,v,y,x,w)}finally{s=false}}return u.apply(t,arguments)}});this.pushStack=function(){return o.call(r.pushStack.apply(t,arguments))};this.endCapture=function(){return r}}q.prototype=r;return new q()}function b(t,s,u){var q,r=this;if(s&&s.done){q=s.done;delete s.done}else{if(g.isFunction(s)){q=s;s=null}}d.sanitizeSerial(g.map(this,function(v){return{html:t,options:s,action:function(w){u.call(v,w)}}}),q&&function(){q.call(r)}||q);return this}function h(q){g(this).html(q)}function i(q){return function(r){g(this)[q](r)}}function l(t,s,v){var r=this,q,u=t.indexOf(" ");if(u>=0){q=t.slice(u,t.length);t=t.slice(0,u)}if(g.isFunction(v)){s=s||{};s.done=v}return g.ajax({url:t,type:s&&s.type||"GET",dataType:"html",data:s&&s.params,complete:f(r,s,q)})}function f(r,s,q){return function(u,t){if(t=="success"||t=="notmodified"){var v=m(u.responseText,q);b.call(r,v,s,h)}}}var e=/jquery-writeCapture-script-placeholder-(\d+)-wc/g;function m(s,r){if(!r||!s){return s}var t=0,q={};return g("<div/>").append(s.replace(/<script(.|\s)*?\/script>/g,function(u){q[t]=u;return"jquery-writeCapture-script-placeholder-"+(t++)+"-wc"})).find(r).html().replace(e,function(u,v){return q[v]})}function j(q){throw"invalid method parameter "+q}g.writeCapture=d})(jQuery,writeCapture.noConflict());
/*!
* Amplify Store - Persistent Client-Side Storage 1.0.0
*
* Copyright 2011 appendTo LLC. (http://appendto.com/team)
* Dual licensed under the MIT or GPL licenses.
* http://appendto.com/open-source-licenses
*
* http://amplifyjs.com
*/
(function( amplify, undefined ) {
var store = amplify.store = function( key, value, options, type ) {
var type = store.type;
if ( options && options.type && options.type in store.types ) {
type = options.type;
}
return store.types[ type ]( key, value, options || {} );
};
store.types = {};
store.type = null;
store.addType = function( type, storage ) {
if ( !store.type ) {
store.type = type;
}
store.types[ type ] = storage;
store[ type ] = function( key, value, options ) {
options = options || {};
options.type = type;
return store( key, value, options );
};
}
store.error = function() {
return "amplify.store quota exceeded";
};
var rprefix = /^__amplify__/;
function createFromStorageInterface( storageType, storage ) {
store.addType( storageType, function( key, value, options ) {
var storedValue, parsed, i, remove,
ret = value,
now = (new Date()).getTime();
if ( !key ) {
ret = {};
remove = [];
i = 0;
try {
// accessing the length property works around a localStorage bug
// in Firefox 4.0 where the keys don't update cross-page
// we assign to key just to avoid Closure Compiler from removing
// the access as "useless code"
// https://bugzilla.mozilla.org/show_bug.cgi?id=662511
key = storage.length;
while ( key = storage.key( i++ ) ) {
if ( rprefix.test( key ) ) {
parsed = JSON.parse( storage.getItem( key ) );
if ( parsed.expires && parsed.expires <= now ) {
remove.push( key );
} else {
ret[ key.replace( rprefix, "" ) ] = parsed.data;
}
}
}
while ( key = remove.pop() ) {
storage.removeItem( key );
}
} catch ( error ) {}
return ret;
}
// protect against name collisions with direct storage
key = "__amplify__" + key;
if ( value === undefined ) {
storedValue = storage.getItem( key );
parsed = storedValue ? JSON.parse( storedValue ) : { expires: -1 };
if ( parsed.expires && parsed.expires <= now ) {
storage.removeItem( key );
} else {
return parsed.data;
}
} else {
if ( value === null ) {
storage.removeItem( key );
} else {
parsed = JSON.stringify({
data: value,
expires: options.expires ? now + options.expires : null
});
try {
storage.setItem( key, parsed );
// quota exceeded
} catch( error ) {
// expire old data and try again
store[ storageType ]();
try {
storage.setItem( key, parsed );
} catch( error ) {
throw store.error();
}
}
}
}
return ret;
});
}
// localStorage + sessionStorage
// IE 8+, Firefox 3.5+, Safari 4+, Chrome 4+, Opera 10.5+, iPhone 2+, Android 2+
for ( var webStorageType in { localStorage: 1, sessionStorage: 1 } ) {
// try/catch for file protocol in Firefox
try {
if ( window[ webStorageType ].getItem ) {
createFromStorageInterface( webStorageType, window[ webStorageType ] );
}
} catch( e ) {}
}
// globalStorage
// non-standard: Firefox 2+
// https://developer.mozilla.org/en/dom/storage#globalStorage
if ( window.globalStorage ) {
// try/catch for file protocol in Firefox
try {
createFromStorageInterface( "globalStorage",
window.globalStorage[ window.location.hostname ] );
// Firefox 2.0 and 3.0 have sessionStorage and globalStorage
// make sure we default to globalStorage
// but don't default to globalStorage in 3.5+ which also has localStorage
if ( store.type === "sessionStorage" ) {
store.type = "globalStorage";
}
} catch( e ) {}
}
// userData
// non-standard: IE 5+
// http://msdn.microsoft.com/en-us/library/ms531424(v=vs.85).aspx
(function() {
// IE 9 has quirks in userData that are a huge pain
// rather than finding a way to detect these quirks
// we just don't register userData if we have localStorage
if ( store.types.localStorage ) {
return;
}
// append to html instead of body so we can do this from the head
var div = document.createElement( "div" ),
attrKey = "amplify";
div.style.display = "none";
document.getElementsByTagName( "head" )[ 0 ].appendChild( div );
if ( div.addBehavior ) {
div.addBehavior( "#default#userdata" );
store.addType( "userData", function( key, value, options ) {
div.load( attrKey );
var attr, parsed, prevValue, i, remove,
ret = value,
now = (new Date()).getTime();
if ( !key ) {
ret = {};
remove = [];
i = 0;
while ( attr = div.XMLDocument.documentElement.attributes[ i++ ] ) {
parsed = JSON.parse( attr.value );
if ( parsed.expires && parsed.expires <= now ) {
remove.push( attr.name );
} else {
ret[ attr.name ] = parsed.data;
}
}
while ( key = remove.pop() ) {
div.removeAttribute( key );
}
div.save( attrKey );
return ret;
}
// convert invalid characters to dashes
// http://www.w3.org/TR/REC-xml/#NT-Name
// simplified to assume the starting character is valid
// also removed colon as it is invalid in HTML attribute names
//key = key.replace( /[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g, "-" );
if ( value === undefined ) {
attr = div.getAttribute( key );
parsed = attr ? JSON.parse( attr ) : { expires: -1 };
if ( parsed.expires && parsed.expires <= now ) {
div.removeAttribute( key );
} else {
return parsed.data;
}
} else {
if ( value === null ) {
div.removeAttribute( key );
} else {
// we need to get the previous value in case we need to rollback
prevValue = div.getAttribute( key );
parsed = JSON.stringify({
data: value,
expires: (options.expires ? (now + options.expires) : null)
});
div.setAttribute( key, parsed );
}
}
try {
div.save( attrKey );
// quota exceeded
} catch ( error ) {
// roll the value back to the previous value
if ( prevValue === null ) {
div.removeAttribute( key );
} else {
div.setAttribute( key, prevValue );
}
// expire old data and try again
store.userData();
try {
div.setAttribute( key, parsed );
div.save( attrKey );
} catch ( error ) {
// roll the value back to the previous value
if ( prevValue === null ) {
div.removeAttribute( key );
} else {
div.setAttribute( key, prevValue );
}
throw store.error();
}
}
return ret;
});
}
}() );
// in-memory storage
// fallback for all browsers to enable the API even if we can't persist data
(function() {
var memory = {};
function copy( obj ) {
return obj === undefined ? undefined : JSON.parse( JSON.stringify( obj ) );
}
store.addType( "memory", function( key, value, options ) {
if ( !key ) {
return copy( memory );
}
if ( value === undefined ) {
return copy( memory[ key ] );
}
if ( value === null ) {
delete memory[ key ];
return null;
}
memory[ key ] = value;
if ( options.expires ) {
setTimeout(function() {
delete memory[ key ];
}, options.expires );
}
return value;
});
}() );
}( this.amplify = this.amplify || {} ) );
/*!
* Modernizr v2.0.6
* http://www.modernizr.com
*
* Copyright (c) 2009-2011 Faruk Ates, Paul Irish, Alex Sexton
* Dual-licensed under the BSD or MIT licenses: www.modernizr.com/license/
*/
/*
* Modernizr tests which native CSS3 and HTML5 features are available in
* the current UA and makes the results available to you in two ways:
* as properties on a global Modernizr object, and as classes on the
* <html> element. This information allows you to progressively enhance
* your pages with a granular level of control over the experience.
*
* Modernizr has an optional (not included) conditional resource loader
* called Modernizr.load(), based on Yepnope.js (yepnopejs.com).
* To get a build that includes Modernizr.load(), as well as choosing
* which tests to include, go to www.modernizr.com/download/
*
* Authors Faruk Ates, Paul Irish, Alex Sexton,
* Contributors Ryan Seddon, Ben Alman
*/
window.Modernizr = (function( window, document, undefined ) {
var version = '2.0.6',
Modernizr = {},
// option for enabling the HTML classes to be added
enableClasses = true,
docElement = document.documentElement,
docHead = document.head || document.getElementsByTagName('head')[0],
/**
* Create our "modernizr" element that we do most feature tests on.
*/
mod = 'modernizr',
modElem = document.createElement(mod),
mStyle = modElem.style,
/**
* Create the input element for various Web Forms feature tests.
*/
inputElem = document.createElement('input'),
smile = ':)',
toString = Object.prototype.toString,
// List of property values to set for css tests. See ticket #21
prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' '),
// Following spec is to expose vendor-specific style properties as:
// elem.style.WebkitBorderRadius
// and the following would be incorrect:
// elem.style.webkitBorderRadius
// Webkit ghosts their properties in lowercase but Opera & Moz do not.
// Microsoft foregoes prefixes entirely <= IE8, but appears to
// use a lowercase `ms` instead of the correct `Ms` in IE9
// More here: http://github.com/Modernizr/Modernizr/issues/issue/21
domPrefixes = 'Webkit Moz O ms Khtml'.split(' '),
ns = {'svg': 'http://www.w3.org/2000/svg'},
tests = {},
inputs = {},
attrs = {},
classes = [],
featureName, // used in testing loop
// Inject element with style element and some CSS rules
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node,
div = document.createElement('div');
if ( parseInt(nodes, 10) ) {
// In order not to give false positives we create a node for each test
// This also allows the method to scale for unspecified uses
while ( nodes-- ) {
node = document.createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
}
}
// <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed
// when injected with innerHTML. To get around this you need to prepend the 'NoScope' element
// with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements.
// http://msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx
style = ['­', '<style>', rule, '</style>'].join('');
div.id = mod;
div.innerHTML += style;
docElement.appendChild(div);
ret = callback(div, rule);
div.parentNode.removeChild(div);
return !!ret;
},
// adapted from matchMedia polyfill
// by Scott Jehl and Paul Irish
// gist.github.com/786768
testMediaQuery = function( mq ) {
if ( window.matchMedia ) {
return matchMedia(mq).matches;
}
var bool;
injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
bool = (window.getComputedStyle ?
getComputedStyle(node, null) :
node.currentStyle)['position'] == 'absolute';
});
return bool;
},
/**
* isEventSupported determines if a given element supports the given event
* function from http://yura.thinkweb2.com/isEventSupported/
*/
isEventSupported = (function() {
var TAGNAMES = {
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
'error': 'img', 'load': 'img', 'abort': 'img'
};
function isEventSupported( eventName, element ) {
element = element || document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
// When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those
var isSupported = eventName in element;
if ( !isSupported ) {
// If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element
if ( !element.setAttribute ) {
element = document.createElement('div');
}
if ( element.setAttribute && element.removeAttribute ) {
element.setAttribute(eventName, '');
isSupported = is(element[eventName], 'function');
// If property was created, "remove it" (by setting value to `undefined`)
if ( !is(element[eventName], undefined) ) {
element[eventName] = undefined;
}
element.removeAttribute(eventName);
}
}
element = null;
return isSupported;
}
return isEventSupported;
})();
// hasOwnProperty shim by kangax needed for Safari 2.0 support
var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty;
if ( !is(_hasOwnProperty, undefined) && !is(_hasOwnProperty.call, undefined) ) {
hasOwnProperty = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
return ((property in object) && is(object.constructor.prototype[property], undefined));
};
}
/**
* setCss applies given styles to the Modernizr DOM node.
*/
function setCss( str ) {
mStyle.cssText = str;
}
/**
* setCssAll extrapolates all vendor-specific css strings.
*/
function setCssAll( str1, str2 ) {
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
}
/**
* is returns a boolean for if typeof obj is exactly type.
*/
function is( obj, type ) {
return typeof obj === type;
}
/**
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
}
/**
* testProps is a generic CSS / DOM property test; if a browser supports
* a certain property, it won't return undefined for it.
* A supported CSS property returns empty string when its not yet set.
*/
function testProps( props, prefixed ) {
for ( var i in props ) {
if ( mStyle[ props[i] ] !== undefined ) {
return prefixed == 'pfx' ? props[i] : true;
}
}
return false;
}
/**
* testPropsAll tests a list of DOM properties we want to check against.
* We specify literally ALL possible (known and/or likely) properties on
* the element including the non-vendor prefixed one, for forward-
* compatibility.
*/
function testPropsAll( prop, prefixed ) {
var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1),
props = (prop + ' ' + domPrefixes.join(ucProp + ' ') + ucProp).split(' ');
return testProps(props, prefixed);
}
/**
* testBundle tests a list of CSS features that require element and style injection.
* By bundling them together we can reduce the need to touch the DOM multiple times.
*/
/*>>testBundle*/
var testBundle = (function( styles, tests ) {
var style = styles.join(''),
len = tests.length;
injectElementWithStyles(style, function( node, rule ) {
var style = document.styleSheets[document.styleSheets.length - 1],
// IE8 will bork if you create a custom build that excludes both fontface and generatedcontent tests.
// So we check for cssRules and that there is a rule available
// More here: https://github.com/Modernizr/Modernizr/issues/288 & https://github.com/Modernizr/Modernizr/issues/293
cssText = style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || "",
children = node.childNodes, hash = {};
while ( len-- ) {
hash[children[len].id] = children[len];
}
/*>>touch*/ Modernizr['touch'] = ('ontouchstart' in window) || hash['touch'].offsetTop === 9; /*>>touch*/
/*>>csstransforms3d*/ Modernizr['csstransforms3d'] = hash['csstransforms3d'].offsetLeft === 9; /*>>csstransforms3d*/
/*>>generatedcontent*/Modernizr['generatedcontent'] = hash['generatedcontent'].offsetHeight >= 1; /*>>generatedcontent*/
/*>>fontface*/ Modernizr['fontface'] = /src/i.test(cssText) &&
cssText.indexOf(rule.split(' ')[0]) === 0; /*>>fontface*/
}, len, tests);
})([
// Pass in styles to be injected into document
/*>>fontface*/ '@font-face {font-family:"font";src:url("https://")}' /*>>fontface*/
/*>>touch*/ ,['@media (',prefixes.join('touch-enabled),('),mod,')',
'{#touch{top:9px;position:absolute}}'].join('') /*>>touch*/
/*>>csstransforms3d*/ ,['@media (',prefixes.join('transform-3d),('),mod,')',
'{#csstransforms3d{left:9px;position:absolute}}'].join('')/*>>csstransforms3d*/
/*>>generatedcontent*/,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('') /*>>generatedcontent*/
],
[
/*>>fontface*/ 'fontface' /*>>fontface*/
/*>>touch*/ ,'touch' /*>>touch*/
/*>>csstransforms3d*/ ,'csstransforms3d' /*>>csstransforms3d*/
/*>>generatedcontent*/,'generatedcontent' /*>>generatedcontent*/
]);/*>>testBundle*/
/**
* Tests
* -----
*/
tests['flexbox'] = function() {
/**
* setPrefixedValueCSS sets the property of a specified element
* adding vendor prefixes to the VALUE of the property.
* @param {Element} element
* @param {string} property The property name. This will not be prefixed.
* @param {string} value The value of the property. This WILL be prefixed.
* @param {string=} extra Additional CSS to append unmodified to the end of
* the CSS string.
*/
function setPrefixedValueCSS( element, property, value, extra ) {
property += ':';
element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || '');
}
/**
* setPrefixedPropertyCSS sets the property of a specified element
* adding vendor prefixes to the NAME of the property.
* @param {Element} element
* @param {string} property The property name. This WILL be prefixed.
* @param {string} value The value of the property. This will not be prefixed.
* @param {string=} extra Additional CSS to append unmodified to the end of
* the CSS string.
*/
function setPrefixedPropertyCSS( element, property, value, extra ) {
element.style.cssText = prefixes.join(property + ':' + value + ';') + (extra || '');
}
var c = document.createElement('div'),
elem = document.createElement('div');
setPrefixedValueCSS(c, 'display', 'box', 'width:42px;padding:0;');
setPrefixedPropertyCSS(elem, 'box-flex', '1', 'width:10px;');
c.appendChild(elem);
docElement.appendChild(c);
var ret = elem.offsetWidth === 42;
c.removeChild(elem);
docElement.removeChild(c);
return ret;
};
// On the S60 and BB Storm, getContext exists, but always returns undefined
// http://github.com/Modernizr/Modernizr/issues/issue/97/
tests['canvas'] = function() {
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
};
tests['canvastext'] = function() {
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
};
// This WebGL test may false positive.
// But really it's quite impossible to know whether webgl will succeed until after you create the context.
// You might have hardware that can support a 100x100 webgl canvas, but will not support a 1000x1000 webgl
// canvas. So this feature inference is weak, but intentionally so.
// It is known to false positive in FF4 with certain hardware and the iPad 2.
tests['webgl'] = function() {
return !!window.WebGLRenderingContext;
};
/*
* The Modernizr.touch test only indicates if the browser supports
* touch events, which does not necessarily reflect a touchscreen
* device, as evidenced by tablets running Windows 7 or, alas,
* the Palm Pre / WebOS (touch) phones.
*
* Additionally, Chrome (desktop) used to lie about its support on this,
* but that has since been rectified: http://crbug.com/36415
*
* We also test for Firefox 4 Multitouch Support.
*
* For more info, see: http://modernizr.github.com/Modernizr/touch.html
*/
tests['touch'] = function() {
return Modernizr['touch'];
};
/**
* geolocation tests for the new Geolocation API specification.
* This test is a standards compliant-only test; for more complete
* testing, including a Google Gears fallback, please see:
* http://code.google.com/p/geo-location-javascript/
* or view a fallback solution using google's geo API:
* http://gist.github.com/366184
*/
tests['geolocation'] = function() {
return !!navigator.geolocation;
};
// Per 1.6:
// This used to be Modernizr.crosswindowmessaging but the longer
// name has been deprecated in favor of a shorter and property-matching one.
// The old API is still available in 1.6, but as of 2.0 will throw a warning,
// and in the first release thereafter disappear entirely.
tests['postmessage'] = function() {
return !!window.postMessage;
};
// Web SQL database detection is tricky:
// In chrome incognito mode, openDatabase is truthy, but using it will
// throw an exception: http://crbug.com/42380
// We can create a dummy database, but there is no way to delete it afterwards.
// Meanwhile, Safari users can get prompted on any database creation.
// If they do, any page with Modernizr will give them a prompt:
// http://github.com/Modernizr/Modernizr/issues/closed#issue/113
// We have chosen to allow the Chrome incognito false positive, so that Modernizr
// doesn't litter the web with these test databases. As a developer, you'll have
// to account for this gotcha yourself.
tests['websqldatabase'] = function() {
var result = !!window.openDatabase;
/* if (result){
try {
result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4);
} catch(e) {
}
} */
return result;
};
// Vendors had inconsistent prefixing with the experimental Indexed DB:
// - Webkit's implementation is accessible through webkitIndexedDB
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
// For speed, we don't test the legacy (and beta-only) indexedDB
tests['indexedDB'] = function() {
for ( var i = -1, len = domPrefixes.length; ++i < len; ){
if ( window[domPrefixes[i].toLowerCase() + 'IndexedDB'] ){
return true;
}
}
return !!window.indexedDB;
};
// documentMode logic from YUI to filter out IE8 Compat Mode
// which false positives.
tests['hashchange'] = function() {
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
};
// Per 1.6:
// This used to be Modernizr.historymanagement but the longer
// name has been deprecated in favor of a shorter and property-matching one.
// The old API is still available in 1.6, but as of 2.0 will throw a warning,
// and in the first release thereafter disappear entirely.
tests['history'] = function() {
return !!(window.history && history.pushState);
};
tests['draganddrop'] = function() {
return isEventSupported('dragstart') && isEventSupported('drop');
};
// Mozilla is targeting to land MozWebSocket for FF6
// bugzil.la/659324
tests['websockets'] = function() {
for ( var i = -1, len = domPrefixes.length; ++i < len; ){
if ( window[domPrefixes[i] + 'WebSocket'] ){
return true;
}
}
return 'WebSocket' in window;
};
// http://css-tricks.com/rgba-browser-support/
tests['rgba'] = function() {
// Set an rgba() color and check the returned value
setCss('background-color:rgba(150,255,150,.5)');
return contains(mStyle.backgroundColor, 'rgba');
};
tests['hsla'] = function() {
// Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
// except IE9 who retains it as hsla
setCss('background-color:hsla(120,40%,100%,.5)');
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
};
tests['multiplebgs'] = function() {
// Setting multiple images AND a color on the background shorthand property
// and then querying the style.background property value for the number of
// occurrences of "url(" is a reliable method for detecting ACTUAL support for this!
setCss('background:url(https://),url(https://),red url(https://)');
// If the UA supports multiple backgrounds, there should be three occurrences
// of the string "url(" in the return value for elemStyle.background
return /(url\s*\(.*?){3}/.test(mStyle.background);
};
// In testing support for a given CSS property, it's legit to test:
// `elem.style[styleName] !== undefined`
// If the property is supported it will return an empty string,
// if unsupported it will return undefined.
// We'll take advantage of this quick test and skip setting a style
// on our modernizr element, but instead just testing undefined vs
// empty string.
tests['backgroundsize'] = function() {
return testPropsAll('backgroundSize');
};
tests['borderimage'] = function() {
return testPropsAll('borderImage');
};
// Super comprehensive table about all the unique implementations of
// border-radius: http://muddledramblings.com/table-of-css3-border-radius-compliance
tests['borderradius'] = function() {
return testPropsAll('borderRadius');
};
// WebOS unfortunately false positives on this test.
tests['boxshadow'] = function() {
return testPropsAll('boxShadow');
};
// FF3.0 will false positive on this test
tests['textshadow'] = function() {
return document.createElement('div').style.textShadow === '';
};
tests['opacity'] = function() {
// Browsers that actually have CSS Opacity implemented have done so
// according to spec, which means their return values are within the
// range of [0.0,1.0] - including the leading zero.
setCssAll('opacity:.55');
// The non-literal . in this regex is intentional:
// German Chrome returns this value as 0,55
// https://github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632
return /^0.55$/.test(mStyle.opacity);
};
tests['cssanimations'] = function() {
return testPropsAll('animationName');
};
tests['csscolumns'] = function() {
return testPropsAll('columnCount');
};
tests['cssgradients'] = function() {
/**
* For CSS Gradients syntax, please see:
* http://webkit.org/blog/175/introducing-css-gradients/
* https://developer.mozilla.org/en/CSS/-moz-linear-gradient
* https://developer.mozilla.org/en/CSS/-moz-radial-gradient
* http://dev.w3.org/csswg/css3-images/#gradients-
*/
var str1 = 'background-image:',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';
setCss(
(str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length)
);
return contains(mStyle.backgroundImage, 'gradient');
};
tests['cssreflections'] = function() {
return testPropsAll('boxReflect');
};
tests['csstransforms'] = function() {
return !!testProps(['transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform']);
};
tests['csstransforms3d'] = function() {
var ret = !!testProps(['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']);
// Webkit’s 3D transforms are passed off to the browser's own graphics renderer.
// It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
// some conditions. As a result, Webkit typically recognizes the syntax but
// will sometimes throw a false positive, thus we must do a more thorough check:
if ( ret && 'webkitPerspective' in docElement.style ) {
// Webkit allows this media query to succeed only if the feature is enabled.
// `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }`
ret = Modernizr['csstransforms3d'];
}
return ret;
};
tests['csstransitions'] = function() {
return testPropsAll('transitionProperty');
};
/*>>fontface*/
// @font-face detection routine by Diego Perini
// http://javascript.nwbox.com/CSSSupport/
tests['fontface'] = function() {
return Modernizr['fontface'];
};
/*>>fontface*/
// CSS generated content detection
tests['generatedcontent'] = function() {
return Modernizr['generatedcontent'];
};
// These tests evaluate support of the video/audio elements, as well as
// testing what types of content they support.
//
// We're using the Boolean constructor here, so that we can extend the value
// e.g. Modernizr.video // true
// Modernizr.video.ogg // 'probably'
//
// Codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845
// thx to NielsLeenheer and zcorpan
// Note: in FF 3.5.1 and 3.5.0, "no" was a return value instead of empty string.
// Modernizr does not normalize for that.
tests['video'] = function() {
var elem = document.createElement('video'),
bool = false;
// IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"');
// Workaround required for IE9, which doesn't report video support without audio codec specified.
// bug 599718 @ msft connect
var h264 = 'video/mp4; codecs="avc1.42E01E';
bool.h264 = elem.canPlayType(h264 + '"') || elem.canPlayType(h264 + ', mp4a.40.2"');
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"');
}
} catch(e) { }
return bool;
};
tests['audio'] = function() {
var elem = document.createElement('audio'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"');
bool.mp3 = elem.canPlayType('audio/mpeg;');
// Mimetypes accepted:
// https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
// http://bit.ly/iphoneoscodecs
bool.wav = elem.canPlayType('audio/wav; codecs="1"');
bool.m4a = elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;');
}
} catch(e) { }
return bool;
};
// Firefox has made these tests rather unfun.
// In FF4, if disabled, window.localStorage should === null.
// Normally, we could not test that directly and need to do a
// `('localStorage' in window) && ` test first because otherwise Firefox will
// throw http://bugzil.la/365772 if cookies are disabled
// However, in Firefox 4 betas, if dom.storage.enabled == false, just mentioning
// the property will throw an exception. http://bugzil.la/599479
// This looks to be fixed for FF4 Final.
// Because we are forced to try/catch this, we'll go aggressive.
// FWIW: IE8 Compat mode supports these features completely:
// http://www.quirksmode.org/dom/html5.html
// But IE8 doesn't support either with local files
tests['localstorage'] = function() {
try {
return !!localStorage.getItem;
} catch(e) {
return false;
}
};
tests['sessionstorage'] = function() {
try {
return !!sessionStorage.getItem;
} catch(e){
return false;
}
};
tests['webworkers'] = function() {
return !!window.Worker;
};
tests['applicationcache'] = function() {
return !!window.applicationCache;
};
// Thanks to Erik Dahlstrom
tests['svg'] = function() {
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
};
// specifically for SVG inline in HTML, not within XHTML
// test page: paulirish.com/demo/inline-svg
tests['inlinesvg'] = function() {
var div = document.createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
};
// Thanks to F1lt3r and lucideer, ticket #35
tests['smil'] = function() {
return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
};
tests['svgclippaths'] = function() {
// Possibly returns a false positive in Safari 3.2?
return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
};
// input features and input types go directly onto the ret object, bypassing the tests loop.
// Hold this guy to execute in a moment.
function webforms() {
// Run through HTML5's new input attributes to see if the UA understands any.
// We're using f which is the <input> element created early on
// Mike Taylr has created a comprehensive resource for testing these attributes
// when applied to all input types:
// http://miketaylr.com/code/input-type-attr.html
// spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
// Only input placeholder is tested while textarea's placeholder is not.
// Currently Safari 4 and Opera 11 have support only for the input placeholder
// Both tests are available in feature-detects/forms-placeholder.js
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
return attrs;
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
// Run through HTML5's new input types to see if the UA understands any.
// This is put behind the tests runloop because it doesn't return a
// true/false like all the other tests; instead, it returns an object
// containing each input type with its corresponding true/false value
// Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/
Modernizr['inputtypes'] = (function(props) {
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
inputElem.setAttribute('type', inputElemType = props[i]);
bool = inputElem.type !== 'text';
// We first check to see if the type we give it sticks..
// If the type does, we feed it a textual value, which shouldn't be valid.
// If the value doesn't stick, we know there's input sanitization which infers a custom UI
if ( bool ) {
inputElem.value = smile;
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
docElement.appendChild(inputElem);
defaultView = document.defaultView;
// Safari 2-4 allows the smiley as a value, despite making a slider
bool = defaultView.getComputedStyle &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
// Mobile android web browser has false positive, so must
// check the height to see if the widget is actually there.
(inputElem.offsetHeight !== 0);
docElement.removeChild(inputElem);
} else if ( /^(search|tel)$/.test(inputElemType) ){
// Spec doesnt define any special parsing or detectable UI
// behaviors so we pass these through as true
// Interestingly, opera fails the earlier test, so it doesn't
// even make it here.
} else if ( /^(url|email)$/.test(inputElemType) ) {
// Real url and email support comes with prebaked validation.
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
} else if ( /^color$/.test(inputElemType) ) {
// chuck into DOM and force reflow for Opera bug in 11.00
// github.com/Modernizr/Modernizr/issues#issue/159
docElement.appendChild(inputElem);
docElement.offsetWidth;
bool = inputElem.value != smile;
docElement.removeChild(inputElem);
} else {
// If the upgraded input compontent rejects the :) text, we got a winner
bool = inputElem.value != smile;
}
}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
}
// End of test definitions
// -----------------------
// Run through all tests and detect their support in the current UA.
// todo: hypothetically we could be doing an array of tests and use a basic loop here.
for ( var feature in tests ) {
if ( hasOwnProperty(tests, feature) ) {
// run the test, throw the return value into the Modernizr,
// then based on that boolean, define an appropriate className
// and push it into an array of classes we'll join later.
featureName = feature.toLowerCase();
Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
// input tests need to run.
Modernizr.input || webforms();
/**
* addTest allows the user to define their own feature tests
* the result will be added onto the Modernizr object,
* as well as an appropriate className set on the html element
*
* @param feature - String naming the feature
* @param test - Function returning true if feature is supported, false if not
*/
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == "object" ) {
for ( var key in feature ) {
if ( hasOwnProperty( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
}
}
} else {
feature = feature.toLowerCase();
if ( Modernizr[feature] !== undefined ) {
// we're going to quit if you're trying to overwrite an existing test
// if we were to allow it, we'd do this:
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// docElement.className = docElement.className.replace( re, '' );
// but, no rly, stuff 'em.
return;
}
test = typeof test == "boolean" ? test : !!test();
docElement.className += ' ' + (test ? '' : 'no-') + feature;
Modernizr[feature] = test;
}
return Modernizr; // allow chaining.
};
// Reset modElem.cssText to nothing to reduce memory footprint.
setCss('');
modElem = inputElem = null;
//>>BEGIN IEPP
// Enable HTML 5 elements for styling (and printing) in IE.
if ( window.attachEvent && (function(){ var elem = document.createElement('div');
elem.innerHTML = '<elem></elem>';
return elem.childNodes.length !== 1; })() ) {
// iepp v2 by @jon_neal & afarkas : github.com/aFarkas/iepp/
(function(win, doc) {
win.iepp = win.iepp || {};
var iepp = win.iepp,
elems = iepp.html5elements || 'abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video',
elemsArr = elems.split('|'),
elemsArrLen = elemsArr.length,
elemRegExp = new RegExp('(^|\\s)('+elems+')', 'gi'),
tagRegExp = new RegExp('<(\/*)('+elems+')', 'gi'),
filterReg = /^\s*[\{\}]\s*$/,
ruleRegExp = new RegExp('(^|[^\\n]*?\\s)('+elems+')([^\\n]*)({[\\n\\w\\W]*?})', 'gi'),
docFrag = doc.createDocumentFragment(),
html = doc.documentElement,
head = html.firstChild,
bodyElem = doc.createElement('body'),
styleElem = doc.createElement('style'),
printMedias = /print|all/,
body;
function shim(doc) {
var a = -1;
while (++a < elemsArrLen)
// Use createElement so IE allows HTML5-named elements in a document
doc.createElement(elemsArr[a]);
}
iepp.getCSS = function(styleSheetList, mediaType) {
if(styleSheetList+'' === undefined){return '';}
var a = -1,
len = styleSheetList.length,
styleSheet,
cssTextArr = [];
while (++a < len) {
styleSheet = styleSheetList[a];
//currently no test for disabled/alternate stylesheets
if(styleSheet.disabled){continue;}
mediaType = styleSheet.media || mediaType;
// Get css from all non-screen stylesheets and their imports
if (printMedias.test(mediaType)) cssTextArr.push(iepp.getCSS(styleSheet.imports, mediaType), styleSheet.cssText);
//reset mediaType to all with every new *not imported* stylesheet
mediaType = 'all';
}
return cssTextArr.join('');
};
iepp.parseCSS = function(cssText) {
var cssTextArr = [],
rule;
while ((rule = ruleRegExp.exec(cssText)) != null){
// Replace all html5 element references with iepp substitute classnames
cssTextArr.push(( (filterReg.exec(rule[1]) ? '\n' : rule[1]) +rule[2]+rule[3]).replace(elemRegExp, '$1.iepp_$2')+rule[4]);
}
return cssTextArr.join('\n');
};
iepp.writeHTML = function() {
var a = -1;
body = body || doc.body;
while (++a < elemsArrLen) {
var nodeList = doc.getElementsByTagName(elemsArr[a]),
nodeListLen = nodeList.length,
b = -1;
while (++b < nodeListLen)
if (nodeList[b].className.indexOf('iepp_') < 0)
// Append iepp substitute classnames to all html5 elements
nodeList[b].className += ' iepp_'+elemsArr[a];
}
docFrag.appendChild(body);
html.appendChild(bodyElem);
// Write iepp substitute print-safe document
bodyElem.className = body.className;
bodyElem.id = body.id;
// Replace HTML5 elements with <font> which is print-safe and shouldn't conflict since it isn't part of html5
bodyElem.innerHTML = body.innerHTML.replace(tagRegExp, '<$1font');
};
iepp._beforePrint = function() {
// Write iepp custom print CSS
styleElem.styleSheet.cssText = iepp.parseCSS(iepp.getCSS(doc.styleSheets, 'all'));
iepp.writeHTML();
};
iepp.restoreHTML = function(){
// Undo everything done in onbeforeprint
bodyElem.innerHTML = '';
html.removeChild(bodyElem);
html.appendChild(body);
};
iepp._afterPrint = function(){
// Undo everything done in onbeforeprint
iepp.restoreHTML();
styleElem.styleSheet.cssText = '';
};
// Shim the document and iepp fragment
shim(doc);
shim(docFrag);
//
if(iepp.disablePP){return;}
// Add iepp custom print style element
head.insertBefore(styleElem, head.firstChild);
styleElem.media = 'print';
styleElem.className = 'iepp-printshim';
win.attachEvent(
'onbeforeprint',
iepp._beforePrint
);
win.attachEvent(
'onafterprint',
iepp._afterPrint
);
})(window, document);
}
//>>END IEPP
// Assign private properties to the return object with prefix
Modernizr._version = version;
// expose these for the plugin API. Look in the source for how to join() them against your input
Modernizr._prefixes = prefixes;
Modernizr._domPrefixes = domPrefixes;
// Modernizr.mq tests a given media query, live against the current state of the window
// A few important notes:
// * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false
// * A max-width or orientation query will be evaluated against the current state, which may change later.
// * You must specify values. Eg. If you are testing support for the min-width media query use:
// Modernizr.mq('(min-width:0)')
// usage:
// Modernizr.mq('only screen and (max-width:768)')
Modernizr.mq = testMediaQuery;
// Modernizr.hasEvent() detects support for a given event, with an optional element to test on
// Modernizr.hasEvent('gesturestart', elem)
Modernizr.hasEvent = isEventSupported;
// Modernizr.testProp() investigates whether a given style property is recognized
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testProp('pointerEvents')
Modernizr.testProp = function(prop){
return testProps([prop]);
};
// Modernizr.testAllProps() investigates whether a given style property,
// or any of its vendor-prefixed variants, is recognized
// Note that the property names must be provided in the camelCase variant.
// Modernizr.testAllProps('boxSizing')
Modernizr.testAllProps = testPropsAll;
// Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards
// Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... })
Modernizr.testStyles = injectElementWithStyles;
// Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input
// Modernizr.prefixed('boxSizing') // 'MozBoxSizing'
// Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style.
// Return values will also be the camelCase variant, if you need to translate that to hypenated style use:
//
// str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
// If you're trying to ascertain which transition end event to bind to, you might do something like...
//
// var transEndEventNames = {
// 'WebkitTransition' : 'webkitTransitionEnd',
// 'MozTransition' : 'transitionend',
// 'OTransition' : 'oTransitionEnd',
// 'msTransition' : 'msTransitionEnd', // maybe?
// 'transition' : 'transitionEnd'
// },
// transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ];
Modernizr.prefixed = function(prop){
return testPropsAll(prop, 'pfx');
};
// Remove "no-js" class from <html> element, if it exists:
docElement.className = docElement.className.replace(/\bno-js\b/, '')
// Add the new classes to the <html> element.
+ (enableClasses ? ' js ' + classes.join(' ') : '');
return Modernizr;
})(this, this.document);
/**
* Array prototype extensions.
* Extends array prototype with the following methods:
* contains, every, exfiltrate, filter, forEach, getRange, inArray, indexOf, insertAt, map, randomize, removeAt, some, unique
*
* This extensions doesn't depend on any other code or overwrite existing methods.
*
*
* Copyright (c) 2007 Harald Hanek (http://js-methods.googlecode.com)
*
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.gnu.org/licenses/gpl.html) licenses.
*
* @author Harald Hanek
* @version 0.9
* @lastchangeddate 10. October 2007 15:46:06
* @revision 876
*/
(function(){
/**
* Extend the array prototype with the method under the given name if it doesn't currently exist.
*
* @private
*/
function append(name, method)
{
if(!Array.prototype[name])
Array.prototype[name] = method;
};
/**
* Returns true if every element in 'elements' is in the array.
*
* @example [1, 2, 1, 4, 5, 4].contains([1, 2, 4]);
* @result true
*
* @name contains
* @param Array elements
* @return Boolean
*/
append("contains", function(elements){
return this.every(function(element){
return this.indexOf(element) >= 0; }, elements);
});
/**
* Returns the array without the elements in 'elements'.
*
* @example [1, 2, 1, 4, 5, 4].contains([1, 2, 4]);
* @result true
*
* @name exfiltrate
* @param Array elements
* @return Boolean
*/
append("exfiltrate", function(elements){
return this.filter(function(element){
return this.indexOf(element) < 0; }, elements);
});
/**
* Tests whether all elements in the array pass the test implemented by the provided function.
*
* @example [22, 72, 16, 99, 254].every(function(element, index, array) {
* return element >= 15;
* });
* @result true;
*
* @example [12, 72, 16, 99, 254].every(function(element, index, array) {
* return element >= 15;
* });
* @result false;
*
* @name every
* @param Function fn The function to be called for each element.
* @param Object scope (optional) The scope of the function (defaults to this).
* @return Boolean
*/
append("every", function(fn, scope){
for(var i = 0; i < this.length; i++)
if(!fn.call(scope || window, this[i], i, this))
return false;
return true;
});
/**
* Creates a new array with all elements that pass the test implemented by the provided function.
*
* Natively supported in Gecko since version 1.8.
* http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:filter
*
* @example [12, 5, 8, 1, 44].filter(function(element, index, array) {
* return element >= 10;
* });
* @result [12, 44];
*
* @name filter
* @param Function fn The function to be called for each element.
* @param Object scope (optional) The scope of the function (defaults to this).
* @return Array
*/
append("filter", function(fn, scope){
var r = [];
for(var i = 0; i < this.length; i++)
if(fn.call(scope || window, this[i], i, this))
r.push(this[i]);
return r;
});
/**
* Executes a provided function once per array element.
*
* Natively supported in Gecko since version 1.8.
* http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
*
* @example var stuff = "";
* ["Java", "Script"].forEach(function(element, index, array) {
* stuff += element;
* });
* @result "JavaScript";
*
* @name forEach
* @param Function fn The function to be called for each element.
* @param Object scope (optional) The scope of the function (defaults to this).
* @return void
*/
append("forEach", function(fn, scope){
for(var i = 0; i < this.length; i++)
fn.call(scope || window, this[i], i, this);
});
/**
* Returns a range of items in this collection
*
* @example [1, 2, 1, 4, 5, 4].getRange(2, 4);
* @result [1, 4, 5]
*
* @name getRange
* @param Number startIndex (optional) defaults to 0
* @param Number endIndex (optional) default to the last item
* @return Array
*/
append("getRange", function(start, end){
var items = this;
if(items.length < 1)
return [];
start = start || 0;
end = Math.min(typeof end == "undefined" ? this.length-1 : end, this.length-1);
var r = [];
if(start <= end)
for(var i = start; i <= end; i++)
r[r.length] = items[i];
else
for(var i = start; i >= end; i--)
r[r.length] = items[i];
return r;
});
/**
* Returns the first index at which a given element can be found in the array, or -1 if it is not present.
*
* @example [12, 5, 8, 5, 44].indexOf(5);
* @result 1;
*
* @example [12, 5, 8, 5, 44].indexOf(5, 2);
* @result 3;
*
* @name indexOf
* @param Object subject Object to search for
* @param Number offset (optional) Index at which to start searching
* @return Int
*/
append("indexOf", function(subject, offset){
for(var i = offset || 0; i < this.length; i++)
if(this[i] === subject)
return i;
return -1;
});
/**
* Checks if a given subject can be found in the array.
*
* @example [12, 5, 7, 5].inArray(7);
* @result true;
*
* @example [12, 5, 7, 5].inArray(9);
* @result false;
*
* @name inArray
* @param Object subject Object to search for
* @return Boolean
*/
append("inArray", function(subject){
for(var i = 0; i < this.length; i++)
if(subject == this[i])
return true;
return false;
});
/**
* Inserts an item at the specified index in the array.
*
* @example ['dog', 'cat', 'horse'].insertAt(2, 'mouse');
* @result ['dog', 'cat', 'mouse', 'horse']
*
* @name insertAt
* @param Number index Position where to insert the element into the array
* @param Object element The element to insert
* @return Array
*/
append("insertAt", function(index, element){
for(var k = this.length; k > index; k--)
this[k] = this[k-1];
this[index] = element;
return this;
});
/**
* Creates a new array with the results of calling a provided function on every element in this array.
*
* Natively supported in Gecko since version 1.8.
* http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:map
*
* @example ["my", "Name", "is", "HARRY"].map(function(element, index, array) {
* return element.toUpperCase();
* });
* @result ["MY", "NAME", "IS", "HARRY"];
*
* @example [1, 4, 9].map(Math.sqrt);
* @result [1, 2, 3];
*
* @name map
* @param Function fn The function to be called for each element.
* @param Object scope (optional) The scope of the function (defaults to this).
* @return Array
*/
append("map", function(fn, scope){
scope = scope || window;
var r = [];
for(var i = 0; i < this.length; i++)
r[r.length] = fn.call(scope, this[i], i, this);
return r;
});
/**
* Remove an item from a specified index in the array.
*
* @example ['dog', 'cat', 'mouse', 'horse'].deleteAt(2);
* @result ['dog', 'cat', 'horse']
*
* @name removeAt
* @param Number index The index within the array of the item to remove.
* @return Array
*/
append("removeAt", function(index){
for(var k = index; k < this.length-1; k++)
this[k] = this[k+1];
this.length--;
return this;
});
/**
* Randomize the order of the elements in the Array.
*
* @example [2, 3, 4, 5].randomize();
* @result [5, 2, 3, 4] randomized result
*
* @name randomize
* @return Array
*/
append("randomize", function(){
return this.sort(function(){return(Math.round(Math.random())-0.5)});
//return this.sort(function(){return(Math.round(Math.random())-0.5)}, true);
});
/**
* Tests whether some element in the array passes the test implemented by the provided function.
*
* Natively supported in Gecko since version 1.8.
* http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
*
* @example [101, 199, 250, 200].some(function(element, index, array) {
* return element >= 100;
* });
* @result true;
*
* @example [101, 99, 250, 200].some(function(element, index, array) {
* return element >= 100;
* });
* @result false;
*
* @name some
* @param Function fn The function to be called for each element.
* @param Object scope (optional) The scope of the function (defaults to this).
* @return Boolean
*/
append("some", function(fn, scope){
for(var i = 0; i < this.length; i++)
if(fn.call(scope || window, this[i], i, this))
return true;
return false;
});
/**
* Returns a new array that contains all unique elements of this array.
*
* @example [1, 2, 1, 4, 5, 4].unique();
* @result [1, 2, 4, 5]
*
* @name unique
* @return Array
*/
append("unique", function(){
return this.filter(function(element, index, array){
return array.indexOf(element) >= index;
});
});
})();
/*
Copyright 2011 The greplin-exception-catcher Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
====
This Javascript file lets web applications get stacktraces for all uncaught JS exceptions and send them to Greplin
Exception Catcher.
Features include:
- Stacktraces in IE 6-8, as well as modern versions of Firefox, Chrome, and Opera
- Javascript execution entry point information (such as event type and listener) on IE 6-9 and modern versions of
Firefox, Chrome, Safari, and Opera
- Redaction of URLs and strings in stacktraces to avoid logging sensitive user information
Things that aren't done yet:
- Aggregation. Due to the way GEC works now, this would be impossible to do without losing potentially useful
information. To do this, GEC needs to be able to aggregate based upon a normalized stacktrace while still providing detailed information for each specific incident of the exception.
- Can't wrap DOM0 events (<div onclick> for example).
- Some code cleanup: Since this is a small, self-contained project, I took sort of a "hack it until it works" approach
to coding it. I'd like to go back and structure the code better sometime, but I probably wont' get around to it
anytime soon since it works very reliably as it is.
How to use it:
1. Create an endpoint at your server to send this stuff to GEC.
2. Modify the call to g.errorCatcher at the end of the file to pass in functions that pass exceptions to GEC and that
redact URLs respectively. (Note: your URL redaction function will be passed strings that may contain URLs, not bare
URLs, so keep that in mind)
3. Wrap your JS files if you want to capture errors during their initial execution:
try {
var your_js_here
}
catch(e) { window.g && g.handleInitialException && g.handleInitialException(e, '(script filename here)') }
If you use Closure Compiler, just do
--output_wrapper="window.COMPILED = true; try { %%output%% } catch(e) { window.g && g.handleInitialException && g.handleInitialException(e, '(script filename here)') }"
4. This exception catching script can't see exceptions that happen before it's loaded, so make sure it's loaded early in
your page before most of your other scripts.
*/
var g = g || {};
/**
* Captures uncaught JS exceptions on the page and passes them to GEC.
* Can capture stacktraces in IE 6-8, Firefox, Chrome, and Opera, and can capture only the top of the stack in IE 9.
* In Safari, only basic event information is captured.
* Uses both window.onerror and wrapped DOM prototype interfaces to capture as much information as possible without
* requiring JS code changes.
*/
g.errorCatcher = function(reportHandler, redactQueryStrings) {
g.errorCatcher.reportHandler_ = reportHandler;
g.errorCatcher.redactQueryStrings_ = redactQueryStrings;
// commented out part is for weird cases where you have two exception catchers.
// i haven't tested that case at all though, so i'm commenting it out for now.
var wrappedProperty = 'WrappedListener'; //+ Math.floor(Math.random() * 10000000).toString(30);
var supportsJsErrorStack;
try {
({})['undefinedMethod']();
} catch(error) {
supportsJsErrorStack = 'stack' in error || 'stacktrace' in error;
}
var supportsWindowOnerror = 'onerror' in window && !/^Opera/.test(navigator.userAgent);
var supportsWindowOnerrorStack = /MSIE /.test(navigator.userAgent);
// Detecting support based on a whitelist sucks, but we don't want to accidentally log personal information, so we
// only allow browsers that we know that we can redact stacktrace strings for.
var supportsDOMWrapping =
// Chrome
/Chrom(e|ium)/.test(navigator.userAgent) ||
// IE 9+
/MSIE (9\.|[1-9][0-9]+\.)/.test(navigator.userAgent) || // XXX compat mode?
// Firefox 6+
/Gecko\/[0-9]/.test(navigator.userAgent) && (parseInt(navigator['buildID'], 10) >= 20110830092941) ||
// Safari 5.1+ (AppleWebKit/534+)
/AppleWebKit\/(53[4-9]|5[4-9][0-9]|[6-9][0-9]{2}|[1-9][0-9]{3})/.test(navigator.userAgent) ||
// Opera 11.50+
/^Opera.*Presto\/(2\.9|[3-9]|[1-9][0-9])/.test(navigator.userAgent);
if (supportsDOMWrapping) {
wrapTimeouts();
wrapDOMEvents();
wrapXMLHttpRequest();
}
if (supportsWindowOnerror &&
(!supportsDOMWrapping || (!supportsJsErrorStack && supportsWindowOnerrorStack))) {
window.onerror = function(errorMessage, url, lineNumber) {
// Grab the error provided by DOM wrappings, if it's available
var errorObject = g.errorCatcher.lastDomWrapperError_ || {};
delete g.errorCatcher.lastDomWrapperError_;
errorObject.message = errorObject.message || errorMessage;
errorObject.url = errorObject.url || url;
errorObject.line = errorObject.line || lineNumber;
// In IE, get the character offset inside the line of the error from window.event.
if (window.event && typeof window.event['errorCharacter'] == 'number') {
errorObject.character = (errorObject.character || window.event['errorCharacter']) + '';
}
// If there isn't already a stacktrace generated by the DOM wrappers, try to generate one using the old-fashioned
// caller method. This only works in IE 6-8. It partially works in IE 9 -- but it only lets you get the top of the
// stack.
if (!errorObject.stacktrace && supportsWindowOnerrorStack) {
try {
errorObject.stacktrace = g.errorCatcher.getStacktrace(arguments.callee.caller);
} catch(exception) {
errorObject.stacktrace = '[error generating stacktrace: ' + exception.message + ']';
}
}
g.errorCatcher.reportException(errorObject);
};
}
/**
* Wraps setTimeout and setInterval to handle uncaught exceptions in listeners.
*/
function wrapTimeouts() {
wrapTimeoutsHelper('setTimeout');
wrapTimeoutsHelper('setInterval');
function wrapTimeoutsHelper(timeoutMethodName) {
var original = window[timeoutMethodName];
window[timeoutMethodName] = function(listener, delay) {
if (typeof listener == 'function') {
var newArgs = Array.prototype.slice.call(arguments);
newArgs[0] = function() {
try {
listener.apply(this, arguments);
} catch(exception) {
g.errorCatcher.handleCatchException(
exception, timeoutMethodName + '(' + g.errorCatcher.stringify(listener) + ', ' + delay + ')');
}
};
return original.apply(this, newArgs);
} else {
// If someone passes a string to setTimeout, don't bother wrapping it.
return original.apply(this, arguments);
}
}
}
}
/**
* Wraps DOM event interfaces (addEventListener and removeEventListener) to add try/catch wrappers to all event
* listeners.
*/
function wrapDOMEvents() {
var eventsWrappedProperty = 'events' + wrappedProperty;
wrapDOMEventsHelper(window.XMLHttpRequest.prototype);
wrapDOMEventsHelper(window.Element.prototype);
wrapDOMEventsHelper(window);
wrapDOMEventsHelper(window.document);
// Workaround for Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=456151
if (document.documentElement.addEventListener != window.Element.prototype.addEventListener) {
var elementNames =
('Unknown,Anchor,Applet,Area,BR,Base,Body,Button,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,' +
'FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,IsIndex,LI,Label,Legend,Link,Map,Menu,Meta,Span,OList,' +
'Object,OptGroup,Option,Paragraph,Param,Pre,Quote,Script,Select,Style,TableCaption,TableCell,TableCol,' +
'Table,TableRow,TableSection,TextArea,Title,UList,Canvas').split(',');
elementNames.forEach(function(elementName) {
var constructor = window['HTML' + elementName + 'Element'];
if (constructor && constructor.prototype) {
wrapDOMEventsHelper(constructor.prototype);
}
});
}
function wrapDOMEventsHelper(object) {
var originalAddEventListener = object.addEventListener;
var originalRemoveEventListener = object.removeEventListener;
if (!originalAddEventListener || !originalRemoveEventListener) {
return;
}
object.addEventListener = function(eventType, listener, useCapture) {
// Dedupe the listener in case it is already listening unwrapped.
originalRemoveEventListener.apply(this, arguments);
if (typeof listener != 'function') {
// TODO(david): Handle a listener that is not a function, but instead an object that implements the
// EventListener interface (see http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener ).
originalAddEventListener.apply(this, arguments);
return;
}
listener[eventsWrappedProperty] = listener[eventsWrappedProperty] || {
innerListener: listener,
'handleEvent': g.errorCatcher.listenerWrapper_
};
originalAddEventListener.call(this, eventType, listener[eventsWrappedProperty], useCapture);
};
object.removeEventListener = function(eventType, listener, useCapture) {
// Remove unwrapped listener, just to be sure.
originalRemoveEventListener.apply(this, arguments);
if (typeof listener != 'function') {
return;
}
if (listener[eventsWrappedProperty]) {
originalRemoveEventListener.call(this, eventType, listener[eventsWrappedProperty], useCapture);
}
};
}
}
/**
* Wrap XMLHttpRequest onreadystatechange listeners to handle uncaught JS exceptions.
* This only affects the .onreadystatechange property. The addEventListener property is handled by wrapDOMEvents.
*/
function wrapXMLHttpRequest() {
var xhrWrappedProperty = 'xhr' + wrappedProperty;
var ctor = XMLHttpRequest, instance = new XMLHttpRequest;
if (!/(AppleWebKit|MSIE)/.test(navigator.userAgent) ||
(Object.getOwnPropertyDescriptor(ctor.prototype, 'onreadystatechange') || {}).configurable &&
instance.__lookupSetter__ && instance.__lookupSetter__('onreadystatechange')) {
// The browser has good support for manipulating XMLHttpRequest prototypes.
var onreadystatechangeSetter = instance.__lookupSetter__('onreadystatechange');
ctor.prototype.__defineGetter__('onreadystatechange', function() {
return this[xhrWrappedProperty];
});
ctor.prototype.__defineSetter__('onreadystatechange', function(listener) {
this[xhrWrappedProperty] = listener;
onreadystatechangeSetter.call(this, wrappedReadyStateChange);
});
} else {
// Chrome and Safari have problems with this. Instead, check to see if onreadystatechange needs to be wrapped
// from a readystatechange event listener.
var send = instance.send;
var addEventListener = instance.addEventListener;
XMLHttpRequest.prototype.send = function() {
addEventListener.call(this, 'readystatechange', wrapReadyStateChange, true);
return send.apply(this, arguments);
}
}
function wrappedReadyStateChange() {
try {
var onreadystatechange =
(this.onreadystatechange == arguments.callee ?
this[xhrWrappedProperty] : this.onreadystatechange);
this[xhrWrappedProperty].apply(this, arguments);
} catch(exception) {
// TODO(david): Expose some information about the xmlhttprequest to the exception logging (maybe request url)
g.errorCatcher.handleCatchException(exception, 'onreadystatechange');
}
}
// Used in the wrapped XHR::send handler to wrap onreadystatechange in response to addEventListener
// readystatechange events that fire first.
function wrapReadyStateChange() {
if (this.onreadystatechange && this.onreadystatechange != wrappedReadyStateChange) {
this[xhrWrappedProperty] = this.onreadystatechange;
this.onreadystatechange = wrappedReadyStateChange;
}
}
}
};
/**
* Time that the last error was reported. Used for rate-limiting.
* @type {number}
*/
g.errorCatcher.lastError_ = 0;
/**
* Delay between reporting errors. Increases dynamically.
* @type {number}
*/
g.errorCatcher.errorDelay_ = 10;
/**
* Wrapper for addEventListener/removeEventListener listeners. Global to avoid potential memory/performance impacts of a
* function closure for each event listener. This is a handleEvent property of the EventHandler object passed to
* addEventListener. It accesses other properties of that object to read exception information.
* @param {Event} eventObject The DOM event.
*/
g.errorCatcher.listenerWrapper_ = function(eventObject) {
try {
return this.innerListener.apply(eventObject.target, arguments);
} catch(exception) {
g.errorCatcher.handleCatchException(
exception, eventObject.type + ' listener ' + g.errorCatcher.stringify(this.innerListener) + ' on ' +
g.errorCatcher.stringify(eventObject.currentTarget));
}
};
/**
* Passes an exception to GEC.
* TODO(david): show a message to the user. Let the user elect to send more detailed error information (un-redacted
* strings).
* @param {Object} errorObject An object describing the error.
*/
g.errorCatcher.reportException = function(errorObject) {
var d = (new Date).getTime();
if (d - g.errorCatcher.lastError_ < g.errorCatcher.errorDelay_) {
// Rate limited
return;
}
g.errorCatcher.lastError_ = d;
g.errorCatcher.errorDelay_ = g.errorCatcher.errorDelay_ * 2;
errorObj = {
'msg':g.errorCatcher.redactQueryStrings_(errorObject.message || ''),
'line': errorObject.line + (typeof errorObject.character == 'string' ? ':' + errorObject.character : ''),
'trace':'Type: ' + errorObject.name + '\nUser-agent: ' + navigator.userAgent +
'\nURL: ' + g.errorCatcher.redactQueryStrings_(location.href) + '\n\n' +
g.errorCatcher.redactQueryStrings_(errorObject.stacktrace || ''),
'ts': Math.floor(new Date().getTime() / 1000),
'name':g.errorCatcher.redactQueryStrings_(errorObject.context || '') || 'unidentified JS thread'};
g.errorCatcher.reportHandler_(errorObj);
};
/**
* Handles exceptions from the try { } catch { } block added around all of our compiled JS by our Closure Compiler
* configuration. This handles exceptions that occur during the intiial execution of the script.
* @param {Error} caughtException The caught exception.
* @param {string} fileName The name of the JS file where the exception occured.
*/
g.errorCatcher.handleInitialException = function(caughtException, fileName) {
g.errorCatcher.handleCatchException(caughtException, 'Initial execution of ' + fileName);
};
/**
* Handles a caught exception. When window.onerror is available, the exception is re-thrown so that additional
* information from window.onerror can be added. Otherwise, the exception is passed to reportException, where it is
* sent to GEC and potentially displayed to the user.
* @param {Error} caughtException The caught JS exception.
* @param context
*/
g.errorCatcher.handleCatchException = function(caughtException, context) {
if (!(caughtException instanceof window.Error)) {
caughtException = new Error(caughtException);
}
var errorObject = {};
errorObject.context = context;
errorObject.name = caughtException.name;
// Opera has both stacktrace and stack. Stacktrace is much more detailed, so use that when available.
errorObject.stacktrace = caughtException['stacktrace'] || caughtException['stack'];
if (/Gecko/.test(navigator.userAgent) && !/AppleWebKit/.test(navigator.userAgent)) {
errorObject.stacktrace = g.errorCatcher.redactFirefoxStacktraceStrings(errorObject.stacktrace);
}
errorObject.message = caughtException.message;
errorObject.number = caughtException.number;
var matches;
if ('lineNumber' in caughtException) {
errorObject.line = caughtException['lineNumber'];
} else if ('line' in caughtException) {
errorObject.line = caughtException['line'];
} else if (/Chrom(e|ium)/.test(navigator.userAgent)) {
matches = caughtException.stack.match(/\:(\d+)\:(\d+)\)(\n|$)/);
if (matches) {
errorObject.line = matches[1];
errorObject.character = matches[2];
}
} else if (/Opera/.test(navigator.userAgent)) {
matches = (errorObject['stacktrace'] || '').match(/Error thrown at line (\d+), column (\d+)/);
if (matches) {
errorObject.line = matches[1];
errorObject.character = matches[2];
} else {
matches = (errorObject['stacktrace'] || '').match(/Error thrown at line (\d+)/);
if (matches){
errorObject.line = matches[1];
}
}
}
if (window.onerror) {
// window.onerror is still needed to get stack in IE, so we need to re-throw the error to that.
g.errorCatcher.lastDomWrapperError_ = errorObject;
throw caughtException;
} else {
g.errorCatcher.reportException(errorObject);
}
};
/**
* @param {Function} opt_topFunction The function at the top of the stack; if omitted, the caller of makeStacktrace is
* used.
* @return {string} A string showing the stack of functions and arguments.
*/
g.errorCatcher.getStacktrace = function(opt_topFunction) {
var stacktrace = '';
var func = opt_topFunction || arguments.callee.caller;
var used = [];
var length = 0;
stacktraceLoop: do {
stacktrace += g.errorCatcher.getFunctionName(func) + g.errorCatcher.getFunctionArgumentsString(func) + '\n';
used.push(func);
try {
func = func.caller;
for (var i = 0; i < used.length; i++) {
if (used[i] == func) {
stacktrace += g.errorCatcher.getFunctionName(func) + '(???)\n(...)\n';
break stacktraceLoop;
}
}
} catch(exception) {
stacktrace += '(???' + exception.message + ')\n';
break stacktraceLoop;
}
if (length > 50) {
stacktrace += '(...)\n';
}
} while (func);
return stacktrace;
};
/**
* @param {string} string The string to shorten.
* @param {number} maxLength The maximum length of the new string.
* @return {string} The string, shortened if it exceeds maxLength.
*/
g.errorCatcher.shortenString = function(string, maxLength) {
if (string.length > maxLength) {
string = string.substr(0, maxLength) + '...';
}
return string;
};
/**
* @param {Function} func The function to get the name of.
* @return {string} The name of the function, or a snippet of the function's source code if it is an anonymous function.
*/
g.errorCatcher.getFunctionName = function(func) {
var name;
try {
if ('name' in Function.prototype && func.name) {
name = func.name;
} else {
var funcStr = func.toString();
var matches = /function ([^\(]+)/.exec(funcStr);
name = matches && matches[1] || '[anonymous function: ' + g.errorCatcher.shortenString(func.toString(), 90) + ']';
}
} catch(exception) {
name = '[inaccessible function]'
}
return name;
};
/**
* @param func The function to get a string describing the arguments for. Must be in the current callstack.
* @return {string} A string of the arguments passed to the function.
*/
g.errorCatcher.getFunctionArgumentsString = function(func) {
var argsStrings = [];
try {
var args = func.arguments;
if (args) {
for (var i = 0, length = args.length; i < length; i++) {
argsStrings.push(g.errorCatcher.stringify(args[i]));
}
}
} catch(exception) {
argsStrings.push('...?');
}
return '(' + argsStrings.join(',') + ')';
};
/**
* Converts objects and primitives to strings describing them. String inputs are redacted.
* @param {*} thing The object or primitive to describe.
* @return {string} String describing the input.
*/
g.errorCatcher.stringify = function(thing) {
var string = '[???]';
try {
var type = typeof thing;
string = '[' + type + '?]';
switch (type) {
case 'undefined':
string = 'undefined';
break;
case 'number':
case 'boolean':
string = thing.toString();
break;
case 'object':
if (thing == null) {
string = 'null';
break;
}
if (thing instanceof Date) {
string = 'new Date("' + thing.toString() + '")';
break;
}
var toStringValue = thing.toString();
if (/^\[[a-z ]*\]$/i.test(toStringValue)) {
string = toStringValue;
break;
}
if (typeof thing.length == 'number') {
string = '[arraylike object, length = ' + thing.length + ']';
break;
}
string = '[object]';
break;
case 'string':
string = '"' + g.errorCatcher.redactString(thing) + '"';
break;
case 'function':
string = '/* function */ ' + g.errorCatcher.getFunctionName(thing);
break;
default:
string = '[' + type + '???]';
break;
}
} catch(exception) { }
return string;
};
/**
* Finds quoted strings in a Firefox stacktrace and replaces them with redacted versions. Handles pesky escaped quotes
* too. This relies on Firefox's specific stringification/escaping behavior and might not work as consistently in other
* browsers.
* @param {string} stacktraceStr The stacktrace to redact strings from.
* @return {string} The stacktrace, with strings redacted.
*/
g.errorCatcher.redactFirefoxStacktraceStrings = function(stacktraceStr) {
if (!/\"/.test(stacktraceStr)) {
return stacktraceStr;
}
// We can safely use new ecmascript array methods because this code only runs in Firefox.
return stacktraceStr.split('\n').map(function(stacktraceLine) {
var quoteLocations = [];
var index = 0;
do {
index = (stacktraceLine.indexOf('"', index + 1));
if (index != -1) {
quoteLocations.push(index);
}
} while (index != -1);
quoteLocations = quoteLocations.filter(function(quoteLocation) {
var backslashCount = 0, index = quoteLocation;
while (index--) {
if (stacktraceLine.charAt(index) != '\\') {
break;
}
backslashCount = backslashCount + 1;
}
// If a quotation mark is preceded by a non-even number of backslashes, it is escaped. Otherwise, only the
// backslashes are escaped.
// \" escaped quote
// \\" escaped backslash, unescaped quote
// \\\" escaped backslash, escaped quote
// (etc)
return (backslashCount % 2 == 0);
});
if (quoteLocations.length % 2 == 1) {
quoteLocations.push(stacktraceLine.length);
}
for (var i = quoteLocations.length - 1; i > 0; i -= 2) {
stacktraceLine = stacktraceLine.substr(0, quoteLocations[i - 1] + 1) +
g.errorCatcher.redactString(stacktraceLine.substring(quoteLocations[i - 1] + 1, quoteLocations[i])) +
stacktraceLine.substr(quoteLocations[i]);
}
return stacktraceLine;
}).join('\n');
};
/**
* Redacts a string for user privacy.
* @param {string} str The string to redact.
* @return {string} The redacted string.
*/
g.errorCatcher.redactString = function(str) {
return '[string redacted]';
// This commented out alternative attempts to at least make certain types of string (HTML, for example) maintain a
// recognizable pattern.
// return g.errorCatcher.shortenString(str.replace(/[a-z]/g, 'x').replace(/[A-Z]/g, 'X').replace(/[0-9]/g, '#').replace(
// /[^\\\s\[\]<>xX\"\'\(\)\.\,\?\!\#\=\:\;\&\|\@\_\-]/g, '*'), 150).replace(/\r/g, '').replace(/\n/g, '\\n');
};
// g.errorCatcher can cause problems with debuggers (it breaks the Firebug console, for example), so it should be
// disabled in development environments. This if statements g.errorCatcher if you're using
if (!/dev/.test(window.location.host)) {
g.errorCatcher(function(errorObj) {
var key = '27461631-f992-4f72-b94d-b98996ef1a53';
var host = 'https://logs.loggly.com';
castor = new loggly({url: host+'/inputs/'+key+'?rt=1', level: 'log'});
castor.error(JSON.stringify({host: window.location.host, error: errorObj}));
}, function(str) {
// this is the URL redaction function. this one just removes ?q= paramter values, but you should adapt this to your own application if needed.
return str.replace(/([\#\?\&][Qq]\=)[^\=\&\#\s]*/g, '$1[redacted]');
});
}
/*
* Copyright 2010 Matthew Eernisse ([email protected])
* and Open Source Applications Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Credits: Ideas included from incomplete JS implementation of Olson
* parser, "XMLDAte" by Philippe Goetz ([email protected])
*
* Contributions:
* Jan Niehusmann
* Ricky Romero
* Preston Hunt ([email protected]),
* Dov. B Katz ([email protected]),
* Peter Bergström ([email protected])
*/
if (typeof timezoneJS == 'undefined') { timezoneJS = {}; }
timezoneJS.Date = function () {
var args = Array.prototype.slice.apply(arguments);
var t = null;
var dt = null;
var tz = null;
var utc = false;
// No args -- create a floating date based on the current local offset
if (args.length === 0) {
dt = new Date();
}
// Date string or timestamp -- assumes floating
else if (args.length == 1) {
dt = new Date(args[0]);
}
// year, month, [date,] [hours,] [minutes,] [seconds,] [milliseconds,] [tzId,] [utc]
else {
t = args[args.length-1];
// Last arg is utc
if (typeof t == 'boolean') {
utc = args.pop();
tz = args.pop();
}
// Last arg is tzId
else if (typeof t == 'string') {
tz = args.pop();
if (tz == 'Etc/UTC' || tz == 'Etc/GMT') {
utc = true;
}
}
// Date string (e.g., '12/27/2006')
t = args[args.length-1];
if (typeof t == 'string') {
dt = new Date(args[0]);
}
// Date part numbers
else {
var a = [];
for (var i = 0; i < 8; i++) {
a[i] = args[i] || 0;
}
dt = new Date(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
}
}
this._useCache = false;
this._tzInfo = {};
this._tzAbbr = '';
this._day = 0;
this.year = 0;
this.month = 0;
this.date = 0;
this.hours= 0;
this.minutes = 0;
this.seconds = 0;
this.milliseconds = 0;
this.timezone = tz || null;
this.utc = utc || false;
this.setFromDateObjProxy(dt);
};
timezoneJS.Date.prototype = {
getDate: function () { return this.date; },
getDay: function () { return this._day; },
getFullYear: function () { return this.year; },
getMonth: function () { return this.month; },
getYear: function () { return this.year; },
getHours: function () {
return this.hours;
},
getMilliseconds: function () {
return this.milliseconds;
},
getMinutes: function () {
return this.minutes;
},
getSeconds: function () {
return this.seconds;
},
getTime: function () {
var dt = Date.UTC(this.year, this.month, this.date,
this.hours, this.minutes, this.seconds, this.milliseconds);
return dt + (this.getTimezoneOffset()*60*1000);
},
getTimezone: function () {
return this.timezone;
},
getTimezoneOffset: function () {
var info = this.getTimezoneInfo();
return info.tzOffset;
},
getTimezoneAbbreviation: function () {
var info = this.getTimezoneInfo();
return info.tzAbbr;
},
getTimezoneInfo: function () {
var res;
if (this.utc) {
res = { tzOffset: 0,
tzAbbr: 'UTC' };
}
else {
if (this._useCache) {
res = this._tzInfo;
}
else {
if (this.timezone) {
var dt = new Date(Date.UTC(this.year, this.month, this.date,
this.hours, this.minutes, this.seconds, this.milliseconds));
var tz = this.timezone;
res = timezoneJS.timezone.getTzInfo(dt, tz);
}
// Floating -- use local offset
else {
res = { tzOffset: this.getLocalOffset(),
tzAbbr: null };
}
this._tzInfo = res;
this._useCache = true;
}
}
return res;
},
getUTCDate: function () {
return this.getUTCDateProxy().getUTCDate();
},
getUTCDay: function () {
return this.getUTCDateProxy().getUTCDay();
},
getUTCFullYear: function () {
return this.getUTCDateProxy().getUTCFullYear();
},
getUTCHours: function () {
return this.getUTCDateProxy().getUTCHours();
},
getUTCMilliseconds: function () {
return this.getUTCDateProxy().getUTCMilliseconds();
},
getUTCMinutes: function () {
return this.getUTCDateProxy().getUTCMinutes();
},
getUTCMonth: function () {
return this.getUTCDateProxy().getUTCMonth();
},
getUTCSeconds: function () {
return this.getUTCDateProxy().getUTCSeconds();
},
setDate: function (n) {
this.setAttribute('date', n);
},
setFullYear: function (n) {
this.setAttribute('year', n);
},
setMonth: function (n) {
this.setAttribute('month', n);
},
setYear: function (n) {
this.setUTCAttribute('year', n);
},
setHours: function (n) {
this.setAttribute('hours', n);
},
setMilliseconds: function (n) {
this.setAttribute('milliseconds', n);
},
setMinutes: function (n) {
this.setAttribute('minutes', n);
},
setSeconds: function (n) {
this.setAttribute('seconds', n);
},
setTime: function (n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
var dt = new Date(0);
dt.setUTCMilliseconds(n - (this.getTimezoneOffset()*60*1000));
this.setFromDateObjProxy(dt, true);
},
setUTCDate: function (n) {
this.setUTCAttribute('date', n);
},
setUTCFullYear: function (n) {
this.setUTCAttribute('year', n);
},
setUTCHours: function (n) {
this.setUTCAttribute('hours', n);
},
setUTCMilliseconds: function (n) {
this.setUTCAttribute('milliseconds', n);
},
setUTCMinutes: function (n) {
this.setUTCAttribute('minutes', n);
},
setUTCMonth: function (n) {
this.setUTCAttribute('month', n);
},
setUTCSeconds: function (n) {
this.setUTCAttribute('seconds', n);
},
toGMTString: function () {},
toLocaleString: function () {},
toLocaleDateString: function () {},
toLocaleTimeString: function () {},
toSource: function () {},
toString: function () {
// Get a quick looky at what's in there
var str = this.getFullYear() + '-' + (this.getMonth()+1) + '-' + this.getDate();
var hou = this.getHours() || 12;
hou = String(hou);
var min = String(this.getMinutes());
if (min.length == 1) { min = '0' + min; }
var sec = String(this.getSeconds());
if (sec.length == 1) { sec = '0' + sec; }
str += ' ' + hou;
str += ':' + min;
str += ':' + sec;
return str;
},
toUTCString: function () {},
valueOf: function () {
return this.getTime();
},
clone: function () {
return new timezoneJS.Date(this.year, this.month, this.date,
this.hours, this.minutes, this.seconds, this.milliseconds,
this.timezone);
},
setFromDateObjProxy: function (dt, fromUTC) {
this.year = fromUTC ? dt.getUTCFullYear() : dt.getFullYear();
this.month = fromUTC ? dt.getUTCMonth() : dt.getMonth();
this.date = fromUTC ? dt.getUTCDate() : dt.getDate();
this.hours = fromUTC ? dt.getUTCHours() : dt.getHours();
this.minutes = fromUTC ? dt.getUTCMinutes() : dt.getMinutes();
this.seconds = fromUTC ? dt.getUTCSeconds() : dt.getSeconds();
this.milliseconds = fromUTC ? dt.getUTCMilliseconds() : dt.getMilliseconds();
this._day = fromUTC ? dt.getUTCDay() : dt.getDay();
this._useCache = false;
},
getUTCDateProxy: function () {
var dt = new Date(Date.UTC(this.year, this.month, this.date,
this.hours, this.minutes, this.seconds, this.milliseconds));
dt.setUTCMinutes(dt.getUTCMinutes() + this.getTimezoneOffset());
return dt;
},
setAttribute: function (unit, n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
var dt = new Date(this.year, this.month, this.date,
this.hours, this.minutes, this.seconds, this.milliseconds);
var meth = unit == 'year' ? 'FullYear' : unit.substr(0, 1).toUpperCase() +
unit.substr(1);
dt['set' + meth](n);
this.setFromDateObjProxy(dt);
},
setUTCAttribute: function (unit, n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
var meth = unit == 'year' ? 'FullYear' : unit.substr(0, 1).toUpperCase() +
unit.substr(1);
var dt = this.getUTCDateProxy();
dt['setUTC' + meth](n);
dt.setUTCMinutes(dt.getUTCMinutes() - this.getTimezoneOffset());
this.setFromDateObjProxy(dt, true);
},
setTimezone: function (tz) {
if (tz == 'Etc/UTC' || tz == 'Etc/GMT') {
this.utc = true;
} else {
this.utc = false;
}
this.timezone = tz;
this._useCache = false;
},
removeTimezone: function () {
this.utc = false;
this.timezone = null;
this._useCache = false;
},
civilToJulianDayNumber: function (y, m, d) {
var a;
// Adjust for zero-based JS-style array
m++;
if (m > 12) {
a = parseInt(m/12, 10);
m = m % 12;
y += a;
}
if (m <= 2) {
y -= 1;
m += 12;
}
a = Math.floor(y / 100);
var b = 2 - a + Math.floor(a / 4);
jDt = Math.floor(365.25 * (y + 4716)) +
Math.floor(30.6001 * (m + 1)) +
d + b - 1524;
return jDt;
},
getLocalOffset: function () {
var dt = this;
var d = new Date(dt.getYear(), dt.getMonth(), dt.getDate(),
dt.getHours(), dt.getMinutes(), dt.getSeconds());
return d.getTimezoneOffset();
},
convertToTimezone: function(tz) {
var dt = new Date();
res = timezoneJS.timezone.getTzInfo(dt, tz);
convert_offset = this.getTimezoneOffset() - res.tzOffset // offset in minutes
converted_date = new timezoneJS.Date(this + convert_offset*60*1000)
this.setFromDateObjProxy(converted_date, true)
this.setTimezone(tz)
}
};
timezoneJS.timezone = new function() {
var _this = this;
var monthMap = { 'jan': 0, 'feb': 1, 'mar': 2, 'apr': 3,'may': 4, 'jun': 5, 'jul': 6, 'aug': 7, 'sep': 8, 'oct': 9, 'nov': 10, 'dec': 11 };
var dayMap = {'sun': 0,'mon' :1, 'tue': 2, 'wed': 3, 'thu': 4, 'fri': 5, 'sat': 6 };
var regionMap = {'EST':'northamerica','MST':'northamerica','HST':'northamerica','EST5EDT':'northamerica','CST6CDT':'northamerica','MST7MDT':'northamerica','PST8PDT':'northamerica','America':'northamerica','Pacific':'australasia','Atlantic':'europe','Africa':'africa','Indian':'africa','Antarctica':'antarctica','Asia':'asia','Australia':'australasia','Europe':'europe','WET':'europe','CET':'europe','MET':'europe','EET':'europe'};
var regionExceptions = {'Pacific/Honolulu':'northamerica','Atlantic/Bermuda':'northamerica','Atlantic/Cape_Verde':'africa','Atlantic/St_Helena':'africa','Indian/Kerguelen':'antarctica','Indian/Chagos':'asia','Indian/Maldives':'asia','Indian/Christmas':'australasia','Indian/Cocos':'australasia','America/Danmarkshavn':'europe','America/Scoresbysund':'europe','America/Godthab':'europe','America/Thule':'europe','Asia/Yekaterinburg':'europe','Asia/Omsk':'europe','Asia/Novosibirsk':'europe','Asia/Krasnoyarsk':'europe','Asia/Irkutsk':'europe','Asia/Yakutsk':'europe','Asia/Vladivostok':'europe','Asia/Sakhalin':'europe','Asia/Magadan':'europe','Asia/Kamchatka':'europe','Asia/Anadyr':'europe','Africa/Ceuta':'europe','America/Argentina/Buenos_Aires':'southamerica','America/Argentina/Cordoba':'southamerica','America/Argentina/Tucuman':'southamerica','America/Argentina/La_Rioja':'southamerica','America/Argentina/San_Juan':'southamerica','America/Argentina/Jujuy':'southamerica','America/Argentina/Catamarca':'southamerica','America/Argentina/Mendoza':'southamerica','America/Argentina/Rio_Gallegos':'southamerica','America/Argentina/Ushuaia':'southamerica','America/Aruba':'southamerica','America/La_Paz':'southamerica','America/Noronha':'southamerica','America/Belem':'southamerica','America/Fortaleza':'southamerica','America/Recife':'southamerica','America/Araguaina':'southamerica','America/Maceio':'southamerica','America/Bahia':'southamerica','America/Sao_Paulo':'southamerica','America/Campo_Grande':'southamerica','America/Cuiaba':'southamerica','America/Porto_Velho':'southamerica','America/Boa_Vista':'southamerica','America/Manaus':'southamerica','America/Eirunepe':'southamerica','America/Rio_Branco':'southamerica','America/Santiago':'southamerica','Pacific/Easter':'southamerica','America/Bogota':'southamerica','America/Curacao':'southamerica','America/Guayaquil':'southamerica','Pacific/Galapagos':'southamerica','Atlantic/Stanley':'southamerica','America/Cayenne':'southamerica','America/Guyana':'southamerica','America/Asuncion':'southamerica','America/Lima':'southamerica','Atlantic/South_Georgia':'southamerica','America/Paramaribo':'southamerica','America/Port_of_Spain':'southamerica','America/Montevideo':'southamerica','America/Caracas':'southamerica'};
function invalidTZError(t) {
throw new Error('Timezone "' + t + '" is either incorrect, or not loaded in the timezone registry.');
}
function getRegionForTimezone(tz) {
var exc = regionExceptions[tz];
var ret;
if (exc) {
return exc;
}
else {
reg = tz.split('/')[0];
ret = regionMap[reg];
// If there's nothing listed in the main regions for
// this TZ, check the 'backward' links
if (!ret) {
var link = _this.zones[tz];
if (typeof link == 'string') {
return getRegionForTimezone(link);
}
}
return ret;
}
}
function parseTimeString(str) {
var pat = /(\d+)(?::0*(\d*))?(?::0*(\d*))?([wsugz])?$/;
var hms = str.match(pat);
hms[1] = parseInt(hms[1], 10);
hms[2] = hms[2] ? parseInt(hms[2], 10) : 0;
hms[3] = hms[3] ? parseInt(hms[3], 10) : 0;
return hms;
}
function getZone(dt, tz) {
var t = tz;
var zoneList = _this.zones[t];
// Follow links to get to an acutal zone
while (typeof zoneList == "string") {
t = zoneList;
zoneList = _this.zones[t];
}
for(var i = 0; i < zoneList.length; i++) {
var z = zoneList[i];
if (!z[3]) { break; }
var yea = parseInt(z[3], 10);
var mon = 11;
var dat = 31;
if (z[4]) {
mon = monthMap[z[4].substr(0, 3).toLowerCase()];
dat = parseInt(z[5], 10);
}
var t = z[6] ? z[6] : '23:59:59';
t = parseTimeString(t);
var d = Date.UTC(yea, mon, dat, t[1], t[2], t[3]);
if (dt.getTime() < d) { break; }
}
if (i == zoneList.length) { throw new Error('No Zone found for "' + timezone + '" on ' + dt); }
return zoneList[i];
}
function getBasicOffset(z) {
var off = parseTimeString(z[0]);
var adj = z[0].indexOf('-') == 0 ? -1 : 1
off = adj * (((off[1] * 60 + off[2]) *60 + off[3]) * 1000);
return -off/60/1000;
}
// if isUTC is true, date is given in UTC, otherwise it's given
// in local time (ie. date.getUTC*() returns local time components)
function getRule( date, zone, isUTC ) {
var ruleset = zone[1];
var basicOffset = getBasicOffset( zone );
// Convert a date to UTC. Depending on the 'type' parameter, the date
// parameter may be:
// 'u', 'g', 'z': already UTC (no adjustment)
// 's': standard time (adjust for time zone offset but not for DST)
// 'w': wall clock time (adjust for both time zone and DST offset)
//
// DST adjustment is done using the rule given as third argument
var convertDateToUTC = function( date, type, rule ) {
var offset = 0;
if(type == 'u' || type == 'g' || type == 'z') { // UTC
offset = 0;
} else if(type == 's') { // Standard Time
offset = basicOffset;
} else if(type == 'w' || !type ) { // Wall Clock Time
offset = getAdjustedOffset(basicOffset,rule);
} else {
throw("unknown type "+type);
}
offset *= 60*1000; // to millis
return new Date( date.getTime() + offset );
}
// Step 1: Find applicable rules for this year.
// Step 2: Sort the rules by effective date.
// Step 3: Check requested date to see if a rule has yet taken effect this year. If not,
// Step 4: Get the rules for the previous year. If there isn't an applicable rule for last year, then
// there probably is no current time offset since they seem to explicitly turn off the offset
// when someone stops observing DST.
// FIXME if this is not the case and we'll walk all the way back (ugh).
// Step 5: Sort the rules by effective date.
// Step 6: Apply the most recent rule before the current time.
var convertRuleToExactDateAndTime = function( yearAndRule, prevRule )
{
var year = yearAndRule[0];
var rule = yearAndRule[1];
// Assume that the rule applies to the year of the given date.
var months = {
"Jan": 0, "Feb": 1, "Mar": 2, "Apr": 3, "May": 4, "Jun": 5,
"Jul": 6, "Aug": 7, "Sep": 8, "Oct": 9, "Nov": 10, "Dec": 11
};
var days = {
"sun": 0, "mon": 1, "tue": 2, "wed": 3, "thu": 4, "fri": 5, "sat": 6
}
var hms = parseTimeString( rule[ 5 ] );
var effectiveDate;
if ( !isNaN( rule[ 4 ] ) ) // If we have a specific date, use that!
{
effectiveDate = new Date( Date.UTC( year, months[ rule[ 3 ] ], rule[ 4 ], hms[ 1 ], hms[ 2 ], hms[ 3 ], 0 ) );
}
else // Let's hunt for the date.
{
var targetDay,
operator;
if ( rule[ 4 ].substr( 0, 4 ) === "last" ) // Example: lastThu
{
// Start at the last day of the month and work backward.
effectiveDate = new Date( Date.UTC( year, months[ rule[ 3 ] ] + 1, 1, hms[ 1 ] - 24, hms[ 2 ], hms[ 3 ], 0 ) );
targetDay = days[ rule[ 4 ].substr( 4, 3 ).toLowerCase( ) ];
operator = "<=";
}
else // Example: Sun>=15
{
// Start at the specified date.
effectiveDate = new Date( Date.UTC( year, months[ rule[ 3 ] ], rule[ 4 ].substr( 5 ), hms[ 1 ], hms[ 2 ], hms[ 3 ], 0 ) );
targetDay = days[ rule[ 4 ].substr( 0, 3 ).toLowerCase( ) ];
operator = rule[ 4 ].substr( 3, 2 );
}
var ourDay = effectiveDate.getUTCDay( );
if ( operator === ">=" ) // Go forwards.
{
effectiveDate.setUTCDate( effectiveDate.getUTCDate( ) + ( targetDay - ourDay + ( ( targetDay < ourDay ) ? 7 : 0 ) ) );
}
else // Go backwards. Looking for the last of a certain day, or operator is "<=" (less likely).
{
effectiveDate.setUTCDate( effectiveDate.getUTCDate( ) + ( targetDay - ourDay - ( ( targetDay > ourDay ) ? 7 : 0 ) ) );
}
}
// if previous rule is given, correct for the fact that the starting time of the current
// rule may be specified in local time
if(prevRule) {
effectiveDate = convertDateToUTC(effectiveDate, hms[4], prevRule);
}
return effectiveDate;
}
var findApplicableRules = function( year, ruleset )
{
var applicableRules = [];
for ( var i in ruleset )
{
if ( Number( ruleset[ i ][ 0 ] ) <= year ) // Exclude future rules.
{
if (
Number( ruleset[ i ][ 1 ] ) >= year // Date is in a set range.
|| ( Number( ruleset[ i ][ 0 ] ) === year && ruleset[ i ][ 1 ] === "only" ) // Date is in an "only" year.
|| ruleset[ i ][ 1 ] === "max" // We're in a range from the start year to infinity.
)
{
// It's completely okay to have any number of matches here.
// Normally we should only see two, but that doesn't preclude other numbers of matches.
// These matches are applicable to this year.
applicableRules.push( [year, ruleset[ i ]] );
}
}
}
return applicableRules;
}
var compareDates = function( a, b, prev )
{
if ( a.constructor !== Date ) {
a = convertRuleToExactDateAndTime( a, prev );
} else if(prev) {
a = convertDateToUTC(a, isUTC?'u':'w', prev);
}
if ( b.constructor !== Date ) {
b = convertRuleToExactDateAndTime( b, prev );
} else if(prev) {
b = convertDateToUTC(b, isUTC?'u':'w', prev);
}
a = Number( a );
b = Number( b );
return a - b;
}
var year = date.getUTCFullYear( );
var applicableRules;
applicableRules = findApplicableRules( year, _this.rules[ ruleset ] );
applicableRules.push( date );
// While sorting, the time zone in which the rule starting time is specified
// is ignored. This is ok as long as the timespan between two DST changes is
// larger than the DST offset, which is probably always true.
// As the given date may indeed be close to a DST change, it may get sorted
// to a wrong position (off by one), which is corrected below.
applicableRules.sort( compareDates );
if ( applicableRules.indexOf( date ) < 2 ) { // If there are not enough past DST rules...
applicableRules = applicableRules.concat(findApplicableRules( year-1, _this.rules[ ruleset ] ));
applicableRules.sort( compareDates );
}
var pinpoint = applicableRules.indexOf( date );
if ( pinpoint > 1 && compareDates( date, applicableRules[pinpoint-1], applicableRules[pinpoint-2][1] ) < 0 ) {
// the previous rule does not really apply, take the one before that
return applicableRules[ pinpoint - 2 ][1];
} else if ( pinpoint > 0 && pinpoint < applicableRules.length - 1 && compareDates( date, applicableRules[pinpoint+1], applicableRules[pinpoint-1][1] ) > 0) {
// the next rule does already apply, take that one
return applicableRules[ pinpoint + 1 ][1];
} else if ( pinpoint === 0 ) {
// no applicable rule found in this and in previous year
return null;
} else {
return applicableRules[ pinpoint - 1 ][1];
}
}
function getAdjustedOffset(off, rule) {
var save = rule[6];
var t = parseTimeString(save);
var adj = save.indexOf('-') == 0 ? -1 : 1;
var ret = (adj*(((t[1] *60 + t[2]) * 60 + t[3]) * 1000));
ret = ret/60/1000;
ret -= off
ret = -Math.ceil(ret);
return ret;
}
function getAbbreviation(zone, rule) {
var res;
var base = zone[2];
if (base.indexOf('%s') > -1) {
var repl;
if (rule) {
repl = rule[7]=='-'?'':rule[7];
}
// FIXME: Right now just falling back to Standard --
// apparently ought to use the last valid rule,
// although in practice that always ought to be Standard
else {
repl = 'S';
}
res = base.replace('%s', repl);
}
else if (base.indexOf('/') > -1) {
// chose one of two alternative strings
var t = parseTimeString(rule[6]);
var isDst = (t[1])||(t[2])||(t[3]);
res = base.split("/",2)[isDst?1:0];
} else {
res = base;
}
return res;
}
this.getTzInfo = function(dt, tz, isUTC) {
var zone = getZone(dt, tz);
var off = getBasicOffset(zone);
// See if the offset needs adjustment
var rule = getRule(dt, zone, isUTC);
if (rule) {
off = getAdjustedOffset(off, rule);
}
var abbr = getAbbreviation(zone, rule);
return { tzOffset: off, tzAbbr: abbr };
}
}
// Timezone data for: northamerica,europe
timezoneJS.timezone.zones = {"Europe/London":[["-0:01:15","-","LMT","1847","Dec","1","0:00s"],["0:00","GB-Eire","%s","1968","Oct","27"],["1:00","-","BST","1971","Oct","31","2:00u"],["0:00","GB-Eire","%s","1996"],["0:00","EU","GMT/BST"]],"Europe/Jersey":"Europe/London","Europe/Guernsey":"Europe/London","Europe/Isle_of_Man":"Europe/London","Europe/Dublin":[["-0:25:00","-","LMT","1880","Aug","2"],["-0:25:21","-","DMT","1916","May","21","2:00"],["-0:25:21","1:00","IST","1916","Oct","1","2:00s"],["0:00","GB-Eire","%s","1921","Dec","6",""],["0:00","GB-Eire","GMT/IST","1940","Feb","25","2:00"],["0:00","1:00","IST","1946","Oct","6","2:00"],["0:00","-","GMT","1947","Mar","16","2:00"],["0:00","1:00","IST","1947","Nov","2","2:00"],["0:00","-","GMT","1948","Apr","18","2:00"],["0:00","GB-Eire","GMT/IST","1968","Oct","27"],["1:00","-","IST","1971","Oct","31","2:00u"],["0:00","GB-Eire","GMT/IST","1996"],["0:00","EU","GMT/IST"]],"WET":[["0:00","EU","WE%sT"]],"CET":[["1:00","C-Eur","CE%sT"]],"MET":[["1:00","C-Eur","ME%sT"]],"EET":[["2:00","EU","EE%sT"]],"Europe/Tirane":[["1:19:20","-","LMT","1914"],["1:00","-","CET","1940","Jun","16"],["1:00","Albania","CE%sT","1984","Jul"],["1:00","EU","CE%sT"]],"Europe/Andorra":[["0:06:04","-","LMT","1901"],["0:00","-","WET","1946","Sep","30"],["1:00","-","CET","1985","Mar","31","2:00"],["1:00","EU","CE%sT"]],"Europe/Vienna":[["1:05:20","-","LMT","1893","Apr"],["1:00","C-Eur","CE%sT","1920"],["1:00","Austria","CE%sT","1940","Apr","1","2:00s"],["1:00","C-Eur","CE%sT","1945","Apr","2","2:00s"],["1:00","1:00","CEST","1945","Apr","12","2:00s"],["1:00","-","CET","1946"],["1:00","Austria","CE%sT","1981"],["1:00","EU","CE%sT"]],"Europe/Minsk":[["1:50:16","-","LMT","1880"],["1:50","-","MMT","1924","May","2",""],["2:00","-","EET","1930","Jun","21"],["3:00","-","MSK","1941","Jun","28"],["1:00","C-Eur","CE%sT","1944","Jul","3"],["3:00","Russia","MSK/MSD","1990"],["3:00","-","MSK","1991","Mar","31","2:00s"],["2:00","1:00","EEST","1991","Sep","29","2:00s"],["2:00","-","EET","1992","Mar","29","0:00s"],["2:00","1:00","EEST","1992","Sep","27","0:00s"],["2:00","Russia","EE%sT"]],"Europe/Brussels":[["0:17:30","-","LMT","1880"],["0:17:30","-","BMT","1892","May","1","12:00",""],["0:00","-","WET","1914","Nov","8"],["1:00","-","CET","1916","May","1","0:00"],["1:00","C-Eur","CE%sT","1918","Nov","11","11:00u"],["0:00","Belgium","WE%sT","1940","May","20","2:00s"],["1:00","C-Eur","CE%sT","1944","Sep","3"],["1:00","Belgium","CE%sT","1977"],["1:00","EU","CE%sT"]],"Europe/Sofia":[["1:33:16","-","LMT","1880"],["1:56:56","-","IMT","1894","Nov","30",""],["2:00","-","EET","1942","Nov","2","3:00"],["1:00","C-Eur","CE%sT","1945"],["1:00","-","CET","1945","Apr","2","3:00"],["2:00","-","EET","1979","Mar","31","23:00"],["2:00","Bulg","EE%sT","1982","Sep","26","2:00"],["2:00","C-Eur","EE%sT","1991"],["2:00","E-Eur","EE%sT","1997"],["2:00","EU","EE%sT"]],"Europe/Prague":[["0:57:44","-","LMT","1850"],["0:57:44","-","PMT","1891","Oct",""],["1:00","C-Eur","CE%sT","1944","Sep","17","2:00s"],["1:00","Czech","CE%sT","1979"],["1:00","EU","CE%sT"]],"Europe/Copenhagen":[["0:50:20","-","LMT","1890"],["0:50:20","-","CMT","1894","Jan","1",""],["1:00","Denmark","CE%sT","1942","Nov","2","2:00s"],["1:00","C-Eur","CE%sT","1945","Apr","2","2:00"],["1:00","Denmark","CE%sT","1980"],["1:00","EU","CE%sT"]],"Atlantic/Faroe":[["-0:27:04","-","LMT","1908","Jan","11",""],["0:00","-","WET","1981"],["0:00","EU","WE%sT"]],"America/Danmarkshavn":[["-1:14:40","-","LMT","1916","Jul","28"],["-3:00","-","WGT","1980","Apr","6","2:00"],["-3:00","EU","WG%sT","1996"],["0:00","-","GMT"]],"America/Scoresbysund":[["-1:27:52","-","LMT","1916","Jul","28",""],["-2:00","-","CGT","1980","Apr","6","2:00"],["-2:00","C-Eur","CG%sT","1981","Mar","29"],["-1:00","EU","EG%sT"]],"America/Godthab":[["-3:26:56","-","LMT","1916","Jul","28",""],["-3:00","-","WGT","1980","Apr","6","2:00"],["-3:00","EU","WG%sT"]],"America/Thule":[["-4:35:08","-","LMT","1916","Jul","28",""],["-4:00","Thule","A%sT"]],"Europe/Tallinn":[["1:39:00","-","LMT","1880"],["1:39:00","-","TMT","1918","Feb",""],["1:00","C-Eur","CE%sT","1919","Jul"],["1:39:00","-","TMT","1921","May"],["2:00","-","EET","1940","Aug","6"],["3:00","-","MSK","1941","Sep","15"],["1:00","C-Eur","CE%sT","1944","Sep","22"],["3:00","Russia","MSK/MSD","1989","Mar","26","2:00s"],["2:00","1:00","EEST","1989","Sep","24","2:00s"],["2:00","C-Eur","EE%sT","1998","Sep","22"],["2:00","EU","EE%sT","1999","Nov","1"],["2:00","-","EET","2002","Feb","21"],["2:00","EU","EE%sT"]],"Europe/Helsinki":[["1:39:52","-","LMT","1878","May","31"],["1:39:52","-","HMT","1921","May",""],["2:00","Finland","EE%sT","1983"],["2:00","EU","EE%sT"]],"Europe/Mariehamn":"Europe/Helsinki","Europe/Paris":[["0:09:21","-","LMT","1891","Mar","15","0:01"],["0:09:21","-","PMT","1911","Mar","11","0:01",""],["0:00","France","WE%sT","1940","Jun","14","23:00"],["1:00","C-Eur","CE%sT","1944","Aug","25"],["0:00","France","WE%sT","1945","Sep","16","3:00"],["1:00","France","CE%sT","1977"],["1:00","EU","CE%sT"]],"Europe/Berlin":[["0:53:28","-","LMT","1893","Apr"],["1:00","C-Eur","CE%sT","1945","May","24","2:00"],["1:00","SovietZone","CE%sT","1946"],["1:00","Germany","CE%sT","1980"],["1:00","EU","CE%sT"]],"Europe/Gibraltar":[["-0:21:24","-","LMT","1880","Aug","2","0:00s"],["0:00","GB-Eire","%s","1957","Apr","14","2:00"],["1:00","-","CET","1982"],["1:00","EU","CE%sT"]],"Europe/Athens":[["1:34:52","-","LMT","1895","Sep","14"],["1:34:52","-","AMT","1916","Jul","28","0:01",""],["2:00","Greece","EE%sT","1941","Apr","30"],["1:00","Greece","CE%sT","1944","Apr","4"],["2:00","Greece","EE%sT","1981"],[""],[""],["2:00","EU","EE%sT"]],"Europe/Budapest":[["1:16:20","-","LMT","1890","Oct"],["1:00","C-Eur","CE%sT","1918"],["1:00","Hungary","CE%sT","1941","Apr","6","2:00"],["1:00","C-Eur","CE%sT","1945"],["1:00","Hungary","CE%sT","1980","Sep","28","2:00s"],["1:00","EU","CE%sT"]],"Atlantic/Reykjavik":[["-1:27:24","-","LMT","1837"],["-1:27:48","-","RMT","1908",""],["-1:00","Iceland","IS%sT","1968","Apr","7","1:00s"],["0:00","-","GMT"]],"Europe/Rome":[["0:49:56","-","LMT","1866","Sep","22"],["0:49:56","-","RMT","1893","Nov","1","0:00s",""],["1:00","Italy","CE%sT","1942","Nov","2","2:00s"],["1:00","C-Eur","CE%sT","1944","Jul"],["1:00","Italy","CE%sT","1980"],["1:00","EU","CE%sT"]],"Europe/Vatican":"Europe/Rome","Europe/San_Marino":"Europe/Rome","Europe/Riga":[["1:36:24","-","LMT","1880"],["1:36:24","-","RMT","1918","Apr","15","2:00",""],["1:36:24","1:00","LST","1918","Sep","16","3:00",""],["1:36:24","-","RMT","1919","Apr","1","2:00"],["1:36:24","1:00","LST","1919","May","22","3:00"],["1:36:24","-","RMT","1926","May","11"],["2:00","-","EET","1940","Aug","5"],["3:00","-","MSK","1941","Jul"],["1:00","C-Eur","CE%sT","1944","Oct","13"],["3:00","Russia","MSK/MSD","1989","Mar","lastSun","2:00s"],["2:00","1:00","EEST","1989","Sep","lastSun","2:00s"],["2:00","Latvia","EE%sT","1997","Jan","21"],["2:00","EU","EE%sT","2000","Feb","29"],["2:00","-","EET","2001","Jan","2"],["2:00","EU","EE%sT"]],"Europe/Vaduz":[["0:38:04","-","LMT","1894","Jun"],["1:00","-","CET","1981"],["1:00","EU","CE%sT"]],"Europe/Vilnius":[["1:41:16","-","LMT","1880"],["1:24:00","-","WMT","1917",""],["1:35:36","-","KMT","1919","Oct","10",""],["1:00","-","CET","1920","Jul","12"],["2:00","-","EET","1920","Oct","9"],["1:00","-","CET","1940","Aug","3"],["3:00","-","MSK","1941","Jun","24"],["1:00","C-Eur","CE%sT","1944","Aug"],["3:00","Russia","MSK/MSD","1991","Mar","31","2:00s"],["2:00","1:00","EEST","1991","Sep","29","2:00s"],["2:00","C-Eur","EE%sT","1998"],["2:00","-","EET","1998","Mar","29","1:00u"],["1:00","EU","CE%sT","1999","Oct","31","1:00u"],["2:00","-","EET","2003","Jan","1"],["2:00","EU","EE%sT"]],"Europe/Luxembourg":[["0:24:36","-","LMT","1904","Jun"],["1:00","Lux","CE%sT","1918","Nov","25"],["0:00","Lux","WE%sT","1929","Oct","6","2:00s"],["0:00","Belgium","WE%sT","1940","May","14","3:00"],["1:00","C-Eur","WE%sT","1944","Sep","18","3:00"],["1:00","Belgium","CE%sT","1977"],["1:00","EU","CE%sT"]],"Europe/Malta":[["0:58:04","-","LMT","1893","Nov","2","0:00s",""],["1:00","Italy","CE%sT","1942","Nov","2","2:00s"],["1:00","C-Eur","CE%sT","1945","Apr","2","2:00s"],["1:00","Italy","CE%sT","1973","Mar","31"],["1:00","Malta","CE%sT","1981"],["1:00","EU","CE%sT"]],"Europe/Chisinau":[["1:55:20","-","LMT","1880"],["1:55","-","CMT","1918","Feb","15",""],["1:44:24","-","BMT","1931","Jul","24",""],["2:00","Romania","EE%sT","1940","Aug","15"],["2:00","1:00","EEST","1941","Jul","17"],["1:00","C-Eur","CE%sT","1944","Aug","24"],["3:00","Russia","MSK/MSD","1990"],["3:00","-","MSK","1990","May","6"],["2:00","-","EET","1991"],["2:00","Russia","EE%sT","1992"],["2:00","E-Eur","EE%sT","1997"],["2:00","EU","EE%sT"]],"Europe/Monaco":[["0:29:32","-","LMT","1891","Mar","15"],["0:09:21","-","PMT","1911","Mar","11",""],["0:00","France","WE%sT","1945","Sep","16","3:00"],["1:00","France","CE%sT","1977"],["1:00","EU","CE%sT"]],"Europe/Amsterdam":[["0:19:32","-","LMT","1835"],["0:19:32","Neth","%s","1937","Jul","1"],["0:20","Neth","NE%sT","1940","May","16","0:00",""],["1:00","C-Eur","CE%sT","1945","Apr","2","2:00"],["1:00","Neth","CE%sT","1977"],["1:00","EU","CE%sT"]],"Europe/Oslo":[["0:43:00","-","LMT","1895","Jan","1"],["1:00","Norway","CE%sT","1940","Aug","10","23:00"],["1:00","C-Eur","CE%sT","1945","Apr","2","2:00"],["1:00","Norway","CE%sT","1980"],["1:00","EU","CE%sT"]],"Arctic/Longyearbyen":"Europe/Oslo","Europe/Warsaw":[["1:24:00","-","LMT","1880"],["1:24:00","-","WMT","1915","Aug","5",""],["1:00","C-Eur","CE%sT","1918","Sep","16","3:00"],["2:00","Poland","EE%sT","1922","Jun"],["1:00","Poland","CE%sT","1940","Jun","23","2:00"],["1:00","C-Eur","CE%sT","1944","Oct"],["1:00","Poland","CE%sT","1977"],["1:00","W-Eur","CE%sT","1988"],["1:00","EU","CE%sT"]],"Europe/Lisbon":[["-0:36:32","-","LMT","1884"],["-0:36:32","-","LMT","1912","Jan","1",""],["0:00","Port","WE%sT","1966","Apr","3","2:00"],["1:00","-","CET","1976","Sep","26","1:00"],["0:00","Port","WE%sT","1983","Sep","25","1:00s"],["0:00","W-Eur","WE%sT","1992","Sep","27","1:00s"],["1:00","EU","CE%sT","1996","Mar","31","1:00u"],["0:00","EU","WE%sT"]],"Atlantic/Azores":[["-1:42:40","-","LMT","1884",""],["-1:54:32","-","HMT","1911","May","24",""],["-2:00","Port","AZO%sT","1966","Apr","3","2:00",""],["-1:00","Port","AZO%sT","1983","Sep","25","1:00s"],["-1:00","W-Eur","AZO%sT","1992","Sep","27","1:00s"],["0:00","EU","WE%sT","1993","Mar","28","1:00u"],["-1:00","EU","AZO%sT"]],"Atlantic/Madeira":[["-1:07:36","-","LMT","1884",""],["-1:07:36","-","FMT","1911","May","24",""],["-1:00","Port","MAD%sT","1966","Apr","3","2:00",""],["0:00","Port","WE%sT","1983","Sep","25","1:00s"],["0:00","EU","WE%sT"]],"Europe/Bucharest":[["1:44:24","-","LMT","1891","Oct"],["1:44:24","-","BMT","1931","Jul","24",""],["2:00","Romania","EE%sT","1981","Mar","29","2:00s"],["2:00","C-Eur","EE%sT","1991"],["2:00","Romania","EE%sT","1994"],["2:00","E-Eur","EE%sT","1997"],["2:00","EU","EE%sT"]],"Europe/Kaliningrad":[["1:22:00","-","LMT","1893","Apr"],["1:00","C-Eur","CE%sT","1945"],["2:00","Poland","CE%sT","1946"],["3:00","Russia","MSK/MSD","1991","Mar","31","2:00s"],["2:00","Russia","EE%sT","2011","Mar","27","2:00s"],["3:00","-","EET"]],"Europe/Moscow":[["2:30:20","-","LMT","1880"],["2:30","-","MMT","1916","Jul","3",""],["2:30:48","Russia","%s","1919","Jul","1","2:00"],["3:00","Russia","MSK/MSD","1922","Oct"],["2:00","-","EET","1930","Jun","21"],["3:00","Russia","MSK/MSD","1991","Mar","31","2:00s"],["2:00","Russia","EE%sT","1992","Jan","19","2:00s"],["3:00","Russia","MSK/MSD","2011","Mar","27","2:00s"],["4:00","-","MSK"]],"Europe/Volgograd":[["2:57:40","-","LMT","1920","Jan","3"],["3:00","-","TSAT","1925","Apr","6",""],["3:00","-","STAT","1930","Jun","21",""],["4:00","-","STAT","1961","Nov","11"],["4:00","Russia","VOL%sT","1989","Mar","26","2:00s",""],["3:00","Russia","VOL%sT","1991","Mar","31","2:00s"],["4:00","-","VOLT","1992","Mar","29","2:00s"],["3:00","Russia","VOL%sT","2011","Mar","27","2:00s"],["4:00","-","VOLT"]],"Europe/Samara":[["3:20:36","-","LMT","1919","Jul","1","2:00"],["3:00","-","SAMT","1930","Jun","21"],["4:00","-","SAMT","1935","Jan","27"],["4:00","Russia","KUY%sT","1989","Mar","26","2:00s",""],["3:00","Russia","KUY%sT","1991","Mar","31","2:00s"],["2:00","Russia","KUY%sT","1991","Sep","29","2:00s"],["3:00","-","KUYT","1991","Oct","20","3:00"],["4:00","Russia","SAM%sT","2010","Mar","28","2:00s",""],["3:00","Russia","SAM%sT","2011","Mar","27","2:00s"],["4:00","-","SAMT"]],"Asia/Yekaterinburg":[["4:02:24","-","LMT","1919","Jul","15","4:00"],["4:00","-","SVET","1930","Jun","21",""],["5:00","Russia","SVE%sT","1991","Mar","31","2:00s"],["4:00","Russia","SVE%sT","1992","Jan","19","2:00s"],["5:00","Russia","YEK%sT","2011","Mar","27","2:00s"],["6:00","-","YEKT",""]],"Asia/Omsk":[["4:53:36","-","LMT","1919","Nov","14"],["5:00","-","OMST","1930","Jun","21",""],["6:00","Russia","OMS%sT","1991","Mar","31","2:00s"],["5:00","Russia","OMS%sT","1992","Jan","19","2:00s"],["6:00","Russia","OMS%sT","2011","Mar","27","2:00s"],["7:00","-","OMST"]],"Asia/Novosibirsk":[["5:31:40","-","LMT","1919","Dec","14","6:00"],["6:00","-","NOVT","1930","Jun","21",""],["7:00","Russia","NOV%sT","1991","Mar","31","2:00s"],["6:00","Russia","NOV%sT","1992","Jan","19","2:00s"],["7:00","Russia","NOV%sT","1993","May","23",""],["6:00","Russia","NOV%sT","2011","Mar","27","2:00s"],["7:00","-","NOVT"]],"Asia/Novokuznetsk":[["5:48:48","-","NMT","1920","Jan","6"],["6:00","-","KRAT","1930","Jun","21",""],["7:00","Russia","KRA%sT","1991","Mar","31","2:00s"],["6:00","Russia","KRA%sT","1992","Jan","19","2:00s"],["7:00","Russia","KRA%sT","2010","Mar","28","2:00s"],["6:00","Russia","NOV%sT","2011","Mar","27","2:00s"],["7:00","-","NOVT",""]],"Asia/Krasnoyarsk":[["6:11:20","-","LMT","1920","Jan","6"],["6:00","-","KRAT","1930","Jun","21",""],["7:00","Russia","KRA%sT","1991","Mar","31","2:00s"],["6:00","Russia","KRA%sT","1992","Jan","19","2:00s"],["7:00","Russia","KRA%sT","2011","Mar","27","2:00s"],["8:00","-","KRAT"]],"Asia/Irkutsk":[["6:57:20","-","LMT","1880"],["6:57:20","-","IMT","1920","Jan","25",""],["7:00","-","IRKT","1930","Jun","21",""],["8:00","Russia","IRK%sT","1991","Mar","31","2:00s"],["7:00","Russia","IRK%sT","1992","Jan","19","2:00s"],["8:00","Russia","IRK%sT","2011","Mar","27","2:00s"],["9:00","-","IRKT"]],"Asia/Yakutsk":[["8:38:40","-","LMT","1919","Dec","15"],["8:00","-","YAKT","1930","Jun","21",""],["9:00","Russia","YAK%sT","1991","Mar","31","2:00s"],["8:00","Russia","YAK%sT","1992","Jan","19","2:00s"],["9:00","Russia","YAK%sT","2011","Mar","27","2:00s"],["10:00","-","YAKT"]],"Asia/Vladivostok":[["8:47:44","-","LMT","1922","Nov","15"],["9:00","-","VLAT","1930","Jun","21",""],["10:00","Russia","VLA%sT","1991","Mar","31","2:00s"],["9:00","Russia","VLA%sST","1992","Jan","19","2:00s"],["10:00","Russia","VLA%sT","2011","Mar","27","2:00s"],["11:00","-","VLAT"]],"Asia/Sakhalin":[["9:30:48","-","LMT","1905","Aug","23"],["9:00","-","CJT","1938"],["9:00","-","JST","1945","Aug","25"],["11:00","Russia","SAK%sT","1991","Mar","31","2:00s",""],["10:00","Russia","SAK%sT","1992","Jan","19","2:00s"],["11:00","Russia","SAK%sT","1997","Mar","lastSun","2:00s"],["10:00","Russia","SAK%sT","2011","Mar","27","2:00s"],["11:00","-","SAKT"]],"Asia/Magadan":[["10:03:12","-","LMT","1924","May","2"],["10:00","-","MAGT","1930","Jun","21",""],["11:00","Russia","MAG%sT","1991","Mar","31","2:00s"],["10:00","Russia","MAG%sT","1992","Jan","19","2:00s"],["11:00","Russia","MAG%sT","2011","Mar","27","2:00s"],["12:00","-","MAGT"]],"Asia/Kamchatka":[["10:34:36","-","LMT","1922","Nov","10"],["11:00","-","PETT","1930","Jun","21",""],["12:00","Russia","PET%sT","1991","Mar","31","2:00s"],["11:00","Russia","PET%sT","1992","Jan","19","2:00s"],["12:00","Russia","PET%sT","2010","Mar","28","2:00s"],["11:00","Russia","PET%sT","2011","Mar","27","2:00s"],["12:00","-","PETT"]],"Asia/Anadyr":[["11:49:56","-","LMT","1924","May","2"],["12:00","-","ANAT","1930","Jun","21",""],["13:00","Russia","ANA%sT","1982","Apr","1","0:00s"],["12:00","Russia","ANA%sT","1991","Mar","31","2:00s"],["11:00","Russia","ANA%sT","1992","Jan","19","2:00s"],["12:00","Russia","ANA%sT","2010","Mar","28","2:00s"],["11:00","Russia","ANA%sT","2011","Mar","27","2:00s"],["12:00","-","ANAT"]],"Europe/Belgrade":[["1:22:00","-","LMT","1884"],["1:00","-","CET","1941","Apr","18","23:00"],["1:00","C-Eur","CE%sT","1945"],["1:00","-","CET","1945","May","8","2:00s"],["1:00","1:00","CEST","1945","Sep","16","2:00s"],["1:00","-","CET","1982","Nov","27"],["1:00","EU","CE%sT"]],"Europe/Ljubljana":"Europe/Belgrade","Europe/Podgorica":"Europe/Belgrade","Europe/Sarajevo":"Europe/Belgrade","Europe/Skopje":"Europe/Belgrade","Europe/Zagreb":"Europe/Belgrade","Europe/Bratislava":"Europe/Prague","Europe/Madrid":[["-0:14:44","-","LMT","1901","Jan","1","0:00s"],["0:00","Spain","WE%sT","1946","Sep","30"],["1:00","Spain","CE%sT","1979"],["1:00","EU","CE%sT"]],"Africa/Ceuta":[["-0:21:16","-","LMT","1901"],["0:00","-","WET","1918","May","6","23:00"],["0:00","1:00","WEST","1918","Oct","7","23:00"],["0:00","-","WET","1924"],["0:00","Spain","WE%sT","1929"],["0:00","SpainAfrica","WE%sT","1984","Mar","16"],["1:00","-","CET","1986"],["1:00","EU","CE%sT"]],"Atlantic/Canary":[["-1:01:36","-","LMT","1922","Mar",""],["-1:00","-","CANT","1946","Sep","30","1:00",""],["0:00","-","WET","1980","Apr","6","0:00s"],["0:00","1:00","WEST","1980","Sep","28","0:00s"],["0:00","EU","WE%sT"]],"Europe/Stockholm":[["1:12:12","-","LMT","1879","Jan","1"],["1:00:14","-","SET","1900","Jan","1",""],["1:00","-","CET","1916","May","14","23:00"],["1:00","1:00","CEST","1916","Oct","1","01:00"],["1:00","-","CET","1980"],["1:00","EU","CE%sT"]],"Europe/Zurich":[["0:34:08","-","LMT","1848","Sep","12"],["0:29:44","-","BMT","1894","Jun",""],["1:00","Swiss","CE%sT","1981"],["1:00","EU","CE%sT"]],"Europe/Istanbul":[["1:55:52","-","LMT","1880"],["1:56:56","-","IMT","1910","Oct",""],["2:00","Turkey","EE%sT","1978","Oct","15"],["3:00","Turkey","TR%sT","1985","Apr","20",""],["2:00","Turkey","EE%sT","2007"],["2:00","EU","EE%sT","2011","Mar","27","1:00u"],["2:00","-","EET","2011","Mar","28","1:00u"],["2:00","EU","EE%sT"]],"Asia/Istanbul":"Europe/Istanbul","Europe/Kiev":[["2:02:04","-","LMT","1880"],["2:02:04","-","KMT","1924","May","2",""],["2:00","-","EET","1930","Jun","21"],["3:00","-","MSK","1941","Sep","20"],["1:00","C-Eur","CE%sT","1943","Nov","6"],["3:00","Russia","MSK/MSD","1990"],["3:00","-","MSK","1990","Jul","1","2:00"],["2:00","-","EET","1992"],["2:00","E-Eur","EE%sT","1995"],["2:00","EU","EE%sT"]],"Europe/Uzhgorod":[["1:29:12","-","LMT","1890","Oct"],["1:00","-","CET","1940"],["1:00","C-Eur","CE%sT","1944","Oct"],["1:00","1:00","CEST","1944","Oct","26"],["1:00","-","CET","1945","Jun","29"],["3:00","Russia","MSK/MSD","1990"],["3:00","-","MSK","1990","Jul","1","2:00"],["1:00","-","CET","1991","Mar","31","3:00"],["2:00","-","EET","1992"],["2:00","E-Eur","EE%sT","1995"],["2:00","EU","EE%sT"]],"Europe/Zaporozhye":[["2:20:40","-","LMT","1880"],["2:20","-","CUT","1924","May","2",""],["2:00","-","EET","1930","Jun","21"],["3:00","-","MSK","1941","Aug","25"],["1:00","C-Eur","CE%sT","1943","Oct","25"],["3:00","Russia","MSK/MSD","1991","Mar","31","2:00"],["2:00","E-Eur","EE%sT","1995"],["2:00","EU","EE%sT"]],"Europe/Simferopol":[["2:16:24","-","LMT","1880"],["2:16","-","SMT","1924","May","2",""],["2:00","-","EET","1930","Jun","21"],["3:00","-","MSK","1941","Nov"],["1:00","C-Eur","CE%sT","1944","Apr","13"],["3:00","Russia","MSK/MSD","1990"],["3:00","-","MSK","1990","Jul","1","2:00"],["2:00","-","EET","1992"],["2:00","E-Eur","EE%sT","1994","May"],["3:00","E-Eur","MSK/MSD","1996","Mar","31","3:00s"],["3:00","1:00","MSD","1996","Oct","27","3:00s"],["3:00","Russia","MSK/MSD","1997"],["3:00","-","MSK","1997","Mar","lastSun","1:00u"],["2:00","EU","EE%sT"]],"EST":[["-5:00","-","EST"]],"MST":[["-7:00","-","MST"]],"HST":[["-10:00","-","HST"]],"EST5EDT":[["-5:00","US","E%sT"]],"CST6CDT":[["-6:00","US","C%sT"]],"MST7MDT":[["-7:00","US","M%sT"]],"PST8PDT":[["-8:00","US","P%sT"]],"America/New_York":[["-4:56:02","-","LMT","1883","Nov","18","12:03:58"],["-5:00","US","E%sT","1920"],["-5:00","NYC","E%sT","1942"],["-5:00","US","E%sT","1946"],["-5:00","NYC","E%sT","1967"],["-5:00","US","E%sT"]],"America/Chicago":[["-5:50:36","-","LMT","1883","Nov","18","12:09:24"],["-6:00","US","C%sT","1920"],["-6:00","Chicago","C%sT","1936","Mar","1","2:00"],["-5:00","-","EST","1936","Nov","15","2:00"],["-6:00","Chicago","C%sT","1942"],["-6:00","US","C%sT","1946"],["-6:00","Chicago","C%sT","1967"],["-6:00","US","C%sT"]],"America/North_Dakota/Center":[["-6:45:12","-","LMT","1883","Nov","18","12:14:48"],["-7:00","US","M%sT","1992","Oct","25","02:00"],["-6:00","US","C%sT"]],"America/North_Dakota/New_Salem":[["-6:45:39","-","LMT","1883","Nov","18","12:14:21"],["-7:00","US","M%sT","2003","Oct","26","02:00"],["-6:00","US","C%sT"]],"America/North_Dakota/Beulah":[["-6:47:07","-","LMT","1883","Nov","18","12:12:53"],["-7:00","US","M%sT","2010","Nov","7","2:00"],["-6:00","US","C%sT"]],"America/Denver":[["-6:59:56","-","LMT","1883","Nov","18","12:00:04"],["-7:00","US","M%sT","1920"],["-7:00","Denver","M%sT","1942"],["-7:00","US","M%sT","1946"],["-7:00","Denver","M%sT","1967"],["-7:00","US","M%sT"]],"America/Los_Angeles":[["-7:52:58","-","LMT","1883","Nov","18","12:07:02"],["-8:00","US","P%sT","1946"],["-8:00","CA","P%sT","1967"],["-8:00","US","P%sT"]],"America/Juneau":[["15:02:19","-","LMT","1867","Oct","18"],["-8:57:41","-","LMT","1900","Aug","20","12:00"],["-8:00","-","PST","1942"],["-8:00","US","P%sT","1946"],["-8:00","-","PST","1969"],["-8:00","US","P%sT","1980","Apr","27","2:00"],["-9:00","US","Y%sT","1980","Oct","26","2:00",""],["-8:00","US","P%sT","1983","Oct","30","2:00"],["-9:00","US","Y%sT","1983","Nov","30"],["-9:00","US","AK%sT"]],"America/Sitka":[["-14:58:47","-","LMT","1867","Oct","18"],["-9:01:13","-","LMT","1900","Aug","20","12:00"],["-8:00","-","PST","1942"],["-8:00","US","P%sT","1946"],["-8:00","-","PST","1969"],["-8:00","US","P%sT","1983","Oct","30","2:00"],["-9:00","US","Y%sT","1983","Nov","30"],["-9:00","US","AK%sT"]],"America/Metlakatla":[["15:13:42","-","LMT","1867","Oct","18"],["-8:46:18","-","LMT","1900","Aug","20","12:00"],["-8:00","-","PST","1942"],["-8:00","US","P%sT","1946"],["-8:00","-","PST","1969"],["-8:00","US","P%sT","1983","Oct","30","2:00"],["-8:00","US","MeST"]],"America/Yakutat":[["14:41:05","-","LMT","1867","Oct","18"],["-9:18:55","-","LMT","1900","Aug","20","12:00"],["-9:00","-","YST","1942"],["-9:00","US","Y%sT","1946"],["-9:00","-","YST","1969"],["-9:00","US","Y%sT","1983","Nov","30"],["-9:00","US","AK%sT"]],"America/Anchorage":[["14:00:24","-","LMT","1867","Oct","18"],["-9:59:36","-","LMT","1900","Aug","20","12:00"],["-10:00","-","CAT","1942"],["-10:00","US","CAT/CAWT","1945","Aug","14","23:00u"],["-10:00","US","CAT/CAPT","1946",""],["-10:00","-","CAT","1967","Apr"],["-10:00","-","AHST","1969"],["-10:00","US","AH%sT","1983","Oct","30","2:00"],["-9:00","US","Y%sT","1983","Nov","30"],["-9:00","US","AK%sT"]],"America/Nome":[["12:58:21","-","LMT","1867","Oct","18"],["-11:01:38","-","LMT","1900","Aug","20","12:00"],["-11:00","-","NST","1942"],["-11:00","US","N%sT","1946"],["-11:00","-","NST","1967","Apr"],["-11:00","-","BST","1969"],["-11:00","US","B%sT","1983","Oct","30","2:00"],["-9:00","US","Y%sT","1983","Nov","30"],["-9:00","US","AK%sT"]],"America/Adak":[["12:13:21","-","LMT","1867","Oct","18"],["-11:46:38","-","LMT","1900","Aug","20","12:00"],["-11:00","-","NST","1942"],["-11:00","US","N%sT","1946"],["-11:00","-","NST","1967","Apr"],["-11:00","-","BST","1969"],["-11:00","US","B%sT","1983","Oct","30","2:00"],["-10:00","US","AH%sT","1983","Nov","30"],["-10:00","US","HA%sT"]],"Pacific/Honolulu":[["-10:31:26","-","LMT","1896","Jan","13","12:00",""],["-10:30","-","HST","1933","Apr","30","2:00",""],["-10:30","1:00","HDT","1933","May","21","12:00",""],["-10:30","-","HST","1942","Feb","09","2:00",""],["-10:30","1:00","HDT","1945","Sep","30","2:00",""],["-10:30","US","H%sT","1947","Jun","8","2:00",""],["-10:00","-","HST"]],"America/Phoenix":[["-7:28:18","-","LMT","1883","Nov","18","11:31:42"],["-7:00","US","M%sT","1944","Jan","1","00:01"],["-7:00","-","MST","1944","Apr","1","00:01"],["-7:00","US","M%sT","1944","Oct","1","00:01"],["-7:00","-","MST","1967"],["-7:00","US","M%sT","1968","Mar","21"],["-7:00","-","MST"]],"America/Shiprock":"America/Denver","America/Boise":[["-7:44:49","-","LMT","1883","Nov","18","12:15:11"],["-8:00","US","P%sT","1923","May","13","2:00"],["-7:00","US","M%sT","1974"],["-7:00","-","MST","1974","Feb","3","2:00"],["-7:00","US","M%sT"]],"America/Indiana/Indianapolis":[["-5:44:38","-","LMT","1883","Nov","18","12:15:22"],["-6:00","US","C%sT","1920"],["-6:00","Indianapolis","C%sT","1942"],["-6:00","US","C%sT","1946"],["-6:00","Indianapolis","C%sT","1955","Apr","24","2:00"],["-5:00","-","EST","1957","Sep","29","2:00"],["-6:00","-","CST","1958","Apr","27","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1971"],["-5:00","-","EST","2006"],["-5:00","US","E%sT"]],"America/Indiana/Marengo":[["-5:45:23","-","LMT","1883","Nov","18","12:14:37"],["-6:00","US","C%sT","1951"],["-6:00","Marengo","C%sT","1961","Apr","30","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1974","Jan","6","2:00"],["-6:00","1:00","CDT","1974","Oct","27","2:00"],["-5:00","US","E%sT","1976"],["-5:00","-","EST","2006"],["-5:00","US","E%sT"]],"America/Indiana/Vincennes":[["-5:50:07","-","LMT","1883","Nov","18","12:09:53"],["-6:00","US","C%sT","1946"],["-6:00","Vincennes","C%sT","1964","Apr","26","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1971"],["-5:00","-","EST","2006","Apr","2","2:00"],["-6:00","US","C%sT","2007","Nov","4","2:00"],["-5:00","US","E%sT"]],"America/Indiana/Tell_City":[["-5:47:03","-","LMT","1883","Nov","18","12:12:57"],["-6:00","US","C%sT","1946"],["-6:00","Perry","C%sT","1964","Apr","26","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1971"],["-5:00","-","EST","2006","Apr","2","2:00"],["-6:00","US","C%sT"]],"America/Indiana/Petersburg":[["-5:49:07","-","LMT","1883","Nov","18","12:10:53"],["-6:00","US","C%sT","1955"],["-6:00","Pike","C%sT","1965","Apr","25","2:00"],["-5:00","-","EST","1966","Oct","30","2:00"],["-6:00","US","C%sT","1977","Oct","30","2:00"],["-5:00","-","EST","2006","Apr","2","2:00"],["-6:00","US","C%sT","2007","Nov","4","2:00"],["-5:00","US","E%sT"]],"America/Indiana/Knox":[["-5:46:30","-","LMT","1883","Nov","18","12:13:30"],["-6:00","US","C%sT","1947"],["-6:00","Starke","C%sT","1962","Apr","29","2:00"],["-5:00","-","EST","1963","Oct","27","2:00"],["-6:00","US","C%sT","1991","Oct","27","2:00"],["-5:00","-","EST","2006","Apr","2","2:00"],["-6:00","US","C%sT"]],"America/Indiana/Winamac":[["-5:46:25","-","LMT","1883","Nov","18","12:13:35"],["-6:00","US","C%sT","1946"],["-6:00","Pulaski","C%sT","1961","Apr","30","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1971"],["-5:00","-","EST","2006","Apr","2","2:00"],["-6:00","US","C%sT","2007","Mar","11","2:00"],["-5:00","US","E%sT"]],"America/Indiana/Vevay":[["-5:40:16","-","LMT","1883","Nov","18","12:19:44"],["-6:00","US","C%sT","1954","Apr","25","2:00"],["-5:00","-","EST","1969"],["-5:00","US","E%sT","1973"],["-5:00","-","EST","2006"],["-5:00","US","E%sT"]],"America/Kentucky/Louisville":[["-5:43:02","-","LMT","1883","Nov","18","12:16:58"],["-6:00","US","C%sT","1921"],["-6:00","Louisville","C%sT","1942"],["-6:00","US","C%sT","1946"],["-6:00","Louisville","C%sT","1961","Jul","23","2:00"],["-5:00","-","EST","1968"],["-5:00","US","E%sT","1974","Jan","6","2:00"],["-6:00","1:00","CDT","1974","Oct","27","2:00"],["-5:00","US","E%sT"]],"America/Kentucky/Monticello":[["-5:39:24","-","LMT","1883","Nov","18","12:20:36"],["-6:00","US","C%sT","1946"],["-6:00","-","CST","1968"],["-6:00","US","C%sT","2000","Oct","29","2:00"],["-5:00","US","E%sT"]],"America/Detroit":[["-5:32:11","-","LMT","1905"],["-6:00","-","CST","1915","May","15","2:00"],["-5:00","-","EST","1942"],["-5:00","US","E%sT","1946"],["-5:00","Detroit","E%sT","1973"],["-5:00","US","E%sT","1975"],["-5:00","-","EST","1975","Apr","27","2:00"],["-5:00","US","E%sT"]],"America/Menominee":[["-5:50:27","-","LMT","1885","Sep","18","12:00"],["-6:00","US","C%sT","1946"],["-6:00","Menominee","C%sT","1969","Apr","27","2:00"],["-5:00","-","EST","1973","Apr","29","2:00"],["-6:00","US","C%sT"]],"America/St_Johns":[["-3:30:52","-","LMT","1884"],["-3:30:52","StJohns","N%sT","1918"],["-3:30:52","Canada","N%sT","1919"],["-3:30:52","StJohns","N%sT","1935","Mar","30"],["-3:30","StJohns","N%sT","1942","May","11"],["-3:30","Canada","N%sT","1946"],["-3:30","StJohns","N%sT"]],"America/Goose_Bay":[["-4:01:40","-","LMT","1884",""],["-3:30:52","-","NST","1918"],["-3:30:52","Canada","N%sT","1919"],["-3:30:52","-","NST","1935","Mar","30"],["-3:30","-","NST","1936"],["-3:30","StJohns","N%sT","1942","May","11"],["-3:30","Canada","N%sT","1946"],["-3:30","StJohns","N%sT","1966","Mar","15","2:00"],["-4:00","StJohns","A%sT"]],"America/Halifax":[["-4:14:24","-","LMT","1902","Jun","15"],["-4:00","Halifax","A%sT","1918"],["-4:00","Canada","A%sT","1919"],["-4:00","Halifax","A%sT","1942","Feb","9","2:00s"],["-4:00","Canada","A%sT","1946"],["-4:00","Halifax","A%sT","1974"],["-4:00","Canada","A%sT"]],"America/Glace_Bay":[["-3:59:48","-","LMT","1902","Jun","15"],["-4:00","Canada","A%sT","1953"],["-4:00","Halifax","A%sT","1954"],["-4:00","-","AST","1972"],["-4:00","Halifax","A%sT","1974"],["-4:00","Canada","A%sT"]],"America/Moncton":[["-4:19:08","-","LMT","1883","Dec","9"],["-5:00","-","EST","1902","Jun","15"],["-4:00","Canada","A%sT","1933"],["-4:00","Moncton","A%sT","1942"],["-4:00","Canada","A%sT","1946"],["-4:00","Moncton","A%sT","1973"],["-4:00","Canada","A%sT","1993"],["-4:00","Moncton","A%sT","2007"],["-4:00","Canada","A%sT"]],"America/Blanc-Sablon":[["-3:48:28","-","LMT","1884"],["-4:00","Canada","A%sT","1970"],["-4:00","-","AST"]],"America/Montreal":[["-4:54:16","-","LMT","1884"],["-5:00","Mont","E%sT","1918"],["-5:00","Canada","E%sT","1919"],["-5:00","Mont","E%sT","1942","Feb","9","2:00s"],["-5:00","Canada","E%sT","1946"],["-5:00","Mont","E%sT","1974"],["-5:00","Canada","E%sT"]],"America/Toronto":[["-5:17:32","-","LMT","1895"],["-5:00","Canada","E%sT","1919"],["-5:00","Toronto","E%sT","1942","Feb","9","2:00s"],["-5:00","Canada","E%sT","1946"],["-5:00","Toronto","E%sT","1974"],["-5:00","Canada","E%sT"]],"America/Thunder_Bay":[["-5:57:00","-","LMT","1895"],["-6:00","-","CST","1910"],["-5:00","-","EST","1942"],["-5:00","Canada","E%sT","1970"],["-5:00","Mont","E%sT","1973"],["-5:00","-","EST","1974"],["-5:00","Canada","E%sT"]],"America/Nipigon":[["-5:53:04","-","LMT","1895"],["-5:00","Canada","E%sT","1940","Sep","29"],["-5:00","1:00","EDT","1942","Feb","9","2:00s"],["-5:00","Canada","E%sT"]],"America/Rainy_River":[["-6:18:16","-","LMT","1895"],["-6:00","Canada","C%sT","1940","Sep","29"],["-6:00","1:00","CDT","1942","Feb","9","2:00s"],["-6:00","Canada","C%sT"]],"America/Atikokan":[["-6:06:28","-","LMT","1895"],["-6:00","Canada","C%sT","1940","Sep","29"],["-6:00","1:00","CDT","1942","Feb","9","2:00s"],["-6:00","Canada","C%sT","1945","Sep","30","2:00"],["-5:00","-","EST"]],"America/Winnipeg":[["-6:28:36","-","LMT","1887","Jul","16"],["-6:00","Winn","C%sT","2006"],["-6:00","Canada","C%sT"]],"America/Regina":[["-6:58:36","-","LMT","1905","Sep"],["-7:00","Regina","M%sT","1960","Apr","lastSun","2:00"],["-6:00","-","CST"]],"America/Swift_Current":[["-7:11:20","-","LMT","1905","Sep"],["-7:00","Canada","M%sT","1946","Apr","lastSun","2:00"],["-7:00","Regina","M%sT","1950"],["-7:00","Swift","M%sT","1972","Apr","lastSun","2:00"],["-6:00","-","CST"]],"America/Edmonton":[["-7:33:52","-","LMT","1906","Sep"],["-7:00","Edm","M%sT","1987"],["-7:00","Canada","M%sT"]],"America/Vancouver":[["-8:12:28","-","LMT","1884"],["-8:00","Vanc","P%sT","1987"],["-8:00","Canada","P%sT"]],"America/Dawson_Creek":[["-8:00:56","-","LMT","1884"],["-8:00","Canada","P%sT","1947"],["-8:00","Vanc","P%sT","1972","Aug","30","2:00"],["-7:00","-","MST"]],"America/Pangnirtung":[["0","-","zzz","1921",""],["-4:00","NT_YK","A%sT","1995","Apr","Sun>=1","2:00"],["-5:00","Canada","E%sT","1999","Oct","31","2:00"],["-6:00","Canada","C%sT","2000","Oct","29","2:00"],["-5:00","Canada","E%sT"]],"America/Iqaluit":[["0","-","zzz","1942","Aug",""],["-5:00","NT_YK","E%sT","1999","Oct","31","2:00"],["-6:00","Canada","C%sT","2000","Oct","29","2:00"],["-5:00","Canada","E%sT"]],"America/Resolute":[["0","-","zzz","1947","Aug","31",""],["-6:00","NT_YK","C%sT","2000","Oct","29","2:00"],["-5:00","-","EST","2001","Apr","1","3:00"],["-6:00","Canada","C%sT","2006","Oct","29","2:00"],["-5:00","Resolute","%sT"]],"America/Rankin_Inlet":[["0","-","zzz","1957",""],["-6:00","NT_YK","C%sT","2000","Oct","29","2:00"],["-5:00","-","EST","2001","Apr","1","3:00"],["-6:00","Canada","C%sT"]],"America/Cambridge_Bay":[["0","-","zzz","1920",""],["-7:00","NT_YK","M%sT","1999","Oct","31","2:00"],["-6:00","Canada","C%sT","2000","Oct","29","2:00"],["-5:00","-","EST","2000","Nov","5","0:00"],["-6:00","-","CST","2001","Apr","1","3:00"],["-7:00","Canada","M%sT"]],"America/Yellowknife":[["0","-","zzz","1935",""],["-7:00","NT_YK","M%sT","1980"],["-7:00","Canada","M%sT"]],"America/Inuvik":[["0","-","zzz","1953",""],["-8:00","NT_YK","P%sT","1979","Apr","lastSun","2:00"],["-7:00","NT_YK","M%sT","1980"],["-7:00","Canada","M%sT"]],"America/Whitehorse":[["-9:00:12","-","LMT","1900","Aug","20"],["-9:00","NT_YK","Y%sT","1966","Jul","1","2:00"],["-8:00","NT_YK","P%sT","1980"],["-8:00","Canada","P%sT"]],"America/Dawson":[["-9:17:40","-","LMT","1900","Aug","20"],["-9:00","NT_YK","Y%sT","1973","Oct","28","0:00"],["-8:00","NT_YK","P%sT","1980"],["-8:00","Canada","P%sT"]],"America/Cancun":[["-5:47:04","-","LMT","1922","Jan","1","0:12:56"],["-6:00","-","CST","1981","Dec","23"],["-5:00","Mexico","E%sT","1998","Aug","2","2:00"],["-6:00","Mexico","C%sT"]],"America/Merida":[["-5:58:28","-","LMT","1922","Jan","1","0:01:32"],["-6:00","-","CST","1981","Dec","23"],["-5:00","-","EST","1982","Dec","2"],["-6:00","Mexico","C%sT"]],"America/Matamoros":[["-6:40:00","-","LMT","1921","Dec","31","23:20:00"],["-6:00","-","CST","1988"],["-6:00","US","C%sT","1989"],["-6:00","Mexico","C%sT","2010"],["-6:00","US","C%sT"]],"America/Monterrey":[["-6:41:16","-","LMT","1921","Dec","31","23:18:44"],["-6:00","-","CST","1988"],["-6:00","US","C%sT","1989"],["-6:00","Mexico","C%sT"]],"America/Mexico_City":[["-6:36:36","-","LMT","1922","Jan","1","0:23:24"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","Mexico","C%sT","2001","Sep","30","02:00"],["-6:00","-","CST","2002","Feb","20"],["-6:00","Mexico","C%sT"]],"America/Ojinaga":[["-6:57:40","-","LMT","1922","Jan","1","0:02:20"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","-","CST","1996"],["-6:00","Mexico","C%sT","1998"],["-6:00","-","CST","1998","Apr","Sun>=1","3:00"],["-7:00","Mexico","M%sT","2010"],["-7:00","US","M%sT"]],"America/Chihuahua":[["-7:04:20","-","LMT","1921","Dec","31","23:55:40"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","-","CST","1996"],["-6:00","Mexico","C%sT","1998"],["-6:00","-","CST","1998","Apr","Sun>=1","3:00"],["-7:00","Mexico","M%sT"]],"America/Hermosillo":[["-7:23:52","-","LMT","1921","Dec","31","23:36:08"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","-","CST","1942","Apr","24"],["-7:00","-","MST","1949","Jan","14"],["-8:00","-","PST","1970"],["-7:00","Mexico","M%sT","1999"],["-7:00","-","MST"]],"America/Mazatlan":[["-7:05:40","-","LMT","1921","Dec","31","23:54:20"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","-","CST","1942","Apr","24"],["-7:00","-","MST","1949","Jan","14"],["-8:00","-","PST","1970"],["-7:00","Mexico","M%sT"]],"America/Bahia_Banderas":[["-7:01:00","-","LMT","1921","Dec","31","23:59:00"],["-7:00","-","MST","1927","Jun","10","23:00"],["-6:00","-","CST","1930","Nov","15"],["-7:00","-","MST","1931","May","1","23:00"],["-6:00","-","CST","1931","Oct"],["-7:00","-","MST","1932","Apr","1"],["-6:00","-","CST","1942","Apr","24"],["-7:00","-","MST","1949","Jan","14"],["-8:00","-","PST","1970"],["-7:00","Mexico","M%sT","2010","Apr","4","2:00"],["-6:00","Mexico","C%sT"]],"America/Tijuana":[["-7:48:04","-","LMT","1922","Jan","1","0:11:56"],["-7:00","-","MST","1924"],["-8:00","-","PST","1927","Jun","10","23:00"],["-7:00","-","MST","1930","Nov","15"],["-8:00","-","PST","1931","Apr","1"],["-8:00","1:00","PDT","1931","Sep","30"],["-8:00","-","PST","1942","Apr","24"],["-8:00","1:00","PWT","1945","Aug","14","23:00u"],["-8:00","1:00","PPT","1945","Nov","12",""],["-8:00","-","PST","1948","Apr","5"],["-8:00","1:00","PDT","1949","Jan","14"],["-8:00","-","PST","1954"],["-8:00","CA","P%sT","1961"],["-8:00","-","PST","1976"],["-8:00","US","P%sT","1996"],["-8:00","Mexico","P%sT","2001"],["-8:00","US","P%sT","2002","Feb","20"],["-8:00","Mexico","P%sT","2010"],["-8:00","US","P%sT"]],"America/Santa_Isabel":[["-7:39:28","-","LMT","1922","Jan","1","0:20:32"],["-7:00","-","MST","1924"],["-8:00","-","PST","1927","Jun","10","23:00"],["-7:00","-","MST","1930","Nov","15"],["-8:00","-","PST","1931","Apr","1"],["-8:00","1:00","PDT","1931","Sep","30"],["-8:00","-","PST","1942","Apr","24"],["-8:00","1:00","PWT","1945","Aug","14","23:00u"],["-8:00","1:00","PPT","1945","Nov","12",""],["-8:00","-","PST","1948","Apr","5"],["-8:00","1:00","PDT","1949","Jan","14"],["-8:00","-","PST","1954"],["-8:00","CA","P%sT","1961"],["-8:00","-","PST","1976"],["-8:00","US","P%sT","1996"],["-8:00","Mexico","P%sT","2001"],["-8:00","US","P%sT","2002","Feb","20"],["-8:00","Mexico","P%sT"]],"America/Anguilla":[["-4:12:16","-","LMT","1912","Mar","2"],["-4:00","-","AST"]],"America/Antigua":[["-4:07:12","-","LMT","1912","Mar","2"],["-5:00","-","EST","1951"],["-4:00","-","AST"]],"America/Nassau":[["-5:09:24","-","LMT","1912","Mar","2"],["-5:00","Bahamas","E%sT","1976"],["-5:00","US","E%sT"]],"America/Barbados":[["-3:58:28","-","LMT","1924",""],["-3:58:28","-","BMT","1932",""],["-4:00","Barb","A%sT"]],"America/Belize":[["-5:52:48","-","LMT","1912","Apr"],["-6:00","Belize","C%sT"]],"Atlantic/Bermuda":[["-4:19:04","-","LMT","1930","Jan","1","2:00",""],["-4:00","-","AST","1974","Apr","28","2:00"],["-4:00","Bahamas","A%sT","1976"],["-4:00","US","A%sT"]],"America/Cayman":[["-5:25:32","-","LMT","1890",""],["-5:07:12","-","KMT","1912","Feb",""],["-5:00","-","EST"]],"America/Costa_Rica":[["-5:36:20","-","LMT","1890",""],["-5:36:20","-","SJMT","1921","Jan","15",""],["-6:00","CR","C%sT"]],"America/Havana":[["-5:29:28","-","LMT","1890"],["-5:29:36","-","HMT","1925","Jul","19","12:00",""],["-5:00","Cuba","C%sT"]],"America/Dominica":[["-4:05:36","-","LMT","1911","Jul","1","0:01",""],["-4:00","-","AST"]],"America/Santo_Domingo":[["-4:39:36","-","LMT","1890"],["-4:40","-","SDMT","1933","Apr","1","12:00",""],["-5:00","DR","E%sT","1974","Oct","27"],["-4:00","-","AST","2000","Oct","29","02:00"],["-5:00","US","E%sT","2000","Dec","3","01:00"],["-4:00","-","AST"]],"America/El_Salvador":[["-5:56:48","-","LMT","1921",""],["-6:00","Salv","C%sT"]],"America/Grenada":[["-4:07:00","-","LMT","1911","Jul",""],["-4:00","-","AST"]],"America/Guadeloupe":[["-4:06:08","-","LMT","1911","Jun","8",""],["-4:00","-","AST"]],"America/St_Barthelemy":"America/Guadeloupe","America/Marigot":"America/Guadeloupe","America/Guatemala":[["-6:02:04","-","LMT","1918","Oct","5"],["-6:00","Guat","C%sT"]],"America/Port-au-Prince":[["-4:49:20","-","LMT","1890"],["-4:49","-","PPMT","1917","Jan","24","12:00",""],["-5:00","Haiti","E%sT"]],"America/Tegucigalpa":[["-5:48:52","-","LMT","1921","Apr"],["-6:00","Hond","C%sT"]],"America/Jamaica":[["-5:07:12","-","LMT","1890",""],["-5:07:12","-","KMT","1912","Feb",""],["-5:00","-","EST","1974","Apr","28","2:00"],["-5:00","US","E%sT","1984"],["-5:00","-","EST"]],"America/Martinique":[["-4:04:20","-","LMT","1890",""],["-4:04:20","-","FFMT","1911","May",""],["-4:00","-","AST","1980","Apr","6"],["-4:00","1:00","ADT","1980","Sep","28"],["-4:00","-","AST"]],"America/Montserrat":[["-4:08:52","-","LMT","1911","Jul","1","0:01",""],["-4:00","-","AST"]],"America/Managua":[["-5:45:08","-","LMT","1890"],["-5:45:12","-","MMT","1934","Jun","23",""],["-6:00","-","CST","1973","May"],["-5:00","-","EST","1975","Feb","16"],["-6:00","Nic","C%sT","1992","Jan","1","4:00"],["-5:00","-","EST","1992","Sep","24"],["-6:00","-","CST","1993"],["-5:00","-","EST","1997"],["-6:00","Nic","C%sT"]],"America/Panama":[["-5:18:08","-","LMT","1890"],["-5:19:36","-","CMT","1908","Apr","22",""],["-5:00","-","EST"]],"America/Puerto_Rico":[["-4:24:25","-","LMT","1899","Mar","28","12:00",""],["-4:00","-","AST","1942","May","3"],["-4:00","US","A%sT","1946"],["-4:00","-","AST"]],"America/St_Kitts":[["-4:10:52","-","LMT","1912","Mar","2",""],["-4:00","-","AST"]],"America/St_Lucia":[["-4:04:00","-","LMT","1890",""],["-4:04:00","-","CMT","1912",""],["-4:00","-","AST"]],"America/Miquelon":[["-3:44:40","-","LMT","1911","May","15",""],["-4:00","-","AST","1980","May"],["-3:00","-","PMST","1987",""],["-3:00","Canada","PM%sT"]],"America/St_Vincent":[["-4:04:56","-","LMT","1890",""],["-4:04:56","-","KMT","1912",""],["-4:00","-","AST"]],"America/Grand_Turk":[["-4:44:32","-","LMT","1890"],["-5:07:12","-","KMT","1912","Feb",""],["-5:00","TC","E%sT"]],"America/Tortola":[["-4:18:28","-","LMT","1911","Jul",""],["-4:00","-","AST"]],"America/St_Thomas":[["-4:19:44","-","LMT","1911","Jul",""],["-4:00","-","AST"]]};
timezoneJS.timezone.rules = {"GB-Eire":[["1916","only","-","May","21","2:00s","1:00","BST"],["1916","only","-","Oct","1","2:00s","0","GMT"],["1917","only","-","Apr","8","2:00s","1:00","BST"],["1917","only","-","Sep","17","2:00s","0","GMT"],["1918","only","-","Mar","24","2:00s","1:00","BST"],["1918","only","-","Sep","30","2:00s","0","GMT"],["1919","only","-","Mar","30","2:00s","1:00","BST"],["1919","only","-","Sep","29","2:00s","0","GMT"],["1920","only","-","Mar","28","2:00s","1:00","BST"],["1920","only","-","Oct","25","2:00s","0","GMT"],["1921","only","-","Apr","3","2:00s","1:00","BST"],["1921","only","-","Oct","3","2:00s","0","GMT"],["1922","only","-","Mar","26","2:00s","1:00","BST"],["1922","only","-","Oct","8","2:00s","0","GMT"],["1923","only","-","Apr","Sun>=16","2:00s","1:00","BST"],["1923","1924","-","Sep","Sun>=16","2:00s","0","GMT"],["1924","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1925","1926","-","Apr","Sun>=16","2:00s","1:00","BST"],["1925","1938","-","Oct","Sun>=2","2:00s","0","GMT"],["1927","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1928","1929","-","Apr","Sun>=16","2:00s","1:00","BST"],["1930","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1931","1932","-","Apr","Sun>=16","2:00s","1:00","BST"],["1933","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1934","only","-","Apr","Sun>=16","2:00s","1:00","BST"],["1935","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1936","1937","-","Apr","Sun>=16","2:00s","1:00","BST"],["1938","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1939","only","-","Apr","Sun>=16","2:00s","1:00","BST"],["1939","only","-","Nov","Sun>=16","2:00s","0","GMT"],["1940","only","-","Feb","Sun>=23","2:00s","1:00","BST"],["1941","only","-","May","Sun>=2","1:00s","2:00","BDST"],["1941","1943","-","Aug","Sun>=9","1:00s","1:00","BST"],["1942","1944","-","Apr","Sun>=2","1:00s","2:00","BDST"],["1944","only","-","Sep","Sun>=16","1:00s","1:00","BST"],["1945","only","-","Apr","Mon>=2","1:00s","2:00","BDST"],["1945","only","-","Jul","Sun>=9","1:00s","1:00","BST"],["1945","1946","-","Oct","Sun>=2","2:00s","0","GMT"],["1946","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1947","only","-","Mar","16","2:00s","1:00","BST"],["1947","only","-","Apr","13","1:00s","2:00","BDST"],["1947","only","-","Aug","10","1:00s","1:00","BST"],["1947","only","-","Nov","2","2:00s","0","GMT"],["1948","only","-","Mar","14","2:00s","1:00","BST"],["1948","only","-","Oct","31","2:00s","0","GMT"],["1949","only","-","Apr","3","2:00s","1:00","BST"],["1949","only","-","Oct","30","2:00s","0","GMT"],["1950","1952","-","Apr","Sun>=14","2:00s","1:00","BST"],["1950","1952","-","Oct","Sun>=21","2:00s","0","GMT"],["1953","only","-","Apr","Sun>=16","2:00s","1:00","BST"],["1953","1960","-","Oct","Sun>=2","2:00s","0","GMT"],["1954","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1955","1956","-","Apr","Sun>=16","2:00s","1:00","BST"],["1957","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1958","1959","-","Apr","Sun>=16","2:00s","1:00","BST"],["1960","only","-","Apr","Sun>=9","2:00s","1:00","BST"],["1961","1963","-","Mar","lastSun","2:00s","1:00","BST"],["1961","1968","-","Oct","Sun>=23","2:00s","0","GMT"],["1964","1967","-","Mar","Sun>=19","2:00s","1:00","BST"],["1968","only","-","Feb","18","2:00s","1:00","BST"],["1972","1980","-","Mar","Sun>=16","2:00s","1:00","BST"],["1972","1980","-","Oct","Sun>=23","2:00s","0","GMT"],["1981","1995","-","Mar","lastSun","1:00u","1:00","BST"],["1981","1989","-","Oct","Sun>=23","1:00u","0","GMT"],["1990","1995","-","Oct","Sun>=22","1:00u","0","GMT"]],"EU":[["1977","1980","-","Apr","Sun>=1","1:00u","1:00","S"],["1977","only","-","Sep","lastSun","1:00u","0","-"],["1978","only","-","Oct","1","1:00u","0","-"],["1979","1995","-","Sep","lastSun","1:00u","0","-"],["1981","max","-","Mar","lastSun","1:00u","1:00","S"],["1996","max","-","Oct","lastSun","1:00u","0","-"]],"W-Eur":[["1977","1980","-","Apr","Sun>=1","1:00s","1:00","S"],["1977","only","-","Sep","lastSun","1:00s","0","-"],["1978","only","-","Oct","1","1:00s","0","-"],["1979","1995","-","Sep","lastSun","1:00s","0","-"],["1981","max","-","Mar","lastSun","1:00s","1:00","S"],["1996","max","-","Oct","lastSun","1:00s","0","-"]],"C-Eur":[["1916","only","-","Apr","30","23:00","1:00","S"],["1916","only","-","Oct","1","1:00","0","-"],["1917","1918","-","Apr","Mon>=15","2:00s","1:00","S"],["1917","1918","-","Sep","Mon>=15","2:00s","0","-"],["1940","only","-","Apr","1","2:00s","1:00","S"],["1942","only","-","Nov","2","2:00s","0","-"],["1943","only","-","Mar","29","2:00s","1:00","S"],["1943","only","-","Oct","4","2:00s","0","-"],["1944","1945","-","Apr","Mon>=1","2:00s","1:00","S"],["1944","only","-","Oct","2","2:00s","0","-"],["1945","only","-","Sep","16","2:00s","0","-"],["1977","1980","-","Apr","Sun>=1","2:00s","1:00","S"],["1977","only","-","Sep","lastSun","2:00s","0","-"],["1978","only","-","Oct","1","2:00s","0","-"],["1979","1995","-","Sep","lastSun","2:00s","0","-"],["1981","max","-","Mar","lastSun","2:00s","1:00","S"],["1996","max","-","Oct","lastSun","2:00s","0","-"]],"E-Eur":[["1977","1980","-","Apr","Sun>=1","0:00","1:00","S"],["1977","only","-","Sep","lastSun","0:00","0","-"],["1978","only","-","Oct","1","0:00","0","-"],["1979","1995","-","Sep","lastSun","0:00","0","-"],["1981","max","-","Mar","lastSun","0:00","1:00","S"],["1996","max","-","Oct","lastSun","0:00","0","-"]],"Russia":[["1917","only","-","Jul","1","23:00","1:00","MST",""],["1917","only","-","Dec","28","0:00","0","MMT",""],["1918","only","-","May","31","22:00","2:00","MDST",""],["1918","only","-","Sep","16","1:00","1:00","MST"],["1919","only","-","May","31","23:00","2:00","MDST"],["1919","only","-","Jul","1","2:00","1:00","S"],["1919","only","-","Aug","16","0:00","0","-"],["1921","only","-","Feb","14","23:00","1:00","S"],["1921","only","-","Mar","20","23:00","2:00","M",""],["1921","only","-","Sep","1","0:00","1:00","S"],["1921","only","-","Oct","1","0:00","0","-"],["1981","1984","-","Apr","1","0:00","1:00","S"],["1981","1983","-","Oct","1","0:00","0","-"],["1984","1991","-","Sep","lastSun","2:00s","0","-"],["1985","1991","-","Mar","lastSun","2:00s","1:00","S"],["1992","only","-","Mar","lastSat","23:00","1:00","S"],["1992","only","-","Sep","lastSat","23:00","0","-"],["1993","max","-","Mar","lastSun","2:00s","1:00","S"],["1993","1995","-","Sep","lastSun","2:00s","0","-"],["1996","max","-","Oct","lastSun","2:00s","0","-"]],"Albania":[["1940","only","-","Jun","16","0:00","1:00","S"],["1942","only","-","Nov","2","3:00","0","-"],["1943","only","-","Mar","29","2:00","1:00","S"],["1943","only","-","Apr","10","3:00","0","-"],["1974","only","-","May","4","0:00","1:00","S"],["1974","only","-","Oct","2","0:00","0","-"],["1975","only","-","May","1","0:00","1:00","S"],["1975","only","-","Oct","2","0:00","0","-"],["1976","only","-","May","2","0:00","1:00","S"],["1976","only","-","Oct","3","0:00","0","-"],["1977","only","-","May","8","0:00","1:00","S"],["1977","only","-","Oct","2","0:00","0","-"],["1978","only","-","May","6","0:00","1:00","S"],["1978","only","-","Oct","1","0:00","0","-"],["1979","only","-","May","5","0:00","1:00","S"],["1979","only","-","Sep","30","0:00","0","-"],["1980","only","-","May","3","0:00","1:00","S"],["1980","only","-","Oct","4","0:00","0","-"],["1981","only","-","Apr","26","0:00","1:00","S"],["1981","only","-","Sep","27","0:00","0","-"],["1982","only","-","May","2","0:00","1:00","S"],["1982","only","-","Oct","3","0:00","0","-"],["1983","only","-","Apr","18","0:00","1:00","S"],["1983","only","-","Oct","1","0:00","0","-"],["1984","only","-","Apr","1","0:00","1:00","S"]],"Austria":[["1920","only","-","Apr","5","2:00s","1:00","S"],["1920","only","-","Sep","13","2:00s","0","-"],["1946","only","-","Apr","14","2:00s","1:00","S"],["1946","1948","-","Oct","Sun>=1","2:00s","0","-"],["1947","only","-","Apr","6","2:00s","1:00","S"],["1948","only","-","Apr","18","2:00s","1:00","S"],["1980","only","-","Apr","6","0:00","1:00","S"],["1980","only","-","Sep","28","0:00","0","-"]],"Belgium":[["1918","only","-","Mar","9","0:00s","1:00","S"],["1918","1919","-","Oct","Sat>=1","23:00s","0","-"],["1919","only","-","Mar","1","23:00s","1:00","S"],["1920","only","-","Feb","14","23:00s","1:00","S"],["1920","only","-","Oct","23","23:00s","0","-"],["1921","only","-","Mar","14","23:00s","1:00","S"],["1921","only","-","Oct","25","23:00s","0","-"],["1922","only","-","Mar","25","23:00s","1:00","S"],["1922","1927","-","Oct","Sat>=1","23:00s","0","-"],["1923","only","-","Apr","21","23:00s","1:00","S"],["1924","only","-","Mar","29","23:00s","1:00","S"],["1925","only","-","Apr","4","23:00s","1:00","S"],["1926","only","-","Apr","17","23:00s","1:00","S"],["1927","only","-","Apr","9","23:00s","1:00","S"],["1928","only","-","Apr","14","23:00s","1:00","S"],["1928","1938","-","Oct","Sun>=2","2:00s","0","-"],["1929","only","-","Apr","21","2:00s","1:00","S"],["1930","only","-","Apr","13","2:00s","1:00","S"],["1931","only","-","Apr","19","2:00s","1:00","S"],["1932","only","-","Apr","3","2:00s","1:00","S"],["1933","only","-","Mar","26","2:00s","1:00","S"],["1934","only","-","Apr","8","2:00s","1:00","S"],["1935","only","-","Mar","31","2:00s","1:00","S"],["1936","only","-","Apr","19","2:00s","1:00","S"],["1937","only","-","Apr","4","2:00s","1:00","S"],["1938","only","-","Mar","27","2:00s","1:00","S"],["1939","only","-","Apr","16","2:00s","1:00","S"],["1939","only","-","Nov","19","2:00s","0","-"],["1940","only","-","Feb","25","2:00s","1:00","S"],["1944","only","-","Sep","17","2:00s","0","-"],["1945","only","-","Apr","2","2:00s","1:00","S"],["1945","only","-","Sep","16","2:00s","0","-"],["1946","only","-","May","19","2:00s","1:00","S"],["1946","only","-","Oct","7","2:00s","0","-"]],"Bulg":[["1979","only","-","Mar","31","23:00","1:00","S"],["1979","only","-","Oct","1","1:00","0","-"],["1980","1982","-","Apr","Sat>=1","23:00","1:00","S"],["1980","only","-","Sep","29","1:00","0","-"],["1981","only","-","Sep","27","2:00","0","-"]],"Czech":[["1945","only","-","Apr","8","2:00s","1:00","S"],["1945","only","-","Nov","18","2:00s","0","-"],["1946","only","-","May","6","2:00s","1:00","S"],["1946","1949","-","Oct","Sun>=1","2:00s","0","-"],["1947","only","-","Apr","20","2:00s","1:00","S"],["1948","only","-","Apr","18","2:00s","1:00","S"],["1949","only","-","Apr","9","2:00s","1:00","S"]],"Denmark":[["1916","only","-","May","14","23:00","1:00","S"],["1916","only","-","Sep","30","23:00","0","-"],["1940","only","-","May","15","0:00","1:00","S"],["1945","only","-","Apr","2","2:00s","1:00","S"],["1945","only","-","Aug","15","2:00s","0","-"],["1946","only","-","May","1","2:00s","1:00","S"],["1946","only","-","Sep","1","2:00s","0","-"],["1947","only","-","May","4","2:00s","1:00","S"],["1947","only","-","Aug","10","2:00s","0","-"],["1948","only","-","May","9","2:00s","1:00","S"],["1948","only","-","Aug","8","2:00s","0","-"]],"Thule":[["1991","1992","-","Mar","lastSun","2:00","1:00","D"],["1991","1992","-","Sep","lastSun","2:00","0","S"],["1993","2006","-","Apr","Sun>=1","2:00","1:00","D"],["1993","2006","-","Oct","lastSun","2:00","0","S"],["2007","max","-","Mar","Sun>=8","2:00","1:00","D"],["2007","max","-","Nov","Sun>=1","2:00","0","S"]],"Finland":[["1942","only","-","Apr","3","0:00","1:00","S"],["1942","only","-","Oct","3","0:00","0","-"],["1981","1982","-","Mar","lastSun","2:00","1:00","S"],["1981","1982","-","Sep","lastSun","3:00","0","-"]],"France":[["1916","only","-","Jun","14","23:00s","1:00","S"],["1916","1919","-","Oct","Sun>=1","23:00s","0","-"],["1917","only","-","Mar","24","23:00s","1:00","S"],["1918","only","-","Mar","9","23:00s","1:00","S"],["1919","only","-","Mar","1","23:00s","1:00","S"],["1920","only","-","Feb","14","23:00s","1:00","S"],["1920","only","-","Oct","23","23:00s","0","-"],["1921","only","-","Mar","14","23:00s","1:00","S"],["1921","only","-","Oct","25","23:00s","0","-"],["1922","only","-","Mar","25","23:00s","1:00","S"],["1922","1938","-","Oct","Sat>=1","23:00s","0","-"],["1923","only","-","May","26","23:00s","1:00","S"],["1924","only","-","Mar","29","23:00s","1:00","S"],["1925","only","-","Apr","4","23:00s","1:00","S"],["1926","only","-","Apr","17","23:00s","1:00","S"],["1927","only","-","Apr","9","23:00s","1:00","S"],["1928","only","-","Apr","14","23:00s","1:00","S"],["1929","only","-","Apr","20","23:00s","1:00","S"],["1930","only","-","Apr","12","23:00s","1:00","S"],["1931","only","-","Apr","18","23:00s","1:00","S"],["1932","only","-","Apr","2","23:00s","1:00","S"],["1933","only","-","Mar","25","23:00s","1:00","S"],["1934","only","-","Apr","7","23:00s","1:00","S"],["1935","only","-","Mar","30","23:00s","1:00","S"],["1936","only","-","Apr","18","23:00s","1:00","S"],["1937","only","-","Apr","3","23:00s","1:00","S"],["1938","only","-","Mar","26","23:00s","1:00","S"],["1939","only","-","Apr","15","23:00s","1:00","S"],["1939","only","-","Nov","18","23:00s","0","-"],["1940","only","-","Feb","25","2:00","1:00","S"],["1941","only","-","May","5","0:00","2:00","M",""],["1941","only","-","Oct","6","0:00","1:00","S"],["1942","only","-","Mar","9","0:00","2:00","M"],["1942","only","-","Nov","2","3:00","1:00","S"],["1943","only","-","Mar","29","2:00","2:00","M"],["1943","only","-","Oct","4","3:00","1:00","S"],["1944","only","-","Apr","3","2:00","2:00","M"],["1944","only","-","Oct","8","1:00","1:00","S"],["1945","only","-","Apr","2","2:00","2:00","M"],["1945","only","-","Sep","16","3:00","0","-"],["1976","only","-","Mar","28","1:00","1:00","S"],["1976","only","-","Sep","26","1:00","0","-"]],"Germany":[["1946","only","-","Apr","14","2:00s","1:00","S"],["1946","only","-","Oct","7","2:00s","0","-"],["1947","1949","-","Oct","Sun>=1","2:00s","0","-"],["1947","only","-","Apr","6","3:00s","1:00","S"],["1947","only","-","May","11","2:00s","2:00","M"],["1947","only","-","Jun","29","3:00","1:00","S"],["1948","only","-","Apr","18","2:00s","1:00","S"],["1949","only","-","Apr","10","2:00s","1:00","S"]],"SovietZone":[["1945","only","-","May","24","2:00","2:00","M",""],["1945","only","-","Sep","24","3:00","1:00","S"],["1945","only","-","Nov","18","2:00s","0","-"]],"Greece":[["1932","only","-","Jul","7","0:00","1:00","S"],["1932","only","-","Sep","1","0:00","0","-"],["1941","only","-","Apr","7","0:00","1:00","S"],["1942","only","-","Nov","2","3:00","0","-"],["1943","only","-","Mar","30","0:00","1:00","S"],["1943","only","-","Oct","4","0:00","0","-"],["1952","only","-","Jul","1","0:00","1:00","S"],["1952","only","-","Nov","2","0:00","0","-"],["1975","only","-","Apr","12","0:00s","1:00","S"],["1975","only","-","Nov","26","0:00s","0","-"],["1976","only","-","Apr","11","2:00s","1:00","S"],["1976","only","-","Oct","10","2:00s","0","-"],["1977","1978","-","Apr","Sun>=1","2:00s","1:00","S"],["1977","only","-","Sep","26","2:00s","0","-"],["1978","only","-","Sep","24","4:00","0","-"],["1979","only","-","Apr","1","9:00","1:00","S"],["1979","only","-","Sep","29","2:00","0","-"],["1980","only","-","Apr","1","0:00","1:00","S"],["1980","only","-","Sep","28","0:00","0","-"]],"Hungary":[["1918","only","-","Apr","1","3:00","1:00","S"],["1918","only","-","Sep","29","3:00","0","-"],["1919","only","-","Apr","15","3:00","1:00","S"],["1919","only","-","Sep","15","3:00","0","-"],["1920","only","-","Apr","5","3:00","1:00","S"],["1920","only","-","Sep","30","3:00","0","-"],["1945","only","-","May","1","23:00","1:00","S"],["1945","only","-","Nov","3","0:00","0","-"],["1946","only","-","Mar","31","2:00s","1:00","S"],["1946","1949","-","Oct","Sun>=1","2:00s","0","-"],["1947","1949","-","Apr","Sun>=4","2:00s","1:00","S"],["1950","only","-","Apr","17","2:00s","1:00","S"],["1950","only","-","Oct","23","2:00s","0","-"],["1954","1955","-","May","23","0:00","1:00","S"],["1954","1955","-","Oct","3","0:00","0","-"],["1956","only","-","Jun","Sun>=1","0:00","1:00","S"],["1956","only","-","Sep","lastSun","0:00","0","-"],["1957","only","-","Jun","Sun>=1","1:00","1:00","S"],["1957","only","-","Sep","lastSun","3:00","0","-"],["1980","only","-","Apr","6","1:00","1:00","S"]],"Iceland":[["1917","1918","-","Feb","19","23:00","1:00","S"],["1917","only","-","Oct","21","1:00","0","-"],["1918","only","-","Nov","16","1:00","0","-"],["1939","only","-","Apr","29","23:00","1:00","S"],["1939","only","-","Nov","29","2:00","0","-"],["1940","only","-","Feb","25","2:00","1:00","S"],["1940","only","-","Nov","3","2:00","0","-"],["1941","only","-","Mar","2","1:00s","1:00","S"],["1941","only","-","Nov","2","1:00s","0","-"],["1942","only","-","Mar","8","1:00s","1:00","S"],["1942","only","-","Oct","25","1:00s","0","-"],["1943","1946","-","Mar","Sun>=1","1:00s","1:00","S"],["1943","1948","-","Oct","Sun>=22","1:00s","0","-"],["1947","1967","-","Apr","Sun>=1","1:00s","1:00","S"],["1949","only","-","Oct","30","1:00s","0","-"],["1950","1966","-","Oct","Sun>=22","1:00s","0","-"],["1967","only","-","Oct","29","1:00s","0","-"]],"Italy":[["1916","only","-","Jun","3","0:00s","1:00","S"],["1916","only","-","Oct","1","0:00s","0","-"],["1917","only","-","Apr","1","0:00s","1:00","S"],["1917","only","-","Sep","30","0:00s","0","-"],["1918","only","-","Mar","10","0:00s","1:00","S"],["1918","1919","-","Oct","Sun>=1","0:00s","0","-"],["1919","only","-","Mar","2","0:00s","1:00","S"],["1920","only","-","Mar","21","0:00s","1:00","S"],["1920","only","-","Sep","19","0:00s","0","-"],["1940","only","-","Jun","15","0:00s","1:00","S"],["1944","only","-","Sep","17","0:00s","0","-"],["1945","only","-","Apr","2","2:00","1:00","S"],["1945","only","-","Sep","15","0:00s","0","-"],["1946","only","-","Mar","17","2:00s","1:00","S"],["1946","only","-","Oct","6","2:00s","0","-"],["1947","only","-","Mar","16","0:00s","1:00","S"],["1947","only","-","Oct","5","0:00s","0","-"],["1948","only","-","Feb","29","2:00s","1:00","S"],["1948","only","-","Oct","3","2:00s","0","-"],["1966","1968","-","May","Sun>=22","0:00","1:00","S"],["1966","1969","-","Sep","Sun>=22","0:00","0","-"],["1969","only","-","Jun","1","0:00","1:00","S"],["1970","only","-","May","31","0:00","1:00","S"],["1970","only","-","Sep","lastSun","0:00","0","-"],["1971","1972","-","May","Sun>=22","0:00","1:00","S"],["1971","only","-","Sep","lastSun","1:00","0","-"],["1972","only","-","Oct","1","0:00","0","-"],["1973","only","-","Jun","3","0:00","1:00","S"],["1973","1974","-","Sep","lastSun","0:00","0","-"],["1974","only","-","May","26","0:00","1:00","S"],["1975","only","-","Jun","1","0:00s","1:00","S"],["1975","1977","-","Sep","lastSun","0:00s","0","-"],["1976","only","-","May","30","0:00s","1:00","S"],["1977","1979","-","May","Sun>=22","0:00s","1:00","S"],["1978","only","-","Oct","1","0:00s","0","-"],["1979","only","-","Sep","30","0:00s","0","-"]],"Latvia":[["1989","1996","-","Mar","lastSun","2:00s","1:00","S"],["1989","1996","-","Sep","lastSun","2:00s","0","-"]],"Lux":[["1916","only","-","May","14","23:00","1:00","S"],["1916","only","-","Oct","1","1:00","0","-"],["1917","only","-","Apr","28","23:00","1:00","S"],["1917","only","-","Sep","17","1:00","0","-"],["1918","only","-","Apr","Mon>=15","2:00s","1:00","S"],["1918","only","-","Sep","Mon>=15","2:00s","0","-"],["1919","only","-","Mar","1","23:00","1:00","S"],["1919","only","-","Oct","5","3:00","0","-"],["1920","only","-","Feb","14","23:00","1:00","S"],["1920","only","-","Oct","24","2:00","0","-"],["1921","only","-","Mar","14","23:00","1:00","S"],["1921","only","-","Oct","26","2:00","0","-"],["1922","only","-","Mar","25","23:00","1:00","S"],["1922","only","-","Oct","Sun>=2","1:00","0","-"],["1923","only","-","Apr","21","23:00","1:00","S"],["1923","only","-","Oct","Sun>=2","2:00","0","-"],["1924","only","-","Mar","29","23:00","1:00","S"],["1924","1928","-","Oct","Sun>=2","1:00","0","-"],["1925","only","-","Apr","5","23:00","1:00","S"],["1926","only","-","Apr","17","23:00","1:00","S"],["1927","only","-","Apr","9","23:00","1:00","S"],["1928","only","-","Apr","14","23:00","1:00","S"],["1929","only","-","Apr","20","23:00","1:00","S"]],"Malta":[["1973","only","-","Mar","31","0:00s","1:00","S"],["1973","only","-","Sep","29","0:00s","0","-"],["1974","only","-","Apr","21","0:00s","1:00","S"],["1974","only","-","Sep","16","0:00s","0","-"],["1975","1979","-","Apr","Sun>=15","2:00","1:00","S"],["1975","1980","-","Sep","Sun>=15","2:00","0","-"],["1980","only","-","Mar","31","2:00","1:00","S"]],"Neth":[["1916","only","-","May","1","0:00","1:00","NST",""],["1916","only","-","Oct","1","0:00","0","AMT",""],["1917","only","-","Apr","16","2:00s","1:00","NST"],["1917","only","-","Sep","17","2:00s","0","AMT"],["1918","1921","-","Apr","Mon>=1","2:00s","1:00","NST"],["1918","1921","-","Sep","lastMon","2:00s","0","AMT"],["1922","only","-","Mar","lastSun","2:00s","1:00","NST"],["1922","1936","-","Oct","Sun>=2","2:00s","0","AMT"],["1923","only","-","Jun","Fri>=1","2:00s","1:00","NST"],["1924","only","-","Mar","lastSun","2:00s","1:00","NST"],["1925","only","-","Jun","Fri>=1","2:00s","1:00","NST"],["1926","1931","-","May","15","2:00s","1:00","NST"],["1932","only","-","May","22","2:00s","1:00","NST"],["1933","1936","-","May","15","2:00s","1:00","NST"],["1937","only","-","May","22","2:00s","1:00","NST"],["1937","only","-","Jul","1","0:00","1:00","S"],["1937","1939","-","Oct","Sun>=2","2:00s","0","-"],["1938","1939","-","May","15","2:00s","1:00","S"],["1945","only","-","Apr","2","2:00s","1:00","S"],["1945","only","-","Sep","16","2:00s","0","-"]],"Norway":[["1916","only","-","May","22","1:00","1:00","S"],["1916","only","-","Sep","30","0:00","0","-"],["1945","only","-","Apr","2","2:00s","1:00","S"],["1945","only","-","Oct","1","2:00s","0","-"],["1959","1964","-","Mar","Sun>=15","2:00s","1:00","S"],["1959","1965","-","Sep","Sun>=15","2:00s","0","-"],["1965","only","-","Apr","25","2:00s","1:00","S"]],"Poland":[["1918","1919","-","Sep","16","2:00s","0","-"],["1919","only","-","Apr","15","2:00s","1:00","S"],["1944","only","-","Apr","3","2:00s","1:00","S"],["1944","only","-","Oct","4","2:00","0","-"],["1945","only","-","Apr","29","0:00","1:00","S"],["1945","only","-","Nov","1","0:00","0","-"],["1946","only","-","Apr","14","0:00s","1:00","S"],["1946","only","-","Oct","7","2:00s","0","-"],["1947","only","-","May","4","2:00s","1:00","S"],["1947","1949","-","Oct","Sun>=1","2:00s","0","-"],["1948","only","-","Apr","18","2:00s","1:00","S"],["1949","only","-","Apr","10","2:00s","1:00","S"],["1957","only","-","Jun","2","1:00s","1:00","S"],["1957","1958","-","Sep","lastSun","1:00s","0","-"],["1958","only","-","Mar","30","1:00s","1:00","S"],["1959","only","-","May","31","1:00s","1:00","S"],["1959","1961","-","Oct","Sun>=1","1:00s","0","-"],["1960","only","-","Apr","3","1:00s","1:00","S"],["1961","1964","-","May","lastSun","1:00s","1:00","S"],["1962","1964","-","Sep","lastSun","1:00s","0","-"]],"Port":[["1916","only","-","Jun","17","23:00","1:00","S"],["1916","only","-","Nov","1","1:00","0","-"],["1917","only","-","Feb","28","23:00s","1:00","S"],["1917","1921","-","Oct","14","23:00s","0","-"],["1918","only","-","Mar","1","23:00s","1:00","S"],["1919","only","-","Feb","28","23:00s","1:00","S"],["1920","only","-","Feb","29","23:00s","1:00","S"],["1921","only","-","Feb","28","23:00s","1:00","S"],["1924","only","-","Apr","16","23:00s","1:00","S"],["1924","only","-","Oct","14","23:00s","0","-"],["1926","only","-","Apr","17","23:00s","1:00","S"],["1926","1929","-","Oct","Sat>=1","23:00s","0","-"],["1927","only","-","Apr","9","23:00s","1:00","S"],["1928","only","-","Apr","14","23:00s","1:00","S"],["1929","only","-","Apr","20","23:00s","1:00","S"],["1931","only","-","Apr","18","23:00s","1:00","S"],["1931","1932","-","Oct","Sat>=1","23:00s","0","-"],["1932","only","-","Apr","2","23:00s","1:00","S"],["1934","only","-","Apr","7","23:00s","1:00","S"],["1934","1938","-","Oct","Sat>=1","23:00s","0","-"],["1935","only","-","Mar","30","23:00s","1:00","S"],["1936","only","-","Apr","18","23:00s","1:00","S"],["1937","only","-","Apr","3","23:00s","1:00","S"],["1938","only","-","Mar","26","23:00s","1:00","S"],["1939","only","-","Apr","15","23:00s","1:00","S"],["1939","only","-","Nov","18","23:00s","0","-"],["1940","only","-","Feb","24","23:00s","1:00","S"],["1940","1941","-","Oct","5","23:00s","0","-"],["1941","only","-","Apr","5","23:00s","1:00","S"],["1942","1945","-","Mar","Sat>=8","23:00s","1:00","S"],["1942","only","-","Apr","25","22:00s","2:00","M",""],["1942","only","-","Aug","15","22:00s","1:00","S"],["1942","1945","-","Oct","Sat>=24","23:00s","0","-"],["1943","only","-","Apr","17","22:00s","2:00","M"],["1943","1945","-","Aug","Sat>=25","22:00s","1:00","S"],["1944","1945","-","Apr","Sat>=21","22:00s","2:00","M"],["1946","only","-","Apr","Sat>=1","23:00s","1:00","S"],["1946","only","-","Oct","Sat>=1","23:00s","0","-"],["1947","1949","-","Apr","Sun>=1","2:00s","1:00","S"],["1947","1949","-","Oct","Sun>=1","2:00s","0","-"],["1951","1965","-","Apr","Sun>=1","2:00s","1:00","S"],["1951","1965","-","Oct","Sun>=1","2:00s","0","-"],["1977","only","-","Mar","27","0:00s","1:00","S"],["1977","only","-","Sep","25","0:00s","0","-"],["1978","1979","-","Apr","Sun>=1","0:00s","1:00","S"],["1978","only","-","Oct","1","0:00s","0","-"],["1979","1982","-","Sep","lastSun","1:00s","0","-"],["1980","only","-","Mar","lastSun","0:00s","1:00","S"],["1981","1982","-","Mar","lastSun","1:00s","1:00","S"],["1983","only","-","Mar","lastSun","2:00s","1:00","S"]],"Romania":[["1932","only","-","May","21","0:00s","1:00","S"],["1932","1939","-","Oct","Sun>=1","0:00s","0","-"],["1933","1939","-","Apr","Sun>=2","0:00s","1:00","S"],["1979","only","-","May","27","0:00","1:00","S"],["1979","only","-","Sep","lastSun","0:00","0","-"],["1980","only","-","Apr","5","23:00","1:00","S"],["1980","only","-","Sep","lastSun","1:00","0","-"],["1991","1993","-","Mar","lastSun","0:00s","1:00","S"],["1991","1993","-","Sep","lastSun","0:00s","0","-"]],"Spain":[["1917","only","-","May","5","23:00s","1:00","S"],["1917","1919","-","Oct","6","23:00s","0","-"],["1918","only","-","Apr","15","23:00s","1:00","S"],["1919","only","-","Apr","5","23:00s","1:00","S"],["1924","only","-","Apr","16","23:00s","1:00","S"],["1924","only","-","Oct","4","23:00s","0","-"],["1926","only","-","Apr","17","23:00s","1:00","S"],["1926","1929","-","Oct","Sat>=1","23:00s","0","-"],["1927","only","-","Apr","9","23:00s","1:00","S"],["1928","only","-","Apr","14","23:00s","1:00","S"],["1929","only","-","Apr","20","23:00s","1:00","S"],["1937","only","-","May","22","23:00s","1:00","S"],["1937","1939","-","Oct","Sat>=1","23:00s","0","-"],["1938","only","-","Mar","22","23:00s","1:00","S"],["1939","only","-","Apr","15","23:00s","1:00","S"],["1940","only","-","Mar","16","23:00s","1:00","S"],["1942","only","-","May","2","22:00s","2:00","M",""],["1942","only","-","Sep","1","22:00s","1:00","S"],["1943","1946","-","Apr","Sat>=13","22:00s","2:00","M"],["1943","only","-","Oct","3","22:00s","1:00","S"],["1944","only","-","Oct","10","22:00s","1:00","S"],["1945","only","-","Sep","30","1:00","1:00","S"],["1946","only","-","Sep","30","0:00","0","-"],["1949","only","-","Apr","30","23:00","1:00","S"],["1949","only","-","Sep","30","1:00","0","-"],["1974","1975","-","Apr","Sat>=13","23:00","1:00","S"],["1974","1975","-","Oct","Sun>=1","1:00","0","-"],["1976","only","-","Mar","27","23:00","1:00","S"],["1976","1977","-","Sep","lastSun","1:00","0","-"],["1977","1978","-","Apr","2","23:00","1:00","S"],["1978","only","-","Oct","1","1:00","0","-"]],"SpainAfrica":[["1967","only","-","Jun","3","12:00","1:00","S"],["1967","only","-","Oct","1","0:00","0","-"],["1974","only","-","Jun","24","0:00","1:00","S"],["1974","only","-","Sep","1","0:00","0","-"],["1976","1977","-","May","1","0:00","1:00","S"],["1976","only","-","Aug","1","0:00","0","-"],["1977","only","-","Sep","28","0:00","0","-"],["1978","only","-","Jun","1","0:00","1:00","S"],["1978","only","-","Aug","4","0:00","0","-"]],"Swiss":[["1941","1942","-","May","Mon>=1","1:00","1:00","S"],["1941","1942","-","Oct","Mon>=1","2:00","0","-"]],"Turkey":[["1916","only","-","May","1","0:00","1:00","S"],["1916","only","-","Oct","1","0:00","0","-"],["1920","only","-","Mar","28","0:00","1:00","S"],["1920","only","-","Oct","25","0:00","0","-"],["1921","only","-","Apr","3","0:00","1:00","S"],["1921","only","-","Oct","3","0:00","0","-"],["1922","only","-","Mar","26","0:00","1:00","S"],["1922","only","-","Oct","8","0:00","0","-"],["1924","only","-","May","13","0:00","1:00","S"],["1924","1925","-","Oct","1","0:00","0","-"],["1925","only","-","May","1","0:00","1:00","S"],["1940","only","-","Jun","30","0:00","1:00","S"],["1940","only","-","Oct","5","0:00","0","-"],["1940","only","-","Dec","1","0:00","1:00","S"],["1941","only","-","Sep","21","0:00","0","-"],["1942","only","-","Apr","1","0:00","1:00","S"],["1942","only","-","Nov","1","0:00","0","-"],["1945","only","-","Apr","2","0:00","1:00","S"],["1945","only","-","Oct","8","0:00","0","-"],["1946","only","-","Jun","1","0:00","1:00","S"],["1946","only","-","Oct","1","0:00","0","-"],["1947","1948","-","Apr","Sun>=16","0:00","1:00","S"],["1947","1950","-","Oct","Sun>=2","0:00","0","-"],["1949","only","-","Apr","10","0:00","1:00","S"],["1950","only","-","Apr","19","0:00","1:00","S"],["1951","only","-","Apr","22","0:00","1:00","S"],["1951","only","-","Oct","8","0:00","0","-"],["1962","only","-","Jul","15","0:00","1:00","S"],["1962","only","-","Oct","8","0:00","0","-"],["1964","only","-","May","15","0:00","1:00","S"],["1964","only","-","Oct","1","0:00","0","-"],["1970","1972","-","May","Sun>=2","0:00","1:00","S"],["1970","1972","-","Oct","Sun>=2","0:00","0","-"],["1973","only","-","Jun","3","1:00","1:00","S"],["1973","only","-","Nov","4","3:00","0","-"],["1974","only","-","Mar","31","2:00","1:00","S"],["1974","only","-","Nov","3","5:00","0","-"],["1975","only","-","Mar","30","0:00","1:00","S"],["1975","1976","-","Oct","lastSun","0:00","0","-"],["1976","only","-","Jun","1","0:00","1:00","S"],["1977","1978","-","Apr","Sun>=1","0:00","1:00","S"],["1977","only","-","Oct","16","0:00","0","-"],["1979","1980","-","Apr","Sun>=1","3:00","1:00","S"],["1979","1982","-","Oct","Mon>=11","0:00","0","-"],["1981","1982","-","Mar","lastSun","3:00","1:00","S"],["1983","only","-","Jul","31","0:00","1:00","S"],["1983","only","-","Oct","2","0:00","0","-"],["1985","only","-","Apr","20","0:00","1:00","S"],["1985","only","-","Sep","28","0:00","0","-"],["1986","1990","-","Mar","lastSun","2:00s","1:00","S"],["1986","1990","-","Sep","lastSun","2:00s","0","-"],["1991","2006","-","Mar","lastSun","1:00s","1:00","S"],["1991","1995","-","Sep","lastSun","1:00s","0","-"],["1996","2006","-","Oct","lastSun","1:00s","0","-"]],"US":[["1918","1919","-","Mar","lastSun","2:00","1:00","D"],["1918","1919","-","Oct","lastSun","2:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","30","2:00","0","S"],["1967","2006","-","Oct","lastSun","2:00","0","S"],["1967","1973","-","Apr","lastSun","2:00","1:00","D"],["1974","only","-","Jan","6","2:00","1:00","D"],["1975","only","-","Feb","23","2:00","1:00","D"],["1976","1986","-","Apr","lastSun","2:00","1:00","D"],["1987","2006","-","Apr","Sun>=1","2:00","1:00","D"],["2007","max","-","Mar","Sun>=8","2:00","1:00","D"],["2007","max","-","Nov","Sun>=1","2:00","0","S"]],"NYC":[["1920","only","-","Mar","lastSun","2:00","1:00","D"],["1920","only","-","Oct","lastSun","2:00","0","S"],["1921","1966","-","Apr","lastSun","2:00","1:00","D"],["1921","1954","-","Sep","lastSun","2:00","0","S"],["1955","1966","-","Oct","lastSun","2:00","0","S"]],"Chicago":[["1920","only","-","Jun","13","2:00","1:00","D"],["1920","1921","-","Oct","lastSun","2:00","0","S"],["1921","only","-","Mar","lastSun","2:00","1:00","D"],["1922","1966","-","Apr","lastSun","2:00","1:00","D"],["1922","1954","-","Sep","lastSun","2:00","0","S"],["1955","1966","-","Oct","lastSun","2:00","0","S"]],"Denver":[["1920","1921","-","Mar","lastSun","2:00","1:00","D"],["1920","only","-","Oct","lastSun","2:00","0","S"],["1921","only","-","May","22","2:00","0","S"],["1965","1966","-","Apr","lastSun","2:00","1:00","D"],["1965","1966","-","Oct","lastSun","2:00","0","S"]],"CA":[["1948","only","-","Mar","14","2:00","1:00","D"],["1949","only","-","Jan","1","2:00","0","S"],["1950","1966","-","Apr","lastSun","2:00","1:00","D"],["1950","1961","-","Sep","lastSun","2:00","0","S"],["1962","1966","-","Oct","lastSun","2:00","0","S"]],"Indianapolis":[["1941","only","-","Jun","22","2:00","1:00","D"],["1941","1954","-","Sep","lastSun","2:00","0","S"],["1946","1954","-","Apr","lastSun","2:00","1:00","D"]],"Marengo":[["1951","only","-","Apr","lastSun","2:00","1:00","D"],["1951","only","-","Sep","lastSun","2:00","0","S"],["1954","1960","-","Apr","lastSun","2:00","1:00","D"],["1954","1960","-","Sep","lastSun","2:00","0","S"]],"Vincennes":[["1946","only","-","Apr","lastSun","2:00","1:00","D"],["1946","only","-","Sep","lastSun","2:00","0","S"],["1953","1954","-","Apr","lastSun","2:00","1:00","D"],["1953","1959","-","Sep","lastSun","2:00","0","S"],["1955","only","-","May","1","0:00","1:00","D"],["1956","1963","-","Apr","lastSun","2:00","1:00","D"],["1960","only","-","Oct","lastSun","2:00","0","S"],["1961","only","-","Sep","lastSun","2:00","0","S"],["1962","1963","-","Oct","lastSun","2:00","0","S"]],"Perry":[["1946","only","-","Apr","lastSun","2:00","1:00","D"],["1946","only","-","Sep","lastSun","2:00","0","S"],["1953","1954","-","Apr","lastSun","2:00","1:00","D"],["1953","1959","-","Sep","lastSun","2:00","0","S"],["1955","only","-","May","1","0:00","1:00","D"],["1956","1963","-","Apr","lastSun","2:00","1:00","D"],["1960","only","-","Oct","lastSun","2:00","0","S"],["1961","only","-","Sep","lastSun","2:00","0","S"],["1962","1963","-","Oct","lastSun","2:00","0","S"]],"Pike":[["1955","only","-","May","1","0:00","1:00","D"],["1955","1960","-","Sep","lastSun","2:00","0","S"],["1956","1964","-","Apr","lastSun","2:00","1:00","D"],["1961","1964","-","Oct","lastSun","2:00","0","S"]],"Starke":[["1947","1961","-","Apr","lastSun","2:00","1:00","D"],["1947","1954","-","Sep","lastSun","2:00","0","S"],["1955","1956","-","Oct","lastSun","2:00","0","S"],["1957","1958","-","Sep","lastSun","2:00","0","S"],["1959","1961","-","Oct","lastSun","2:00","0","S"]],"Pulaski":[["1946","1960","-","Apr","lastSun","2:00","1:00","D"],["1946","1954","-","Sep","lastSun","2:00","0","S"],["1955","1956","-","Oct","lastSun","2:00","0","S"],["1957","1960","-","Sep","lastSun","2:00","0","S"]],"Louisville":[["1921","only","-","May","1","2:00","1:00","D"],["1921","only","-","Sep","1","2:00","0","S"],["1941","1961","-","Apr","lastSun","2:00","1:00","D"],["1941","only","-","Sep","lastSun","2:00","0","S"],["1946","only","-","Jun","2","2:00","0","S"],["1950","1955","-","Sep","lastSun","2:00","0","S"],["1956","1960","-","Oct","lastSun","2:00","0","S"]],"Detroit":[["1948","only","-","Apr","lastSun","2:00","1:00","D"],["1948","only","-","Sep","lastSun","2:00","0","S"],["1967","only","-","Jun","14","2:00","1:00","D"],["1967","only","-","Oct","lastSun","2:00","0","S"]],"Menominee":[["1946","only","-","Apr","lastSun","2:00","1:00","D"],["1946","only","-","Sep","lastSun","2:00","0","S"],["1966","only","-","Apr","lastSun","2:00","1:00","D"],["1966","only","-","Oct","lastSun","2:00","0","S"]],"Canada":[["1918","only","-","Apr","14","2:00","1:00","D"],["1918","only","-","Oct","31","2:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","30","2:00","0","S"],["1974","1986","-","Apr","lastSun","2:00","1:00","D"],["1974","2006","-","Oct","lastSun","2:00","0","S"],["1987","2006","-","Apr","Sun>=1","2:00","1:00","D"],["2007","max","-","Mar","Sun>=8","2:00","1:00","D"],["2007","max","-","Nov","Sun>=1","2:00","0","S"]],"StJohns":[["1917","only","-","Apr","8","2:00","1:00","D"],["1917","only","-","Sep","17","2:00","0","S"],["1919","only","-","May","5","23:00","1:00","D"],["1919","only","-","Aug","12","23:00","0","S"],["1920","1935","-","May","Sun>=1","23:00","1:00","D"],["1920","1935","-","Oct","lastSun","23:00","0","S"],["1936","1941","-","May","Mon>=9","0:00","1:00","D"],["1936","1941","-","Oct","Mon>=2","0:00","0","S"],["1946","1950","-","May","Sun>=8","2:00","1:00","D"],["1946","1950","-","Oct","Sun>=2","2:00","0","S"],["1951","1986","-","Apr","lastSun","2:00","1:00","D"],["1951","1959","-","Sep","lastSun","2:00","0","S"],["1960","1986","-","Oct","lastSun","2:00","0","S"],["1987","only","-","Apr","Sun>=1","0:01","1:00","D"],["1987","2006","-","Oct","lastSun","0:01","0","S"],["1988","only","-","Apr","Sun>=1","0:01","2:00","DD"],["1989","2006","-","Apr","Sun>=1","0:01","1:00","D"],["2007","max","-","Mar","Sun>=8","0:01","1:00","D"],["2007","max","-","Nov","Sun>=1","0:01","0","S"]],"Halifax":[["1916","only","-","Apr","1","0:00","1:00","D"],["1916","only","-","Oct","1","0:00","0","S"],["1920","only","-","May","9","0:00","1:00","D"],["1920","only","-","Aug","29","0:00","0","S"],["1921","only","-","May","6","0:00","1:00","D"],["1921","1922","-","Sep","5","0:00","0","S"],["1922","only","-","Apr","30","0:00","1:00","D"],["1923","1925","-","May","Sun>=1","0:00","1:00","D"],["1923","only","-","Sep","4","0:00","0","S"],["1924","only","-","Sep","15","0:00","0","S"],["1925","only","-","Sep","28","0:00","0","S"],["1926","only","-","May","16","0:00","1:00","D"],["1926","only","-","Sep","13","0:00","0","S"],["1927","only","-","May","1","0:00","1:00","D"],["1927","only","-","Sep","26","0:00","0","S"],["1928","1931","-","May","Sun>=8","0:00","1:00","D"],["1928","only","-","Sep","9","0:00","0","S"],["1929","only","-","Sep","3","0:00","0","S"],["1930","only","-","Sep","15","0:00","0","S"],["1931","1932","-","Sep","Mon>=24","0:00","0","S"],["1932","only","-","May","1","0:00","1:00","D"],["1933","only","-","Apr","30","0:00","1:00","D"],["1933","only","-","Oct","2","0:00","0","S"],["1934","only","-","May","20","0:00","1:00","D"],["1934","only","-","Sep","16","0:00","0","S"],["1935","only","-","Jun","2","0:00","1:00","D"],["1935","only","-","Sep","30","0:00","0","S"],["1936","only","-","Jun","1","0:00","1:00","D"],["1936","only","-","Sep","14","0:00","0","S"],["1937","1938","-","May","Sun>=1","0:00","1:00","D"],["1937","1941","-","Sep","Mon>=24","0:00","0","S"],["1939","only","-","May","28","0:00","1:00","D"],["1940","1941","-","May","Sun>=1","0:00","1:00","D"],["1946","1949","-","Apr","lastSun","2:00","1:00","D"],["1946","1949","-","Sep","lastSun","2:00","0","S"],["1951","1954","-","Apr","lastSun","2:00","1:00","D"],["1951","1954","-","Sep","lastSun","2:00","0","S"],["1956","1959","-","Apr","lastSun","2:00","1:00","D"],["1956","1959","-","Sep","lastSun","2:00","0","S"],["1962","1973","-","Apr","lastSun","2:00","1:00","D"],["1962","1973","-","Oct","lastSun","2:00","0","S"]],"Moncton":[["1933","1935","-","Jun","Sun>=8","1:00","1:00","D"],["1933","1935","-","Sep","Sun>=8","1:00","0","S"],["1936","1938","-","Jun","Sun>=1","1:00","1:00","D"],["1936","1938","-","Sep","Sun>=1","1:00","0","S"],["1939","only","-","May","27","1:00","1:00","D"],["1939","1941","-","Sep","Sat>=21","1:00","0","S"],["1940","only","-","May","19","1:00","1:00","D"],["1941","only","-","May","4","1:00","1:00","D"],["1946","1972","-","Apr","lastSun","2:00","1:00","D"],["1946","1956","-","Sep","lastSun","2:00","0","S"],["1957","1972","-","Oct","lastSun","2:00","0","S"],["1993","2006","-","Apr","Sun>=1","0:01","1:00","D"],["1993","2006","-","Oct","lastSun","0:01","0","S"]],"Mont":[["1917","only","-","Mar","25","2:00","1:00","D"],["1917","only","-","Apr","24","0:00","0","S"],["1919","only","-","Mar","31","2:30","1:00","D"],["1919","only","-","Oct","25","2:30","0","S"],["1920","only","-","May","2","2:30","1:00","D"],["1920","1922","-","Oct","Sun>=1","2:30","0","S"],["1921","only","-","May","1","2:00","1:00","D"],["1922","only","-","Apr","30","2:00","1:00","D"],["1924","only","-","May","17","2:00","1:00","D"],["1924","1926","-","Sep","lastSun","2:30","0","S"],["1925","1926","-","May","Sun>=1","2:00","1:00","D"],["1927","only","-","May","1","0:00","1:00","D"],["1927","1932","-","Sep","lastSun","0:00","0","S"],["1928","1931","-","Apr","lastSun","0:00","1:00","D"],["1932","only","-","May","1","0:00","1:00","D"],["1933","1940","-","Apr","lastSun","0:00","1:00","D"],["1933","only","-","Oct","1","0:00","0","S"],["1934","1939","-","Sep","lastSun","0:00","0","S"],["1946","1973","-","Apr","lastSun","2:00","1:00","D"],["1945","1948","-","Sep","lastSun","2:00","0","S"],["1949","1950","-","Oct","lastSun","2:00","0","S"],["1951","1956","-","Sep","lastSun","2:00","0","S"],["1957","1973","-","Oct","lastSun","2:00","0","S"]],"Toronto":[["1919","only","-","Mar","30","23:30","1:00","D"],["1919","only","-","Oct","26","0:00","0","S"],["1920","only","-","May","2","2:00","1:00","D"],["1920","only","-","Sep","26","0:00","0","S"],["1921","only","-","May","15","2:00","1:00","D"],["1921","only","-","Sep","15","2:00","0","S"],["1922","1923","-","May","Sun>=8","2:00","1:00","D"],["1922","1926","-","Sep","Sun>=15","2:00","0","S"],["1924","1927","-","May","Sun>=1","2:00","1:00","D"],["1927","1932","-","Sep","lastSun","2:00","0","S"],["1928","1931","-","Apr","lastSun","2:00","1:00","D"],["1932","only","-","May","1","2:00","1:00","D"],["1933","1940","-","Apr","lastSun","2:00","1:00","D"],["1933","only","-","Oct","1","2:00","0","S"],["1934","1939","-","Sep","lastSun","2:00","0","S"],["1945","1946","-","Sep","lastSun","2:00","0","S"],["1946","only","-","Apr","lastSun","2:00","1:00","D"],["1947","1949","-","Apr","lastSun","0:00","1:00","D"],["1947","1948","-","Sep","lastSun","0:00","0","S"],["1949","only","-","Nov","lastSun","0:00","0","S"],["1950","1973","-","Apr","lastSun","2:00","1:00","D"],["1950","only","-","Nov","lastSun","2:00","0","S"],["1951","1956","-","Sep","lastSun","2:00","0","S"],["1957","1973","-","Oct","lastSun","2:00","0","S"]],"Winn":[["1916","only","-","Apr","23","0:00","1:00","D"],["1916","only","-","Sep","17","0:00","0","S"],["1918","only","-","Apr","14","2:00","1:00","D"],["1918","only","-","Oct","31","2:00","0","S"],["1937","only","-","May","16","2:00","1:00","D"],["1937","only","-","Sep","26","2:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","lastSun","2:00","0","S"],["1946","only","-","May","12","2:00","1:00","D"],["1946","only","-","Oct","13","2:00","0","S"],["1947","1949","-","Apr","lastSun","2:00","1:00","D"],["1947","1949","-","Sep","lastSun","2:00","0","S"],["1950","only","-","May","1","2:00","1:00","D"],["1950","only","-","Sep","30","2:00","0","S"],["1951","1960","-","Apr","lastSun","2:00","1:00","D"],["1951","1958","-","Sep","lastSun","2:00","0","S"],["1959","only","-","Oct","lastSun","2:00","0","S"],["1960","only","-","Sep","lastSun","2:00","0","S"],["1963","only","-","Apr","lastSun","2:00","1:00","D"],["1963","only","-","Sep","22","2:00","0","S"],["1966","1986","-","Apr","lastSun","2:00s","1:00","D"],["1966","2005","-","Oct","lastSun","2:00s","0","S"],["1987","2005","-","Apr","Sun>=1","2:00s","1:00","D"]],"Regina":[["1918","only","-","Apr","14","2:00","1:00","D"],["1918","only","-","Oct","31","2:00","0","S"],["1930","1934","-","May","Sun>=1","0:00","1:00","D"],["1930","1934","-","Oct","Sun>=1","0:00","0","S"],["1937","1941","-","Apr","Sun>=8","0:00","1:00","D"],["1937","only","-","Oct","Sun>=8","0:00","0","S"],["1938","only","-","Oct","Sun>=1","0:00","0","S"],["1939","1941","-","Oct","Sun>=8","0:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","lastSun","2:00","0","S"],["1946","only","-","Apr","Sun>=8","2:00","1:00","D"],["1946","only","-","Oct","Sun>=8","2:00","0","S"],["1947","1957","-","Apr","lastSun","2:00","1:00","D"],["1947","1957","-","Sep","lastSun","2:00","0","S"],["1959","only","-","Apr","lastSun","2:00","1:00","D"],["1959","only","-","Oct","lastSun","2:00","0","S"]],"Swift":[["1957","only","-","Apr","lastSun","2:00","1:00","D"],["1957","only","-","Oct","lastSun","2:00","0","S"],["1959","1961","-","Apr","lastSun","2:00","1:00","D"],["1959","only","-","Oct","lastSun","2:00","0","S"],["1960","1961","-","Sep","lastSun","2:00","0","S"]],"Edm":[["1918","1919","-","Apr","Sun>=8","2:00","1:00","D"],["1918","only","-","Oct","31","2:00","0","S"],["1919","only","-","May","27","2:00","0","S"],["1920","1923","-","Apr","lastSun","2:00","1:00","D"],["1920","only","-","Oct","lastSun","2:00","0","S"],["1921","1923","-","Sep","lastSun","2:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","lastSun","2:00","0","S"],["1947","only","-","Apr","lastSun","2:00","1:00","D"],["1947","only","-","Sep","lastSun","2:00","0","S"],["1967","only","-","Apr","lastSun","2:00","1:00","D"],["1967","only","-","Oct","lastSun","2:00","0","S"],["1969","only","-","Apr","lastSun","2:00","1:00","D"],["1969","only","-","Oct","lastSun","2:00","0","S"],["1972","1986","-","Apr","lastSun","2:00","1:00","D"],["1972","2006","-","Oct","lastSun","2:00","0","S"]],"Vanc":[["1918","only","-","Apr","14","2:00","1:00","D"],["1918","only","-","Oct","31","2:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","30","2:00","0","S"],["1946","1986","-","Apr","lastSun","2:00","1:00","D"],["1946","only","-","Oct","13","2:00","0","S"],["1947","1961","-","Sep","lastSun","2:00","0","S"],["1962","2006","-","Oct","lastSun","2:00","0","S"]],"NT_YK":[["1918","only","-","Apr","14","2:00","1:00","D"],["1918","only","-","Oct","27","2:00","0","S"],["1919","only","-","May","25","2:00","1:00","D"],["1919","only","-","Nov","1","0:00","0","S"],["1942","only","-","Feb","9","2:00","1:00","W",""],["1945","only","-","Aug","14","23:00u","1:00","P",""],["1945","only","-","Sep","30","2:00","0","S"],["1965","only","-","Apr","lastSun","0:00","2:00","DD"],["1965","only","-","Oct","lastSun","2:00","0","S"],["1980","1986","-","Apr","lastSun","2:00","1:00","D"],["1980","2006","-","Oct","lastSun","2:00","0","S"],["1987","2006","-","Apr","Sun>=1","2:00","1:00","D"]],"Resolute":[["2006","max","-","Nov","Sun>=1","2:00","0","ES"],["2007","max","-","Mar","Sun>=8","2:00","0","CD"]],"Mexico":[["1939","only","-","Feb","5","0:00","1:00","D"],["1939","only","-","Jun","25","0:00","0","S"],["1940","only","-","Dec","9","0:00","1:00","D"],["1941","only","-","Apr","1","0:00","0","S"],["1943","only","-","Dec","16","0:00","1:00","W",""],["1944","only","-","May","1","0:00","0","S"],["1950","only","-","Feb","12","0:00","1:00","D"],["1950","only","-","Jul","30","0:00","0","S"],["1996","2000","-","Apr","Sun>=1","2:00","1:00","D"],["1996","2000","-","Oct","lastSun","2:00","0","S"],["2001","only","-","May","Sun>=1","2:00","1:00","D"],["2001","only","-","Sep","lastSun","2:00","0","S"],["2002","max","-","Apr","Sun>=1","2:00","1:00","D"],["2002","max","-","Oct","lastSun","2:00","0","S"]],"Bahamas":[["1964","1975","-","Oct","lastSun","2:00","0","S"],["1964","1975","-","Apr","lastSun","2:00","1:00","D"]],"Barb":[["1977","only","-","Jun","12","2:00","1:00","D"],["1977","1978","-","Oct","Sun>=1","2:00","0","S"],["1978","1980","-","Apr","Sun>=15","2:00","1:00","D"],["1979","only","-","Sep","30","2:00","0","S"],["1980","only","-","Sep","25","2:00","0","S"]],"Belize":[["1918","1942","-","Oct","Sun>=2","0:00","0:30","HD"],["1919","1943","-","Feb","Sun>=9","0:00","0","S"],["1973","only","-","Dec","5","0:00","1:00","D"],["1974","only","-","Feb","9","0:00","0","S"],["1982","only","-","Dec","18","0:00","1:00","D"],["1983","only","-","Feb","12","0:00","0","S"]],"CR":[["1979","1980","-","Feb","lastSun","0:00","1:00","D"],["1979","1980","-","Jun","Sun>=1","0:00","0","S"],["1991","1992","-","Jan","Sat>=15","0:00","1:00","D"],["1991","only","-","Jul","1","0:00","0","S"],["1992","only","-","Mar","15","0:00","0","S"]],"Cuba":[["1928","only","-","Jun","10","0:00","1:00","D"],["1928","only","-","Oct","10","0:00","0","S"],["1940","1942","-","Jun","Sun>=1","0:00","1:00","D"],["1940","1942","-","Sep","Sun>=1","0:00","0","S"],["1945","1946","-","Jun","Sun>=1","0:00","1:00","D"],["1945","1946","-","Sep","Sun>=1","0:00","0","S"],["1965","only","-","Jun","1","0:00","1:00","D"],["1965","only","-","Sep","30","0:00","0","S"],["1966","only","-","May","29","0:00","1:00","D"],["1966","only","-","Oct","2","0:00","0","S"],["1967","only","-","Apr","8","0:00","1:00","D"],["1967","1968","-","Sep","Sun>=8","0:00","0","S"],["1968","only","-","Apr","14","0:00","1:00","D"],["1969","1977","-","Apr","lastSun","0:00","1:00","D"],["1969","1971","-","Oct","lastSun","0:00","0","S"],["1972","1974","-","Oct","8","0:00","0","S"],["1975","1977","-","Oct","lastSun","0:00","0","S"],["1978","only","-","May","7","0:00","1:00","D"],["1978","1990","-","Oct","Sun>=8","0:00","0","S"],["1979","1980","-","Mar","Sun>=15","0:00","1:00","D"],["1981","1985","-","May","Sun>=5","0:00","1:00","D"],["1986","1989","-","Mar","Sun>=14","0:00","1:00","D"],["1990","1997","-","Apr","Sun>=1","0:00","1:00","D"],["1991","1995","-","Oct","Sun>=8","0:00s","0","S"],["1996","only","-","Oct","6","0:00s","0","S"],["1997","only","-","Oct","12","0:00s","0","S"],["1998","1999","-","Mar","lastSun","0:00s","1:00","D"],["1998","2003","-","Oct","lastSun","0:00s","0","S"],["2000","2004","-","Apr","Sun>=1","0:00s","1:00","D"],["2006","max","-","Oct","lastSun","0:00s","0","S"],["2007","only","-","Mar","Sun>=8","0:00s","1:00","D"],["2008","only","-","Mar","Sun>=15","0:00s","1:00","D"],["2009","2010","-","Mar","Sun>=8","0:00s","1:00","D"],["2011","only","-","Mar","Sun>=15","0:00s","1:00","D"],["2012","max","-","Mar","Sun>=8","0:00s","1:00","D"]],"DR":[["1966","only","-","Oct","30","0:00","1:00","D"],["1967","only","-","Feb","28","0:00","0","S"],["1969","1973","-","Oct","lastSun","0:00","0:30","HD"],["1970","only","-","Feb","21","0:00","0","S"],["1971","only","-","Jan","20","0:00","0","S"],["1972","1974","-","Jan","21","0:00","0","S"]],"Salv":[["1987","1988","-","May","Sun>=1","0:00","1:00","D"],["1987","1988","-","Sep","lastSun","0:00","0","S"]],"Guat":[["1973","only","-","Nov","25","0:00","1:00","D"],["1974","only","-","Feb","24","0:00","0","S"],["1983","only","-","May","21","0:00","1:00","D"],["1983","only","-","Sep","22","0:00","0","S"],["1991","only","-","Mar","23","0:00","1:00","D"],["1991","only","-","Sep","7","0:00","0","S"],["2006","only","-","Apr","30","0:00","1:00","D"],["2006","only","-","Oct","1","0:00","0","S"]],"Haiti":[["1983","only","-","May","8","0:00","1:00","D"],["1984","1987","-","Apr","lastSun","0:00","1:00","D"],["1983","1987","-","Oct","lastSun","0:00","0","S"],["1988","1997","-","Apr","Sun>=1","1:00s","1:00","D"],["1988","1997","-","Oct","lastSun","1:00s","0","S"],["2005","2006","-","Apr","Sun>=1","0:00","1:00","D"],["2005","2006","-","Oct","lastSun","0:00","0","S"]],"Hond":[["1987","1988","-","May","Sun>=1","0:00","1:00","D"],["1987","1988","-","Sep","lastSun","0:00","0","S"],["2006","only","-","May","Sun>=1","0:00","1:00","D"],["2006","only","-","Aug","Mon>=1","0:00","0","S"]],"Nic":[["1979","1980","-","Mar","Sun>=16","0:00","1:00","D"],["1979","1980","-","Jun","Mon>=23","0:00","0","S"],["2005","only","-","Apr","10","0:00","1:00","D"],["2005","only","-","Oct","Sun>=1","0:00","0","S"],["2006","only","-","Apr","30","2:00","1:00","D"],["2006","only","-","Oct","Sun>=1","1:00","0","S"]],"TC":[["1979","1986","-","Apr","lastSun","2:00","1:00","D"],["1979","2006","-","Oct","lastSun","2:00","0","S"],["1987","2006","-","Apr","Sun>=1","2:00","1:00","D"],["2007","max","-","Mar","Sun>=8","2:00","1:00","D"],["2007","max","-","Nov","Sun>=1","2:00","0","S"]]};
/*
* jQuery Impromptu
* By: Trent Richardson [http://trentrichardson.com]
* Version 3.1
* Last Modified: 3/30/2010
*
* Copyright 2010 Trent Richardson
* Dual licensed under the MIT and GPL licenses.
* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
*
*/
(function($) {
$.prompt = function(message, options) {
options = $.extend({},$.prompt.defaults,options);
$.prompt.currentPrefix = options.prefix;
var ie6 = ($.browser.msie && $.browser.version < 7);
var $body = $(document.body);
var $window = $(window);
options.classes = $.trim(options.classes);
if(options.classes != '')
options.classes = ' '+ options.classes;
//build the box and fade
var msgbox = '<div class="'+ options.prefix +'box'+ options.classes +'" id="'+ options.prefix +'box">';
if(options.useiframe && (($('object, applet').length > 0) || ie6)) {
msgbox += '<iframe src="javascript:false;" style="display:block;position:absolute;z-index:-1;" class="'+ options.prefix +'fade" id="'+ options.prefix +'fade"></iframe>';
} else {
if(ie6) {
$('select').css('visibility','hidden');
}
msgbox +='<div class="'+ options.prefix +'fade" id="'+ options.prefix +'fade"></div>';
}
msgbox += '<div class="'+ options.prefix +'" id="'+ options.prefix +'"><div class="'+ options.prefix +'container"><div class="';
msgbox += options.prefix +'close">X</div><div id="'+ options.prefix +'states"></div>';
msgbox += '</div></div></div>';
var $jqib = $(msgbox).appendTo($body);
var $jqi = $jqib.children('#'+ options.prefix);
var $jqif = $jqib.children('#'+ options.prefix +'fade');
//if a string was passed, convert to a single state
if(message.constructor == String){
message = {
state0: {
html: message,
buttons: options.buttons,
focus: options.focus,
submit: options.submit
}
};
}
//build the states
var states = "";
$.each(message,function(statename,stateobj){
stateobj = $.extend({},$.prompt.defaults.state,stateobj);
message[statename] = stateobj;
states += '<div id="'+ options.prefix +'_state_'+ statename +'" class="'+ options.prefix + '_state" style="display:none;"><div class="'+ options.prefix +'message">' + stateobj.html +'</div><div class="'+ options.prefix +'buttons">';
$.each(stateobj.buttons, function(k, v){
if(typeof v == 'object')
states += '<button name="' + options.prefix + '_' + statename + '_button' + v.title.replace(/[^a-z0-9]+/gi,'') + '" id="' + options.prefix + '_' + statename + '_button' + v.title.replace(/[^a-z0-9]+/gi,'') + '" value="' + v.value + '">' + v.title + '</button>';
else states += '<button name="' + options.prefix + '_' + statename + '_button' + k + '" id="' + options.prefix + '_' + statename + '_button' + k + '" value="' + v + '">' + k + '</button>';
});
states += '</div></div>';
});
//insert the states...
$jqi.find('#'+ options.prefix +'states').html(states).children('.'+ options.prefix +'_state:first').css('display','block');
$jqi.find('.'+ options.prefix +'buttons:empty').css('display','none');
//Events
$.each(message,function(statename,stateobj){
var $state = $jqi.find('#'+ options.prefix +'_state_'+ statename);
$state.children('.'+ options.prefix +'buttons').children('button').click(function(){
var msg = $state.children('.'+ options.prefix +'message');
var clicked = stateobj.buttons[$(this).text()];
if(clicked == undefined){
for(var i in stateobj.buttons)
if(stateobj.buttons[i].title == $(this).text())
clicked = stateobj.buttons[i].value;
}
if(typeof clicked == 'object')
clicked = clicked.value;
var forminputs = {};
//collect all form element values from all states
$.each($jqi.find('#'+ options.prefix +'states :input').serializeArray(),function(i,obj){
if (forminputs[obj.name] === undefined) {
forminputs[obj.name] = obj.value;
} else if (typeof forminputs[obj.name] == Array || typeof forminputs[obj.name] == 'object') {
forminputs[obj.name].push(obj.value);
} else {
forminputs[obj.name] = [forminputs[obj.name],obj.value];
}
});
var close = stateobj.submit(clicked,msg,forminputs);
if(close === undefined || close) {
removePrompt(true,clicked,msg,forminputs);
}
});
$state.find('.'+ options.prefix +'buttons button:eq('+ stateobj.focus +')').addClass(options.prefix +'defaultbutton');
});
var ie6scroll = function(){
$jqib.css({ top: $window.scrollTop() });
};
var fadeClicked = function(){
if(options.persistent){
var i = 0;
$jqib.addClass(options.prefix +'warning');
var intervalid = setInterval(function(){
$jqib.toggleClass(options.prefix +'warning');
if(i++ > 1){
clearInterval(intervalid);
$jqib.removeClass(options.prefix +'warning');
}
}, 100);
}
else {
removePrompt();
}
};
var keyPressEventHandler = function(e){
var key = (window.event) ? event.keyCode : e.keyCode; // MSIE or Firefox?
//escape key closes
if(key==27) {
fadeClicked();
}
//constrain tabs
if (key == 9){
var $inputels = $(':input:enabled:visible',$jqib);
var fwd = !e.shiftKey && e.target == $inputels[$inputels.length-1];
var back = e.shiftKey && e.target == $inputels[0];
if (fwd || back) {
setTimeout(function(){
if (!$inputels)
return;
var el = $inputels[back===true ? $inputels.length-1 : 0];
if (el)
el.focus();
},10);
return false;
}
}
};
var positionPrompt = function(){
$jqib.css({
position: (ie6) ? "absolute" : "fixed",
height: $window.height(),
width: "100%",
top: (ie6)? $window.scrollTop() : 0,
left: 0,
right: 0,
bottom: 0
});
$jqif.css({
position: "absolute",
height: $window.height(),
width: "100%",
top: 0,
left: 0,
right: 0,
bottom: 0
});
$jqi.css({
position: "absolute",
top: options.top,
left: "50%",
marginLeft: (($jqi.outerWidth()/2)*-1)
});
};
var stylePrompt = function(){
$jqif.css({
zIndex: options.zIndex,
display: "none",
opacity: options.opacity
});
$jqi.css({
zIndex: options.zIndex+1,
display: "none"
});
$jqib.css({
zIndex: options.zIndex
});
};
var removePrompt = function(callCallback, clicked, msg, formvals){
$jqi.remove();
//ie6, remove the scroll event
if(ie6) {
$body.unbind('scroll',ie6scroll);
}
$window.unbind('resize',positionPrompt);
$jqif.fadeOut(options.overlayspeed,function(){
$jqif.unbind('click',fadeClicked);
$jqif.remove();
if(callCallback) {
options.callback(clicked,msg,formvals);
}
$jqib.unbind('keypress',keyPressEventHandler);
$jqib.remove();
if(ie6 && !options.useiframe) {
$('select').css('visibility','visible');
}
});
};
positionPrompt();
stylePrompt();
//ie6, add a scroll event to fix position:fixed
if(ie6) {
$window.scroll(ie6scroll);
}
$jqif.click(fadeClicked);
$window.resize(positionPrompt);
$jqib.bind("keydown keypress",keyPressEventHandler);
$jqi.find('.'+ options.prefix +'close').click(removePrompt);
//Show it
$jqif.fadeIn(options.overlayspeed);
$jqi[options.show](options.promptspeed,options.loaded);
$jqi.find('#'+ options.prefix +'states .'+ options.prefix +'_state:first .'+ options.prefix +'defaultbutton').focus();
if(options.timeout > 0)
setTimeout($.prompt.close,options.timeout);
return $jqib;
};
$.prompt.defaults = {
prefix:'jqi',
classes: '',
buttons: {
Ok: true
},
loaded: function(){
},
submit: function(){
return true;
},
callback: function(){
},
opacity: 0.6,
zIndex: 999,
overlayspeed: 'slow',
promptspeed: 'fast',
show: 'fadeIn',
focus: 0,
useiframe: false,
top: "15%",
persistent: true,
timeout: 0,
state: {
html: '',
buttons: {
Ok: true
},
focus: 0,
submit: function(){
return true;
}
}
};
$.prompt.currentPrefix = $.prompt.defaults.prefix;
$.prompt.setDefaults = function(o) {
$.prompt.defaults = $.extend({}, $.prompt.defaults, o);
};
$.prompt.setStateDefaults = function(o) {
$.prompt.defaults.state = $.extend({}, $.prompt.defaults.state, o);
};
$.prompt.getStateContent = function(state) {
return $('#'+ $.prompt.currentPrefix +'_state_'+ state);
};
$.prompt.getCurrentState = function() {
return $('.'+ $.prompt.currentPrefix +'_state:visible');
};
$.prompt.getCurrentStateName = function() {
var stateid = $.prompt.getCurrentState().attr('id');
return stateid.replace($.prompt.currentPrefix +'_state_','');
};
$.prompt.goToState = function(state, callback) {
$('.'+ $.prompt.currentPrefix +'_state').slideUp('slow');
$('#'+ $.prompt.currentPrefix +'_state_'+ state).slideDown('slow',function(){
$(this).find('.'+ $.prompt.currentPrefix +'defaultbutton').focus();
if (typeof callback == 'function')
callback();
});
};
$.prompt.nextState = function(callback) {
var $next = $('.'+ $.prompt.currentPrefix +'_state:visible').next();
$('.'+ $.prompt.currentPrefix +'_state').slideUp('slow');
$next.slideDown('slow',function(){
$next.find('.'+ $.prompt.currentPrefix +'defaultbutton').focus();
if (typeof callback == 'function')
callback();
});
};
$.prompt.prevState = function(callback) {
var $next = $('.'+ $.prompt.currentPrefix +'_state:visible').prev();
$('.'+ $.prompt.currentPrefix +'_state').slideUp('slow');
$next.slideDown('slow',function(){
$next.find('.'+ $.prompt.currentPrefix +'defaultbutton').focus();
if (typeof callback == 'function')
callback();
});
};
$.prompt.close = function() {
$('#'+ $.prompt.currentPrefix +'box').fadeOut('fast',function(){
$(this).remove();
});
};
$.fn.prompt = function(options){
if(options == undefined)
options = {};
if(options.withDataAndEvents == undefined)
options.withDataAndEvents = false;
$.prompt($(this).clone(options.withDataAndEvents).html(),options);
}
})(jQuery);
(function($) {
$.fn.serializeToJson = function() {
attrs = {};
this.find('[name]').each(function(i, field) {
$field = $(field);
if ($field.is(':checkbox')) {
val = $field.is(':checked');
} else {
val = $field.val();
}
attrs[$field.attr('name')] = val;
});
return attrs;
};
})(jQuery);
/*
http://www.JSON.org/json2.js
2011-02-23
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or ' '),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, strict: false, regexp: false */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
var JSON;
if (!JSON) {
JSON = {};
}
(function () {
"use strict";
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0 ? '[]' : gap ?
'[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0 ? '{}' : gap ?
'{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
'{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());
jQuery.extend({
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
if(window.ActiveXObject)
{
if(typeof uri== 'boolean'){
iframeHtml += ' src="' + 'javascript:false' + '"';
}
else if(typeof uri== 'string'){
iframeHtml += ' src="' + uri + '"';
}
}
iframeHtml += ' />';
jQuery(iframeHtml).appendTo(document.body);
return jQuery('#' + frameId).get(0);
},
createUploadForm: function(id, fileElementId, data)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
if(data)
{
for(var i in data)
{
jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
}
}
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if ( s.global && ! jQuery.active++ )
{
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {}
if ( s.global )
jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function(isTimeout)
{
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
var data = $(xml.responseText).html();
if ( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
data = JSON.parse(data);
//check for error in return JSON
if(data.error){
status = "error";
}else{
status = "success";
}
// Fire the global callback
if( s.global )
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
} catch(e) {
status = "error";
jQuery.handleError(s, xml, status, e);
}
// The request was completed
if( s.global )
jQuery.event.trigger( "ajaxComplete", [xml, s] );
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active )
jQuery.event.trigger( "ajaxStop" );
// Process result
if ( s.complete )
s.complete(data, status);
jQuery(io).unbind()
setTimeout(function()
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if ( s.timeout > 0 )
{
setTimeout(function(){
// Check to see if the request is still happening
if( !requestDone ) uploadCallback( "timeout" );
}, s.timeout);
}
try
{
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding)
{
jQuery(form).attr('encoding', 'multipart/form-data');
}
else
{
jQuery(form).attr('enctype', 'multipart/form-data');
}
jQuery(form).submit();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
jQuery('#' + frameId).load(uploadCallback );
return {abort: function () {}};
},
})
/*jslint browser: true */ /*global jQuery: true */
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
// TODO JsDoc
/**
* Create a cookie with the given key and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
* used when the cookie was set.
*
* @param String key The key of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
* If set to null or omitted, the cookie will be a session cookie and will not be retained
* when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/[email protected]
*/
/**
* Get the value of a cookie with the given key.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String key The key of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/[email protected]
*/
jQuery.cookie = function (key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && String(value) !== "[object Object]") {
options = jQuery.extend({}, options);
if (value === null || value === undefined) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
(function(/*! Stitch !*/) {
if (!this.require) {
var modules = {}, cache = {}, require = function(name, root) {
var module = cache[name], path = expand(root, name), fn;
if (module) {
return module;
} else if (fn = modules[path] || modules[path = expand(path, './index')]) {
module = {id: name, exports: {}};
try {
cache[name] = module.exports;
fn(module.exports, function(name) {
return require(name, dirname(path));
}, module);
return cache[name] = module.exports;
} catch (err) {
delete cache[name];
throw err;
}
} else {
throw 'module \'' + name + '\' not found';
}
}, expand = function(root, name) {
var results = [], parts, part;
if (/^\.\.?(\/|$)/.test(name)) {
parts = [root, name].join('/').split('/');
} else {
parts = name.split('/');
}
for (var i = 0, length = parts.length; i < length; i++) {
part = parts[i];
if (part == '..') {
results.pop();
} else if (part != '.' && part != '') {
results.push(part);
}
}
return results.join('/');
}, dirname = function(path) {
return path.split('/').slice(0, -1).join('/');
};
this.require = function(name) {
return require(name, '');
}
this.require.define = function(bundle) {
for (var key in bundle)
modules[key] = bundle[key];
};
}
return this.require.define;
}).call(this)({"collections/locations": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.LocationsCollection = (function() {
__extends(LocationsCollection, UberCollection);
function LocationsCollection() {
LocationsCollection.__super__.constructor.apply(this, arguments);
}
LocationsCollection.prototype.model = app.models.location;
return LocationsCollection;
})();
}).call(this);
}, "collections/payment_profiles": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.PaymentProfilesCollection = (function() {
__extends(PaymentProfilesCollection, UberCollection);
function PaymentProfilesCollection() {
PaymentProfilesCollection.__super__.constructor.apply(this, arguments);
}
PaymentProfilesCollection.prototype.model = app.models.paymentprofile;
return PaymentProfilesCollection;
})();
}).call(this);
}, "collections/trips": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.TripsCollection = (function() {
__extends(TripsCollection, UberCollection);
function TripsCollection() {
TripsCollection.__super__.constructor.apply(this, arguments);
}
TripsCollection.prototype.model = app.models.trip;
TripsCollection.prototype.url = '/trips';
TripsCollection.prototype.relationships = 'client,driver,city';
return TripsCollection;
})();
}).call(this);
}, "lib/config": function(exports, require, module) {(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
exports.config = (function() {
function config() {
this.get = __bind(this.get, this);
}
config.prototype.type = 'production';
config.prototype.configurations = {
'development': {
'api': '/api',
'dispatch': '/cn',
'url': 'http://dev.www.uber.com:8080',
'googleJsApiKey': 'ABQIAAAAKSiLiNwCxOW479xGFqHoTBTsMh9mumH-zfDa0AhzI7RTmmqoCRTv2C11J43hXCK7vZguPC7CgGDcNQ',
'debug': 'true',
'cache': '1'
},
'production': {
'api': '/api',
'dispatch': '/cn',
'url': 'http://www.uber.com',
'googleJsApiKey': 'ABQIAAAAKSiLiNwCxOW479xGFqHoTBTsMh9mumH-zfDa0AhzI7RTmmqoCRTv2C11J43hXCK7vZguPC7CgGDcNQ',
'debug': 'false',
'cache': '60'
},
'development-vm': {
'api': 'http://192.168.106.1:6543/api',
'url': 'http://192.168.106.1:8080',
'dispatch': '',
'googleJsApiKey': 'ABQIAAAAKSiLiNwCxOW479xGFqHoTBTsMh9mumH-zfDa0AhzI7RTmmqoCRTv2C11J43hXCK7vZguPC7CgGDcNQ',
'debug': 'true',
'cache': '1'
}
};
config.prototype.get = function(param) {
if (this.configurations[this.type][param] === void 0) {
return '';
}
return this.configurations[this.type][param];
};
return config;
})();
}).call(this);
}, "lib/uber_collection": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberCollection = (function() {
__extends(UberCollection, Backbone.Collection);
function UberCollection() {
UberCollection.__super__.constructor.apply(this, arguments);
}
UberCollection.prototype.parse = function(data) {
if (data.meta) {
this.meta = data.meta;
return data.resources;
}
return data;
};
return UberCollection;
})();
}).call(this);
}, "lib/uber_controller": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberController = (function() {
__extends(UberController, Backbone.Router);
function UberController() {
UberController.__super__.constructor.apply(this, arguments);
}
UberController.prototype.LoggedInRedirect = function(callback) {
if ($.cookie('token') !== null) {
return app.routers.clients.navigate('!/dashboard', true);
} else {
if (typeof callback === 'function') {
return callback.call();
}
}
};
UberController.prototype.LoggedOutRedirect = function(callback) {
if ($.cookie('token') === null) {
return app.routers.clients.navigate('!/sign-in', true);
} else {
if (typeof callback === 'function') {
return callback.call();
}
}
};
return UberController;
})();
}).call(this);
}, "lib/uber_sync": function(exports, require, module) {(function() {
exports.UberSync = function(method, model, options) {
var methodMap, params, type;
methodMap = {
'create': 'POST',
'update': 'PUT',
'delete': 'DELETE',
'read': 'GET'
};
type = methodMap[method];
params = _.extend({
type: type
}, options);
params.url = _.isString(this.url) ? API + this.url : API + this.url(type);
if (type === "DELETE") {
params.url = "" + params.url + "?token=" + USER.token;
}
if (!params.data && model && (method === 'create' || method === 'update')) {
params.data = JSON.parse(JSON.stringify(model.toJSON()));
}
if (Backbone.emulateJSON) {
params.contentType = 'application/x-www-form-urlencoded';
params.processData = true;
params.data = params.data ? {
model: params.data
} : {};
}
if (Backbone.emulateHTTP) {
if (type === 'PUT' || type === 'DELETE') {
if (Backbone.emulateJSON) {
params.data._method = type;
}
params.type = 'POST';
params.beforeSend = function(xhr) {
return xhr.setRequestHeader('X-HTTP-Method-Override', type);
};
}
}
if (!params.data) {
params.data = {};
}
if (!params.data.token && $.cookie('token')) {
params.data.token = $.cookie('token');
}
params.dataType = 'json';
params.cache = false;
return $.ajax(params);
};
}).call(this);
}, "lib/uber_view": function(exports, require, module) {(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberView = (function() {
__extends(UberView, Backbone.View);
function UberView() {
this.DownloadUserTrips = __bind(this.DownloadUserTrips, this);
UberView.__super__.constructor.apply(this, arguments);
}
UberView.prototype.place = function(content) {
var $target;
$target = this.options.scope ? this.options.scope.find(this.options.selector) : $(this.options.selector);
$target[this.options.method || 'html'](content || this.el);
this.delegateEvents();
return this;
};
UberView.prototype.mixin = function(m, args) {
var events, self;
if (args == null) {
args = {};
}
self = this;
events = m._events;
_.extend(this, m);
if (m.initialize) {
m.initialize(self, args);
}
return _.each(_.keys(events), function(key) {
var event, func, selector, split;
split = key.split(' ');
event = split[0];
selector = split[1];
func = events[key];
return $(self.el).find(selector).live(event, function(e) {
return self[func](e);
});
});
};
UberView.prototype.RefreshUserInfo = function(callback, silent) {
if (silent == null) {
silent = false;
}
try {
this.model = new app.models.client({
id: amplify.store('USERjson').id
});
} catch (e) {
if (e.name.toString() === "TypeError") {
app.routers.clients.navigate('!/sign-out', true);
} else {
throw e;
}
}
if (!silent) {
this.ShowSpinner("load");
}
return this.model.fetch({
success: __bind(function() {
this.HideSpinner();
$.cookie('token', this.model.get('token'));
amplify.store('USERjson', this.model);
this.ReadUserInfo(true);
if (typeof callback === 'function') {
return callback.call();
}
}, this),
data: {
relationships: 'unexpired_client_promotions,locations,credit_balance,payment_gateway.payment_profiles,client_bills_in_arrears.client_transaction,country'
},
dataType: 'json'
});
};
UberView.prototype.ReadUserInfo = function(forced) {
if (forced == null) {
forced = false;
}
if (!window.USER.id) {
window.USER = amplify.store('USERjson');
}
if (forced) {
return window.USER = amplify.store('USERjson');
}
};
UberView.prototype.DownloadUserPromotions = function(callback, forced) {
var downloadData, stored;
if (forced == null) {
forced = false;
}
downloadData = __bind(function() {
this.ShowSpinner("load");
this.model = new app.models.client({
id: amplify.store('USERjson').id
});
return this.model.fetch({
success: __bind(function() {
window.USER.client_promotions = this.model.get('valid_client_promotions');
this.CacheData('USERPromos', this.model.get('valid_client_promotions'));
if (typeof callback === 'function') {
return callback.call();
}
}, this),
data: {
relationships: 'valid_client_promotions.trips_remaining'
},
dataType: 'json'
});
}, this);
stored = this.GetCache('USERPromos');
if (stored && !forced) {
window.USER.client_promotions = stored;
if (typeof callback === 'function') {
callback.call();
}
} else {
downloadData();
}
};
UberView.prototype.DownloadUserTrips = function(callback, forced, limit) {
var downloadData, stored;
if (forced == null) {
forced = false;
}
if (limit == null) {
limit = 1000;
}
downloadData = __bind(function() {
this.ShowSpinner("load");
return app.collections.trips.fetch({
data: {
status: 'completed,canceled',
relationships: 'driver,city',
client_id: USER.id,
limit: limit
},
success: __bind(function() {
window.USER.trips = app.collections.trips;
this.CacheData('USERtrips', window.USER.trips);
if (typeof callback === 'function') {
callback.call();
}
return this.HideSpinner();
}, this),
dataType: 'json'
});
}, this);
stored = this.GetCache("USERtrips");
if (stored && !forced) {
if (app.collections.trips.length !== stored.length) {
app.collections.trips.reset(stored);
}
window.USER.trips = app.collections.trips;
if (typeof callback === 'function') {
return callback.call();
}
} else {
return downloadData();
}
};
UberView.prototype.ShowSpinner = function(type) {
if (type == null) {
type = 'load';
}
return $('.spinner#' + type).show();
};
UberView.prototype.HideSpinner = function() {
return $('.spinner').hide();
};
UberView.prototype.RequireMaps = function(callback) {
if (typeof google !== 'undefined' && google.maps) {
return callback();
} else {
return $.getScript("https://www.google.com/jsapi?key=" + (app.config.get('googleJsApiKey')), function() {
return google.load('maps', 3, {
callback: callback,
other_params: 'sensor=false&language=en&libraries=places'
});
});
}
};
UberView.prototype.CacheData = function(storeName, data) {
var currentTime;
amplify.store(storeName, data);
currentTime = new Date();
amplify.store("" + storeName + "TS", currentTime.getTime());
};
UberView.prototype.GetCache = function(storeName) {
var cacheTime, currentTime, storedTime;
cacheTime = parseInt(app.config.get('cache')) * 60 * 1000;
currentTime = new Date();
currentTime = currentTime.getTime();
storedTime = amplify.store("" + storeName + "TS");
if (storedTime) {
if (currentTime - storedTime < cacheTime) {
return amplify.store(storeName);
}
}
amplify.store("" + storeName + "TS", null);
amplify.store(storeName, null);
return false;
};
UberView.prototype.ClearGlobalStatus = function() {
$('#global_status').find(".success_message").html("").hide();
return $('#global_status').find(".error_message").html("").hide();
};
UberView.prototype.ShowError = function(message) {
if (message == null) {
message = "Error";
}
this.ClearGlobalStatus();
return $('#global_status').find(".error_message").html(message).fadeIn();
};
UberView.prototype.ShowSuccess = function(message) {
if (message == null) {
message = "Success";
}
this.ClearGlobalStatus();
return $('#global_status').find(".success_message").html(message).fadeIn('slow');
};
return UberView;
})();
}).call(this);
}, "main": function(exports, require, module) {(function() {
var ClientsBillingView, ClientsDashboardView, ClientsForgotPasswordView, ClientsInviteView, ClientsLoginView, ClientsPromotionsView, ClientsRequestsView, ClientsRouter, ClientsSettingsView, ClientsSignUpView, Config, ConfirmEmailView, CountriesCollection, CreditCardView, LocationsCollection, PaymentProfilesCollection, SharedFooterView, SharedMenuView, TripDetailView, TripsCollection;
Config = require('lib/config').config;
window.i18n = require('web-lib/i18n').i18n;
i18n.init();
Backbone.sync = require('lib/uber_sync').UberSync;
window.USER = {};
window.UberView = require('lib/uber_view').UberView;
window.UberCollection = require('lib/uber_collection').UberCollection;
window.UberController = require('lib/uber_controller').UberController;
window.app = {};
app.routers = {};
app.models = {};
app.collections = {};
app.views = {};
app.views.pages = {};
app.views.clients = {};
app.views.clients.modules = {};
app.views.shared = {};
app.views.pages.modules = {};
app.helpers = require('web-lib/helpers').helpers;
app.weblib_helpers = app.helpers;
app.models.client = require('models/client').Client;
app.models.trip = require('models/trip').Trip;
app.models.paymentprofile = require('models/paymentprofile').PaymentProfile;
app.models.clientbills = require('models/clientbills').ClientBills;
app.models.promotions = require('models/promotions').Promotions;
app.models.location = require('models/location').Location;
app.models.country = require('web-lib/models/country').Country;
TripsCollection = require('collections/trips').TripsCollection;
PaymentProfilesCollection = require('collections/payment_profiles').PaymentProfilesCollection;
LocationsCollection = require('collections/locations').LocationsCollection;
CountriesCollection = require('web-lib/collections/countries').CountriesCollection;
ClientsRouter = require('routers/clients_controller').ClientsRouter;
SharedMenuView = require('views/shared/menu').SharedMenuView;
SharedFooterView = require('web-lib/views/footer').SharedFooterView;
ClientsSignUpView = require('views/clients/sign_up').ClientsSignUpView;
ClientsLoginView = require('views/clients/login').ClientsLoginView;
ClientsForgotPasswordView = require('views/clients/forgot_password').ClientsForgotPasswordView;
ClientsDashboardView = require('views/clients/dashboard').ClientsDashboardView;
ClientsInviteView = require('views/clients/invite').ClientsInviteView;
ConfirmEmailView = require('views/clients/confirm_email').ClientsConfirmEmailView;
ClientsPromotionsView = require('views/clients/promotions').ClientsPromotionsView;
ClientsBillingView = require('views/clients/billing').ClientsBillingView;
ClientsSettingsView = require('views/clients/settings').ClientsSettingsView;
ClientsRequestsView = require('views/clients/request').ClientsRequestView;
TripDetailView = require('views/clients/trip_detail').TripDetailView;
CreditCardView = require('views/clients/modules/credit_card').CreditCardView;
$(document).ready(function() {
app.initialize = function() {
var key, _i, _len, _ref;
window.USER = new app.models.client;
if ($.cookie('redirected_user')) {
_ref = _.keys(amplify.store());
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
amplify.store(key, null);
}
$.cookie('user', $.cookie('redirected_user'));
$.cookie('token', JSON.parse($.cookie('user')).token);
amplify.store('USERjson', JSON.parse($.cookie('user')));
$.cookie('redirected_user', null, {
domain: '.uber.com'
});
}
if ($.cookie('user')) {
USER.set(JSON.parse($.cookie('user')));
}
app.config = new Config();
window.API = app.config.get('api');
window.DISPATCH = app.config.get('dispatch');
app.routers.clients = new ClientsRouter();
app.collections.trips = new TripsCollection();
app.collections.paymentprofiles = new PaymentProfilesCollection();
app.collections.locations = LocationsCollection;
app.collections.countries = CountriesCollection;
app.views.clients.create = new ClientsSignUpView();
app.views.clients.read = new ClientsLoginView();
app.views.clients.forgotpassword = new ClientsForgotPasswordView();
app.views.clients.dashboard = new ClientsDashboardView();
app.views.clients.invite = new ClientsInviteView();
app.views.clients.promotions = new ClientsPromotionsView();
app.views.clients.settings = new ClientsSettingsView();
app.views.clients.tripdetail = new TripDetailView();
app.views.clients.billing = new ClientsBillingView();
app.views.clients.confirmemail = new ConfirmEmailView();
app.views.clients.request = new ClientsRequestsView();
app.views.shared.menu = new SharedMenuView();
app.views.shared.footer = new SharedFooterView();
app.views.clients.modules.creditcard = CreditCardView;
if (Backbone.history.getFragment() === '') {
return app.routers.clients.navigate('!/sign-in', true);
}
};
app.refreshMenu = function() {
$('header').html(app.views.shared.menu.render().el);
return $('footer').html(app.views.shared.footer.render().el);
};
app.initialize();
app.refreshMenu();
return Backbone.history.start();
});
}).call(this);
}, "models/client": function(exports, require, module) {(function() {
var UberModel;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
UberModel = require('web-lib/uber_model').UberModel;
exports.Client = (function() {
__extends(Client, UberModel);
function Client() {
Client.__super__.constructor.apply(this, arguments);
}
Client.prototype.url = function() {
if (this.id) {
return "/clients/" + this.id;
} else {
return "/clients";
}
};
return Client;
})();
}).call(this);
}, "models/clientbills": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.ClientBills = (function() {
__extends(ClientBills, Backbone.Model);
function ClientBills() {
ClientBills.__super__.constructor.apply(this, arguments);
}
ClientBills.prototype.url = function() {
return "/client_bills/" + this.id;
};
return ClientBills;
})();
}).call(this);
}, "models/location": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.Location = (function() {
__extends(Location, Backbone.Model);
function Location() {
Location.__super__.constructor.apply(this, arguments);
}
Location.prototype.url = function() {
if (this.id) {
return "/locations/" + this.id;
} else {
return "/locations";
}
};
return Location;
})();
}).call(this);
}, "models/paymentprofile": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.PaymentProfile = (function() {
__extends(PaymentProfile, Backbone.Model);
function PaymentProfile() {
PaymentProfile.__super__.constructor.apply(this, arguments);
}
PaymentProfile.prototype.url = function() {
if (this.id) {
return "/payment_profiles/" + this.id;
} else {
return "/payment_profiles";
}
};
return PaymentProfile;
})();
}).call(this);
}, "models/promotions": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.Promotions = (function() {
__extends(Promotions, Backbone.Model);
function Promotions() {
Promotions.__super__.constructor.apply(this, arguments);
}
Promotions.prototype.url = function() {
return "/clients_promotions";
};
return Promotions;
})();
}).call(this);
}, "models/trip": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.Trip = (function() {
__extends(Trip, Backbone.Model);
function Trip() {
Trip.__super__.constructor.apply(this, arguments);
}
Trip.prototype.url = function() {
return "/trips/" + (this.get('id'));
};
return Trip;
})();
}).call(this);
}, "routers/clients_controller": function(exports, require, module) {(function() {
var ClientsLoginView;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
ClientsLoginView = require('views/clients/login').ClientsLoginView;
exports.ClientsRouter = (function() {
__extends(ClientsRouter, UberController);
function ClientsRouter() {
ClientsRouter.__super__.constructor.apply(this, arguments);
}
ClientsRouter.prototype.routes = {
"!/sign-up": "signup",
"!/sign-in": "signin",
"!/sign-out": "signout",
"!/forgot-password": "forgotpassword",
"!/forgot-password?email_token=:token": "passwordReset",
"!/dashboard": "dashboard",
"!/invite": "invite",
"!/promotions": "promotions",
"!/settings/information": "settingsInfo",
"!/settings/picture": "settingsPic",
"!/settings/locations": "settingsLoc",
"!/trip/:id": "tripDetail",
"!/billing": "billing",
"!/confirm-email?token=:token": "confirmEmail",
"!/invite/:invite": "signupInvite",
"!/request": "request"
};
ClientsRouter.prototype.signup = function(invite) {
var renderContent;
if (invite == null) {
invite = "";
}
renderContent = function() {
$('section').html(app.views.clients.create.render(invite).el);
document.title = t('Sign Up') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/sign-up"]').addClass('active');
};
return this.LoggedInRedirect(renderContent);
};
ClientsRouter.prototype.signupInvite = function(invite) {
return this.signup(invite);
};
ClientsRouter.prototype.forgotpassword = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.forgotpassword.render().el);
return document.title = t('Password Recovery') + ' | ' + t('Uber');
};
return this.LoggedInRedirect(renderContent);
};
ClientsRouter.prototype.signin = function() {
var renderContent;
renderContent = function() {
var view;
document.title = t('Login') + ' | ' + t('Uber');
view = new ClientsLoginView({
selector: 'section'
});
$('a').removeClass('active');
return $('a[href="/#!/sign-in"]').addClass('active');
};
return this.LoggedInRedirect(renderContent);
};
ClientsRouter.prototype.signout = function() {
$.cookie('token', null);
$.cookie('user', null);
amplify.store('USERjson', null);
amplify.store('USERtrips', null);
amplify.store('USERPromos', null);
app.refreshMenu();
return app.routers.clients.navigate('!/sign-in', true);
};
ClientsRouter.prototype.dashboard = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.dashboard.render().el);
document.title = t('Dashboard') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/dashboard"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.invite = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.invite.render().el);
document.title = t('Invite Friends') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/invite"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.tripDetail = function(id) {
var renderContent;
renderContent = function() {
$('a').removeClass('active');
$('section').html(app.views.clients.tripdetail.render(id).el);
return document.title = t('Trip Detail') + ' | ' + t('Uber');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.promotions = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.promotions.render().el);
document.title = t('Promotions') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/promotions"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.settingsInfo = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.settings.render('info').el);
$('a').removeClass('active');
return $('a[href="/#!/settings/information"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.settingsLoc = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.settings.render('loc').el);
$('a').removeClass('active');
return $('a[href="/#!/settings/information"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.settingsPic = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.settings.render('pic').el);
$('a').removeClass('active');
return $('a[href="/#!/settings/information"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.passwordReset = function(token) {
var renderContent;
if (token == null) {
token = '';
}
renderContent = function() {
$('section').html(app.views.clients.forgotpassword.render(token).el);
document.title = t('Password Reset') + ' | ' + t('Uber');
return $('a').removeClass('active');
};
return this.LoggedInRedirect(renderContent);
};
ClientsRouter.prototype.billing = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.billing.render().el);
document.title = t('Billing') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/billing"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.confirmEmail = function(token) {
$('section').html(app.views.clients.confirmemail.render(token).el);
document.title = t('Confirm Email') + ' | ' + t('Uber');
return $('a').removeClass('active');
};
ClientsRouter.prototype.request = function() {
var renderContent;
renderContent = function() {
$('section').html(app.views.clients.request.render().el);
document.title = t('Request Ride') + ' | ' + t('Uber');
$('a').removeClass('active');
return $('a[href="/#!/request"]').addClass('active');
};
return this.LoggedOutRedirect(renderContent);
};
ClientsRouter.prototype.errorPage = function(path) {
if (path == null) {
path = '';
}
return app.helpers.debug(path, "path");
};
return ClientsRouter;
})();
}).call(this);
}, "templates/clients/billing": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var arrears, numCards, printArrear, printCardOption;
numCards = parseInt(USER.payment_gateway.payment_profiles.length);
__out.push('\n');
arrears = USER.client_bills_in_arrears;
__out.push('\n\n');
printCardOption = function(card) {
__out.push('\n <option value="');
__out.push(__sanitize(card.id));
__out.push('"> ');
__out.push(__sanitize(t('Card Ending in')));
__out.push(' ');
__out.push(__sanitize(card.card_number));
return __out.push(' </option>\n');
};
__out.push('\n\n');
printArrear = function(arrear) {
__out.push('\n<tr>\n <td>\n <a href="#!/trip/');
__out.push(__sanitize(arrear.client_transaction.trip_id));
__out.push('"> <img src="https://uber-static.s3.amazonaws.com/map_icon.png" alt="');
__out.push(__sanitize(t('Trip Map')));
__out.push('" /></a>\n <div class="arrear_info">\n <span id="amount"> ');
__out.push(__sanitize(t('Amount', {
amount: app.helpers.formatCurrency(Math.abs(arrear.client_transaction.amount))
})));
__out.push(' </span>\n <span id="date"> ');
__out.push(__sanitize(t('Last Attempt to Bill', {
date: app.helpers.parseDate(arrear.updated_at)
})));
__out.push(' </span>\n </div>\n </td>\n ');
if (numCards !== 0) {
__out.push('\n <td>\n <p class="error_message"></p>\n <p class="success_message"></p>\n <select id="card_to_charge">\n ');
_.each(USER.payment_gateway.payment_profiles, printCardOption);
__out.push('\n </select>\n <button class="button charge_arrear" id="');
__out.push(__sanitize(arrear.id));
__out.push('" data-theme="a"><span>');
__out.push(__sanitize(t('Charge')));
__out.push('</span></button>\n </td>\n ');
}
return __out.push('\n</tr>\n');
};
__out.push('\n\n\n\n');
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Billing")
}));
__out.push('\n\n<div id="main_content">\n <div>\n <div id="credit_card_wrapper">\n <div id="global_status">\n <span class="success_message"></span>\n <span class="error_message"></span>\n </div>\n\n ');
if (USER.payment_gateway.payment_profiles.length > 0) {
__out.push('\n <h2>');
__out.push(__sanitize(t('Credit Cards')));
__out.push('</h2>\n <div id="cards"></div>\n <p><a id="add_card" href="">');
__out.push(__sanitize(t('add a new credit card')));
__out.push('</a></p>\n ');
} else {
__out.push('\n <div id="add_card_wrapper"> </div>\n ');
}
__out.push('\n </div>\n ');
if (USER.credit_balance > 0) {
__out.push('\n <div id="account_balance_wrapper">\n <h2>');
__out.push(__sanitize(t('Account Balance')));
__out.push('</h2>\n <p>\n ');
__out.push(__sanitize(t("Uber Credit Balance Note", {
amount: app.helpers.formatCurrency(USER.credit_balance)
})));
__out.push('\n </p>\n </div>\n ');
}
__out.push('\n ');
if (arrears.length > 0) {
__out.push('\n <div id="arrears_wrapper">\n <h2>');
__out.push(__sanitize(t('Arrears')));
__out.push('</h2>\n ');
if (numCards === 0) {
__out.push('\n <strong> ');
__out.push(__sanitize(t('Please Add Credit Card')));
__out.push(' </strong>\n ');
}
__out.push('\n <table>\n <tbody>\n ');
_.each(arrears, printArrear);
__out.push('\n </tbody>\n </table>\n </div>\n ');
}
__out.push('\n </div>\n</div>\n<div id="main_shadow"></div>\n\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/confirm_email": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="sub_header">\n <h1>');
__out.push(__sanitize(t('Confirm Email')));
__out.push('</h1>\n</div>\n\n<div id="main_content">\n <div>\n <h3 id="attempt_text">');
__out.push(__sanitize(t('Confirm Email Message')));
__out.push('</h3>\n <h3 class="success_message" style="display:none">');
__out.push(__sanitize(t('Confirm Email Succeeded')));
__out.push('</h3>\n <h3 class="already_confirmed_message" style="display:none">');
__out.push(__sanitize(t('Email Already Confirmed')));
__out.push('</h3>\n <h3 class="error_message" style="display:none">');
__out.push(__sanitize(t('Confirm Email Failed')));
__out.push('</h3>\n </div>\n</div>\n<div id="main_shadow"></div>\n\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/dashboard": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var printStar, trip, _i, _len, _ref, _ref2, _ref3, _ref4;
printStar = function() {
return __out.push('\n <img alt="Star" src="/web/img/star.png"/>\n');
};
__out.push('\n\n');
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Dashboard")
}));
__out.push('\n\n\n<div id="main_content">\n <div>\n <div id="confirmation">\n ');
if (((_ref = USER.payment_gateway) != null ? (_ref2 = _ref.payment_profiles) != null ? _ref2.length : void 0 : void 0) > 0) {
__out.push('\n <div id="confirmed_credit_card" class="true left">');
__out.push(__sanitize(t('Credit Card Added')));
__out.push('</div>\n ');
} else {
__out.push('\n <div id="confirmed_credit_card" class="false left"><a id="card" class="confirmation" href="">');
__out.push(__sanitize(t('No Credit Card')));
__out.push('</a></div>\n ');
}
__out.push('\n\n ');
if (USER.confirm_mobile === true) {
__out.push('\n <div id="confirmed_mobile" class="true">');
__out.push(__sanitize(t('Mobile Number Confirmed')));
__out.push('</div>\n ');
} else {
__out.push('\n <div id="confirmed_mobile" class="false"><a id="mobile" class="confirmation" href="">');
__out.push(__sanitize(t('No Confirmed Mobile')));
__out.push('</a></div>\n ');
}
__out.push('\n\n ');
if (USER.confirm_email === true) {
__out.push('\n <div id="confirmed_email" class="true right">');
__out.push(__sanitize(t('E-mail Address Confirmed')));
__out.push('</div>\n ');
} else {
__out.push('\n <div id="confirmed_email" class="false right"><a id="email" class="confirmation" href="">');
__out.push(__sanitize(t('No Confirmed E-mail')));
__out.push('</a></div>\n ');
}
__out.push('\n\n <div id="more_info" style="display:none;">\n <div id="mobile" class="info">\n <span>');
__out.push(__sanitize(t('Reply to sign up text')));
__out.push('</span>\n <a id="resend_mobile" class="resend" href="">');
__out.push(__sanitize(t('Resend text message')));
__out.push('</a>\n </div>\n <div id="email" class="info">\n <span>');
__out.push(__sanitize(t('Click sign up link')));
__out.push('</span>\n <a id="resend_email" class="resend" href="">');
__out.push(__sanitize(t('Resend email')));
__out.push('</a>\n </div>\n <div id="card" class="info">\n <span>');
__out.push(__sanitize(t("Add a credit card to ride")));
__out.push('</span>\n </div>\n </div>\n </div>\n\n <div id="dashboard_trips">\n ');
if (USER.trips.length > 0) {
__out.push('\n <div id="trip_details_map"></div>\n <div id="trip_details_info">\n <h2>');
__out.push(__sanitize(t('Your Most Recent Trip')));
__out.push('</h2>\n <span><a href="#!/trip/');
__out.push(__sanitize(_.first(USER.trips.models).get('random_id')));
__out.push('">');
__out.push(__sanitize(t('details')));
__out.push('</a></span>\n\n <div id="avatars">\n <img alt="Driver image" height="45" src="');
__out.push(__sanitize(_.first(USER.trips.models).get('driver').picture_url));
__out.push('" width="45"/>\n <span>');
__out.push(__sanitize("" + (_.first(USER.trips.models).get('driver').first_name)));
__out.push('</span>\n <div class="clear">\n </div>\n </div>\n <h3>');
__out.push(__sanitize(t('Rating')));
__out.push('</h3>\n ');
_(_.first(USER.trips.models).get('driver_rating')).times(printStar);
__out.push('\n </div>\n <div class="clear">\n </div>\n <div class="table_wrapper">\n <h2>');
__out.push(__sanitize(t('Your Trip History ')));
__out.push('</h2>\n <table class="zebra">\n <colgroup>\n <col width="*" />\n <col width="200" />\n <col width="120" />\n <col width="100" />\n </colgroup>\n <thead>\n <tr>\n <td class="text">\n ');
__out.push(__sanitize(t('Pickup Time')));
__out.push('\n </td>\n <td class="text">\n ');
__out.push(__sanitize(t('Status')));
__out.push('\n </td>\n <td class="text">\n ');
__out.push(__sanitize(t('Driver')));
__out.push('\n </td>\n <td class="graphic">\n ');
__out.push(__sanitize(t('Rating')));
__out.push('\n </td>\n <td class="num">\n ');
__out.push(__sanitize(t('Fare')));
__out.push('\n </td>\n </tr>\n </thead>\n <tbody>\n ');
_ref3 = USER.trips.models;
for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
trip = _ref3[_i];
__out.push('\n <tr>\n <td class="text"><a href="#!/trip/');
__out.push(__sanitize(trip.get('random_id')));
__out.push('">');
__out.push(__sanitize(app.helpers.formatDate(trip.get('request_at'), true, trip.get('city').timezone)));
__out.push('</a></td>\n <td class="text">');
__out.push(__sanitize(trip.get('status')));
__out.push('</td>\n <td class="text">');
__out.push(__sanitize((_ref4 = trip.get('driver')) != null ? _ref4.first_name : void 0));
__out.push('</td>\n <td class="graphic">');
_(trip.get('driver_rating')).times(printStar);
__out.push('</td>\n <td class="num">');
__out.push(__sanitize(app.helpers.formatTripFare(trip)));
__out.push('</td>\n </tr>\n ');
}
__out.push('\n </tbody>\n </table>\n <a id="show_all_trips" href="">');
__out.push(__sanitize(t('Show all trips')));
__out.push('</a>\n </div>\n ');
} else {
__out.push('\n <p><strong>');
__out.push(__sanitize(t("Here's how it works:")));
__out.push('</strong></p>\n <ol class="spaced">\n <li>\n ');
__out.push(__sanitize(t('Set your location:')));
__out.push('\n <ul>\n <li>');
__out.push(__sanitize(t('App search for address')));
__out.push('</li>\n <li>');
__out.push(__sanitize(t('SMS text address')));
__out.push('</li>\n </ul>\n </li>\n <li>');
__out.push(__sanitize(t('Confirm pickup request')));
__out.push('</li>\n <li>');
__out.push(__sanitize(t('Uber sends ETA')));
__out.push('</li>\n <li>');
__out.push(__sanitize(t('Car arrives')));
__out.push('</li>\n <li>');
__out.push(__sanitize(t('Ride to destination')));
__out.push('</li>\n </ol>\n <p>');
__out.push(__sanitize(t('Thank your driver')));
__out.push('</p>\n ');
}
__out.push('\n </div>\n\n </div>\n</div>\n<div id="main_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/forgot_password": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="form_container">\n ');
if (this.token) {
__out.push('\n <h1>');
__out.push(__sanitize(t('Password Reset')));
__out.push('</h1>\n <div id="standard_form">\n\n <p>');
__out.push(__sanitize(t('Please choose a new password.')));
__out.push('</p>\n\n <p class="error_message" style="display:none;">');
__out.push(__sanitize(t('Password Reset Error')));
__out.push('</p>\n\n <form id="password_reset" action="" method="">\n\n <input id="token" type="hidden" name="token" value="');
__out.push(__sanitize(this.token));
__out.push('">\n\n <div class="form_label">\n <label for="password">');
__out.push(__sanitize(t('New Password')));
__out.push('</label>\n </div>\n\n <div class="form_input">\n <input id="password" name="password" type="password" value=""/>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="formSubmitButton"><button id="password_reset_submit" type="submit" class="button" data-theme="a"><span>Reset Password</span></button></div>\n\n </form>\n </div>\n\n ');
} else {
__out.push('\n <h1>');
__out.push(__sanitize(t('Forgot Password')));
__out.push('</h1>\n <div id="standard_form">\n\n <p>');
__out.push(t('Forgot Password Enter Email'));
__out.push('\n\n <p class="error_message" style="display:none;">');
__out.push(__sanitize(t('Forgot Password Error')));
__out.push('</p>\n\n <p class="success_message" style="display:none;">');
__out.push(__sanitize(t('Forgot Password Success')));
__out.push('</p>\n\n <form id="forgot_password" action="" method="">\n\n <div class="form_label">\n <label for="login">');
__out.push(__sanitize(t('Email Address')));
__out.push('</label>\n </div>\n\n <div class="form_input">\n <input id="login" name="login" type="text" value=""/>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="formSubmitButton"><button type="submit" class="button" data-theme="a"><span>');
__out.push(__sanitize(t('Reset Password')));
__out.push('</span></button></div>\n </form>\n\n </div>\n ');
}
__out.push('\n\n</div>\n\n<div id="small_container_shadow"><div class="left"></div><div class="right"></div></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/invite": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Invite friends")
}));
__out.push('\n\n<div id="main_content">\n <div>\n <h2>');
__out.push(__sanitize(t('Give $ Get $')));
__out.push('</h2>\n\n <p>\n ');
__out.push(__sanitize(t('Give $ Get $ Description')));
__out.push('\n </p>\n\n <p>');
__out.push(__sanitize(t('What are you waiting for?')));
__out.push('</p>\n <div id="social_icons">\n <div>\n <a style="float:left" href="https://twitter.com/share" class="twitter-share-button" data-url="');
__out.push(__sanitize(USER.referral_url));
__out.push('" data-text="Sign up for @uber with my link and get $10 off your first ride! " data-count="none">');
__out.push(__sanitize(t('Tweet')));
__out.push('</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>\n </div>\n <div>\n <div id="fb-root"></div>\n <script>(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n js = d.createElement(s); js.id = id;\n js.src = "//connect.facebook.net/" + window.i18n.getLocale() + "/all.js#appId=124678754298965&xfbml=1";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, \'script\', \'facebook-jssdk\'));</script>\n\n <div class="fb-like" data-href="');
__out.push(__sanitize(USER.referral_url));
__out.push('" data-send="true" data-layout="button_count" data-width="180" data-show-faces="false" data-action="recommend" data-font="lucida grande"></div>\n </div>\n </div>\n <br>\n <p>');
__out.push(__sanitize(t('Invite Link')));
__out.push(' <a href="');
__out.push(__sanitize(USER.referral_url));
__out.push('">');
__out.push(__sanitize(USER.referral_url));
__out.push('</a> </p>\n\n </div>\n</div>\n<div id="main_shadow"></div>\n\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/login": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="form_container">\n\t<h1>');
__out.push(__sanitize(t('Sign In')));
__out.push('</h1>\n\t<div id="standard_form">\n\t\t<form method="post">\n\n\t\t\t<p class="error_message" style="display:none;"></span>\n\n\t\t\t<div class="form_label">\n\t\t\t\t<label for="login">');
__out.push(__sanitize(t('Email Address')));
__out.push('</label>\n\t\t\t</div>\n\t\t\t<div class="form_input">\n\t\t\t\t<input id="login" name="login" type="text" value=""/>\n\t\t\t</div>\n\n\t\t\t<div class="form_clear"></div>\n\n\t\t\t<div class="form_label">\n\t\t\t\t<label for="password">');
__out.push(__sanitize(t('Password')));
__out.push('</label>\n\t\t\t</div>\n\t\t\t<div class="form_input">\n\t\t\t\t<input id="password" name="password" type="password" value=""/>\n\t\t\t</div>\n\n\t\t\t<div class="form_clear"></div>\n\n <div class="formSubmitButton"><button type="submit" class="button" data-theme="a"><span>');
__out.push(__sanitize(t('Sign In')));
__out.push('</span></button></div>\n\n <h2><a href=\'/#!/forgot-password\'>');
__out.push(__sanitize(t('Forgot Password?')));
__out.push('</a></h2>\n\n\t\t</form>\n\t</div>\n</div>\n\n<div class="clear"></div>\n<div id="small_container_shadow"><div class="left"></div><div class="right"></div></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/modules/credit_card": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var printCard;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
if (this.cards === "new") {
__out.push('\n <div id="cc_form_wrapper" class="inline_label_form wider_inline_label_form">\n <form action="" id="credit_card_form" method="">\n <div id="top_of_form" class="error_message"></div>\n <div id="card_logos"></div>\n <div id="credit_card_number_wrapper" data-role="fieldcontain">\n <div class="error_message"></div>\n <label>');
__out.push(__sanitize(t('Credit Card Number')));
__out.push('</label>\n <input id="card_number" name="card_number" type="text"/>\n </div>\n <div class="clear"></div>\n <div id="expiration_wrapper" data-role="fieldcontain">\n <div class="error_message"></div>\n <label for="expiration_month">');
__out.push(__sanitize(t('Expiration')));
__out.push('</label>\n <select id="card_expiration_month" name="expiration_month">\n <option value="">');
__out.push(__sanitize(t('month')));
__out.push('</option>\n <option value="01">');
__out.push(__sanitize(t('01-Jan')));
__out.push('</option>\n <option value="02">');
__out.push(__sanitize(t('02-Feb')));
__out.push('</option>\n <option value="03">');
__out.push(__sanitize(t('03-Mar')));
__out.push('</option>\n <option value="04">');
__out.push(__sanitize(t('04-Apr')));
__out.push('</option>\n <option value="05">');
__out.push(__sanitize(t('05-May')));
__out.push('</option>\n <option value="06">');
__out.push(__sanitize(t('06-Jun')));
__out.push('</option>\n <option value="07">');
__out.push(__sanitize(t('07-Jul')));
__out.push('</option>\n <option value="08">');
__out.push(__sanitize(t('08-Aug')));
__out.push('</option>\n <option value="09">');
__out.push(__sanitize(t('09-Sep')));
__out.push('</option>\n <option value="10">');
__out.push(__sanitize(t('10-Oct')));
__out.push('</option>\n <option value="11">');
__out.push(__sanitize(t('11-Nov')));
__out.push('</option>\n <option value="12">');
__out.push(__sanitize(t('12-Dec')));
__out.push('</option>\n </select>\n </div>\n <div>\n <span style="display:inline" class="error_message"></span>\n <select id="card_expiration_year" name="expiration_year">\n <option selected="selected" value="">');
__out.push(__sanitize(t('year')));
__out.push('</option>\n <option value="2011">');
__out.push(__sanitize(t('2011')));
__out.push('</option>\n <option value="2012">');
__out.push(__sanitize(t('2012')));
__out.push('</option>\n <option value="2013">');
__out.push(__sanitize(t('2013')));
__out.push('</option>\n <option value="2014">');
__out.push(__sanitize(t('2014')));
__out.push('</option>\n <option value="2015">');
__out.push(__sanitize(t('2015')));
__out.push('</option>\n <option value="2016">');
__out.push(__sanitize(t('2016')));
__out.push('</option>\n <option value="2017">');
__out.push(__sanitize(t('2017')));
__out.push('</option>\n <option value="2018">');
__out.push(__sanitize(t('2018')));
__out.push('</option>\n <option value="2019">');
__out.push(__sanitize(t('2019')));
__out.push('</option>\n <option value="2020">');
__out.push(__sanitize(t('2020')));
__out.push('</option>\n </select>\n </div>\n <div class="clear"></div>\n <div id="cvv_wrapper" data-role="fieldcontain">\n <div class="error_message"></div>\n <label for="card_code">');
__out.push(__sanitize(t('CVV')));
__out.push('</label>\n <input id="card_code" name="card_code" type="text"/>\n </div>\n <div class="clear"></div>\n <div>\n <label for="use_case">');
__out.push(__sanitize(t('Category')));
__out.push('</label>\n <select id="use_case">\n <option value="personal" selected="true">');
__out.push(__sanitize(t('personal')));
__out.push('</option>\n <option value="business">');
__out.push(__sanitize(t('business')));
__out.push('</option>\n </select>\n </div>\n <div class="clear"></div>\n <div id="default_wrapper" data-role="fieldcontain">\n <label for="default">');
__out.push(__sanitize(t('Default Credit Card')));
__out.push('</label>\n <input id="default_check" type="checkbox" name="default" value="true"/>\n </div>\n <div class="clear"></div>\n <div>\n <button id="new_card" type="submit" class="button" data-theme="a"><span>');
__out.push(__sanitize(t('Add Credit Card')));
__out.push('</span></button>\n </div>\n </form>\n </div>\n');
} else {
__out.push('\n ');
printCard = __bind(function(card, index) {
var exp, style;
__out.push('\n <tr id="');
__out.push(__sanitize("d" + index));
__out.push('">\n <td>\n ');
style = "background-position:-173px";
__out.push('\n ');
if (card.get("card_type") === "Visa") {
style = "background-position:0px";
}
__out.push('\n ');
if (card.get("card_type") === "MasterCard") {
style = "background-position:-42px";
}
__out.push('\n ');
if (card.get("card_type") === "American Express") {
style = "background-position:-130px";
}
__out.push('\n ');
if (card.get("card_type") === "Discover Card") {
style = "background-position:-85px";
}
__out.push('\n <div class="card_type" style="');
__out.push(__sanitize(style));
__out.push('"></div>\n </td>\n <td>\n ****');
__out.push(__sanitize(card.get("card_number")));
__out.push('\n </td>\n <td>\n ');
if (card.get("card_expiration")) {
__out.push('\n ');
__out.push(__sanitize(t('Expiry')));
__out.push('\n ');
exp = card.get('card_expiration').split('-');
__out.push('\n ');
__out.push(__sanitize("" + exp[0] + "-" + exp[1]));
__out.push('\n ');
}
__out.push('\n </td>\n <td>\n <select class="use_case">\n <option ');
__out.push(__sanitize(card.get("use_case") === "personal" ? "selected" : void 0));
__out.push(' value="personal">');
__out.push(__sanitize(t('personal')));
__out.push('</option>\n <option ');
__out.push(__sanitize(card.get("use_case") === "business" ? "selected" : void 0));
__out.push(' value="business">');
__out.push(__sanitize(t('business')));
__out.push('</option>\n </select>\n </td>\n <td>\n ');
if (card.get("default")) {
__out.push('\n <strong>(');
__out.push(__sanitize(t('default card')));
__out.push(')</strong>\n ');
}
__out.push('\n ');
if (this.cards.length > 1 && !card.get("default")) {
__out.push('\n <a class="make_default" href="">');
__out.push(__sanitize(t('make default')));
__out.push('</a>\n ');
}
__out.push('\n </td>\n <td>\n <a class="edit_card_show" href="">');
__out.push(__sanitize(t('Edit')));
__out.push('</a>\n </td>\n <td>\n ');
if (this.cards.length > 1) {
__out.push('\n <a class="delete_card" href="">');
__out.push(__sanitize(t('Delete')));
__out.push('</a>\n ');
}
__out.push('\n </td>\n </tr>\n <tr id=\'');
__out.push(__sanitize("e" + index));
__out.push('\' style="display:none;"><td colspan="7">\n <form action="" method="">\n <div>\n <strong><label for="expiration_month">');
__out.push(__sanitize(t('Expiry Month')));
__out.push('</label></strong>\n <select id="card_expiration_month" name="expiration_month">\n <option value="">');
__out.push(__sanitize(t('month')));
__out.push('</option>\n <option value="01">');
__out.push(__sanitize(t('01-Jan')));
__out.push('</option>\n <option value="02">');
__out.push(__sanitize(t('02-Feb')));
__out.push('</option>\n <option value="03">');
__out.push(__sanitize(t('03-Mar')));
__out.push('</option>\n <option value="04">');
__out.push(__sanitize(t('04-Apr')));
__out.push('</option>\n <option value="05">');
__out.push(__sanitize(t('05-May')));
__out.push('</option>\n <option value="06">');
__out.push(__sanitize(t('06-Jun')));
__out.push('</option>\n <option value="07">');
__out.push(__sanitize(t('07-Jul')));
__out.push('</option>\n <option value="08">');
__out.push(__sanitize(t('08-Aug')));
__out.push('</option>\n <option value="09">');
__out.push(__sanitize(t('09-Sep')));
__out.push('</option>\n <option value="10">');
__out.push(__sanitize(t('10-Oct')));
__out.push('</option>\n <option value="11">');
__out.push(__sanitize(t('11-Nov')));
__out.push('</option>\n <option value="12">');
__out.push(__sanitize(t('12-Dec')));
__out.push('</option>\n </select>\n </div>\n <div>\n <strong><label for="expiration_year">');
__out.push(__sanitize(t('Expiry Year')));
__out.push('</label></strong>\n <select id="card_expiration_year" name="expiration_year">\n <option selected="selected" value="">');
__out.push(__sanitize(t('year')));
__out.push('</option>\n <option value="2011">');
__out.push(__sanitize(t('2011')));
__out.push('</option>\n <option value="2012">');
__out.push(__sanitize(t('2012')));
__out.push('</option>\n <option value="2013">');
__out.push(__sanitize(t('2013')));
__out.push('</option>\n <option value="2014">');
__out.push(__sanitize(t('2014')));
__out.push('</option>\n <option value="2015">');
__out.push(__sanitize(t('2015')));
__out.push('</option>\n <option value="2016">');
__out.push(__sanitize(t('2016')));
__out.push('</option>\n <option value="2017">');
__out.push(__sanitize(t('2017')));
__out.push('</option>\n <option value="2018">');
__out.push(__sanitize(t('2018')));
__out.push('</option>\n <option value="2019">');
__out.push(__sanitize(t('2019')));
__out.push('</option>\n <option value="2020">');
__out.push(__sanitize(t('2020')));
__out.push('</option>\n <option value="2021">');
__out.push(__sanitize(t('2021')));
__out.push('</option>\n <option value="2022">');
__out.push(__sanitize(t('2022')));
__out.push('</option>\n </select>\n </div>\n <div>\n <strong><label for="card_code">');
__out.push(__sanitize(t('CVV')));
__out.push('</label></strong>\n <input id="card_code" name="card_code" type="text"/>\n </div>\n <button class="button edit_card" data-theme="a"><span>');
__out.push(__sanitize(t('Save')));
return __out.push('</span></button>\n </form>\n </td></tr>\n ');
}, this);
__out.push('\n\n <div id="card_edit_form">\n <table>\n ');
_.each(this.cards.models, printCard);
__out.push('\n </table>\n </div>\n\n');
}
__out.push('\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/modules/sub_header": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="sub_header">\n <div id="title">');
__out.push(__sanitize(this.heading));
__out.push('</div>\n <div id="greeting">\n ');
if (window.USER.first_name) {
__out.push('\n ');
__out.push(__sanitize(t('Hello Greeting', {
name: USER.first_name
})));
__out.push('\n ');
}
__out.push('\n </div>\n</div>\n<div class="clear"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/promotions": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var promo, _i, _len, _ref;
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Promotions")
}));
__out.push('\n\n<div id="main_content">\n <div>\n <div id="global_status">\n <span class="success_message"></span>\n <span class="error_message"></span>\n </div>\n <form action="/dashboard/promotions/create" method="post">\n <label for="code">');
__out.push(__sanitize(t('Enter Promotion Code')));
__out.push('</label>\n <input id="code" name="code" type="text" />\n\n <button type="submit" class="button"><span>');
__out.push(__sanitize(t('Submit')));
__out.push('</span></button>\n </form>\n ');
if (this.promos.length > 0) {
__out.push('\n <div class="table_wrapper">\n <h2>');
__out.push(__sanitize(t('Your Available Promotions')));
__out.push('</h2>\n <table>\n <thead>\n\n <tr>\n <td>');
__out.push(__sanitize(t('Code')));
__out.push('</td>\n <td>');
__out.push(__sanitize(t('Details')));
__out.push('</td>\n <td>');
__out.push(__sanitize(t('Starts')));
__out.push('</td>\n <td>');
__out.push(__sanitize(t('Expires')));
__out.push('</td>\n </tr>\n </thead>\n <tbody>\n ');
_ref = this.promos;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
promo = _ref[_i];
__out.push('\n <tr>\n <td>');
__out.push(__sanitize(promo.code));
__out.push('</td>\n <td>');
__out.push(__sanitize(promo.description));
__out.push('</td>\n <td>');
__out.push(__sanitize(app.helpers.formatDate(promo.starts_at, true, "America/Los_Angeles")));
__out.push('</td>\n <td>');
__out.push(__sanitize(app.helpers.formatDate(promo.ends_at, true, "America/Los_Angeles")));
__out.push('</td>\n </tr>\n ');
}
__out.push('\n </tbody>\n </table>\n </div>\n ');
} else {
__out.push('\n\n <p>');
__out.push(__sanitize(t('No Active Promotions')));
__out.push('</p>\n ');
}
__out.push('\n\n </div>\n</div>\n<div id="main_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/request": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var showFavoriteLocation;
showFavoriteLocation = function(location, index) {
var alphabet;
__out.push('\n ');
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
__out.push('\n <tr id="f');
__out.push(__sanitize(index));
__out.push('" class="location_row">\n <td class="marker_logo">\n <img src="https://www.google.com/mapfiles/marker');
__out.push(__sanitize(alphabet[index]));
__out.push('.png" />\n </td>\n <td class="location_nickname_wrapper">\n <span >');
__out.push(__sanitize(location.nickname));
return __out.push('</span>\n </td>\n </tr>\n');
};
__out.push('\n\n');
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Ride Request")
}));
__out.push('\n\n\n<div id="main_content">\n <div>\n <div id="top_bar">\n <form id="search_form" action="" method="post">\n <label for="address">');
__out.push(__sanitize(t('Where do you want us to pick you up?')));
__out.push('</label>\n <input id="address" name="address" type="text" placeholder="');
__out.push(__sanitize(t('Address to search')));
__out.push('"/>\n <button type="submit" id="address" class="button"><span>');
__out.push(__sanitize(t('Search')));
__out.push('</span></button>\n </form>\n </div>\n\n <div id="sidebar">\n <div id="waiting_riding" class="panel">\n <table>\n <tr>\n <td>\n <p class="label">');
__out.push(__sanitize(t('Driver Name:')));
__out.push('</p>\n <p id="rideName"></p>\n </td>\n </tr>\n <tr>\n <td>\n <p class="label">');
__out.push(__sanitize(t('Driver #:')));
__out.push('</p>\n <p id="ridePhone"></p>\n </td>\n </tr>\n <tr id="ride_address_wrapper">\n <td>\n <p class="label">');
__out.push(__sanitize(t('Pickup Address:')));
__out.push('</p>\n <p id="rideAddress"></p>\n </td>\n <td id="favShow">\n <img alt="');
__out.push(__sanitize(t('Add to Favorite Locations')));
__out.push('" id="addToFavButton" src="/web/img/button_plus_gray.png"/>\n </td>\n </tr>\n <tr>\n <td>\n <form id="favLoc_form" action="" method="post">\n <p class="error_message"></p>\n <span class="label">');
__out.push(__sanitize(t('Nickname:')));
__out.push('</span>\n <input type="hidden" value="" id="pickupLat" />\n <input type="hidden" value="" id="pickupLng" />\n <input id="favLocNickname" name="nickname" type="text"/>\n <button type="submit" class="button"><span>');
__out.push(__sanitize(t('Add')));
__out.push('</span></button>\n </form>\n </td>\n </tr>\n </table>\n </div>\n <div id="trip_completed_panel" class="panel">\n <h2>');
__out.push(__sanitize(t('Your last trip')));
__out.push('</h2>\n <form id="rating_form">\n <label>');
__out.push(__sanitize(t('Please rate your driver:')));
__out.push('</label>\n <img alt="');
__out.push(__sanitize(t('Star')));
__out.push('" class="stars" id="1" src="/web/img/star_inactive.png"/>\n <img alt="');
__out.push(__sanitize(t('Star')));
__out.push('" class="stars" id="2" src="/web/img/star_inactive.png"/>\n <img alt="');
__out.push(__sanitize(t('Star')));
__out.push('" class="stars" id="3" src="/web/img/star_inactive.png"/>\n <img alt="');
__out.push(__sanitize(t('Star')));
__out.push('" class="stars" id="4" src="/web/img/star_inactive.png"/>\n <img alt="');
__out.push(__sanitize(t('Star')));
__out.push('" class="stars" id="5" src="/web/img/star_inactive.png"/>\n <label>');
__out.push(__sanitize(t('Comments: (optional)')));
__out.push('</label>\n <textarea id="comments" name="comments" type="text"/>\n <button type="submit" id="rating" class="button"><span>');
__out.push(__sanitize(t('Rate Trip')));
__out.push('</span></button>\n </form>\n <table>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Pickup time:')));
__out.push('</td>\n <td id="tripTime"></td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Miles:')));
__out.push('</td>\n <td id="tripDist"></td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Trip time:')));
__out.push('</td>\n <td id="tripDur"></td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Fare:')));
__out.push('</td>\n <td id="tripFare"></td>\n </tr>\n </table>\n </div>\n <div id="location_panel_control" class="panel">\n <a id="favorite" style="font-weight:bold;" class="locations_link" >');
__out.push(__sanitize(t('Favorite Locations')));
__out.push('</a> |\n <a href="" id="search" class="locations_link">');
__out.push(__sanitize(t('Search Results')));
__out.push('</a>\n </div>\n <div id="location_panel" class="panel">\n <div id="favorite_results">\n ');
if (USER.locations) {
__out.push('\n <table>\n ');
_.each(USER.locations, showFavoriteLocation);
__out.push('\n </table>\n ');
} else {
__out.push('\n <p>');
__out.push(__sanitize(t('You have no favorite locations saved.')));
__out.push('</p>\n ');
}
__out.push('\n </div>\n <div id="search_results">\n </div>\n </div>\n </div>\n <span id="status_message" >');
__out.push(__sanitize(t('Loading...')));
__out.push('</span>\n <div id="map_wrapper_right"></div>\n <a id="pickupHandle" type="submit" class="button_green"><span>');
__out.push(__sanitize(t('Request Pickup')));
__out.push('</span></a>\n <div class="clear"></div>\n </div>\n</div>\n<div id="main_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/settings": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var args;
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("settings")
}));
__out.push('\n\n<div id="tabs">\n <ul>\n <li><a href="info_div" class="setting_change">');
__out.push(__sanitize(t('Information')));
__out.push('</a></li>\n <li><a href="pic_div" class="setting_change">');
__out.push(__sanitize(t('Picture')));
__out.push('</a></li>\n </ul>\n</div>\n<div class="clear"></div>\n\n<div id="main_content">\n <div>\n <div id="global_status">\n <span class="error_message"></span>\n <span class="success_message"></span>\n </div>\n <div id="info_div" style="display:none;">\n\n <div id="form_container">\n <div id="standard_form">\n\n <form id="edit_info_form">\n\n <h2>');
__out.push(__sanitize(t('Account Information')));
__out.push('</h2>\n\n <div class="form_label">\n <label for="first_name">');
__out.push(__sanitize(t('First Name')));
__out.push('</label>\n </div>\n\n <div class="form_input">\n <input id="first_name" name="first_name" type="text" value="');
__out.push(__sanitize(USER.first_name));
__out.push('"/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="last_name">');
__out.push(__sanitize(t('Last Name')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="last_name" name="last_name" type="text" value="');
__out.push(__sanitize(USER.last_name));
__out.push('"/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="email">');
__out.push(__sanitize(t('Email Address')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="email" name="email" type="text" value="');
__out.push(__sanitize(USER.email));
__out.push('"/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="password">');
__out.push(__sanitize(t('Password')));
__out.push('</label>\n </div>\n <div class="form_input">\n <a id="change_password" href="">');
__out.push(__sanitize(t('Change Your Password')));
__out.push('</a>\n <input style="display:none" id="password" name="password" type="password" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="country">');
__out.push(__sanitize(t('Country')));
__out.push('</label>\n </div>\n <div class="form_input">\n ');
args = {
selected: USER['country_id']
};
__out.push('\n ');
__out.push(app.helpers.countrySelector("country_id", args));
__out.push('\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n <div class="form_label">\n <label for="location">Zip/Postal Code</label>\n </div>\n <div class="form_input">\n <input id="location" name="location" class="half" type="text" value="');
__out.push(__sanitize(USER.location));
__out.push('"/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="language_id">');
__out.push(__sanitize(t('Language')));
__out.push('</label>\n </div>\n <div class="form_input">\n <select name="language_id" id="language_id">\n <option value="1" ');
__out.push(__sanitize(USER.language_id === 1 ? 'selected="selected"' : ""));
__out.push('>English</option>\n <option value="2" ');
__out.push(__sanitize(USER.language_id === 2 ? 'selected="selected"' : ""));
__out.push('>Francais</option>\n </select>\n <span class="erro_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <h2>');
__out.push(__sanitize(t('Mobile Phone Information')));
__out.push('</h2>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="country">');
__out.push(__sanitize(t('Country')));
__out.push('</label>\n </div>\n <div class="form_input">\n ');
args = {
countryCodePrefix: 'mobile_country_code'
};
__out.push('\n ');
args['selected'] = USER['mobile_country_code'];
__out.push('\n ');
__out.push(app.helpers.countrySelector("mobile_country_id", args));
__out.push('\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="mobile">');
__out.push(__sanitize(t('Mobile Number')));
__out.push('</label>\n </div>\n <div class="form_input">\n <div id="mobile_country_code" class="phone_country_code">');
__out.push(__sanitize(USER['mobile_country_code']));
__out.push('</div>\n <input id="mobile" name="mobile" class="phone" type="text" value="');
__out.push(__sanitize(USER.mobile));
__out.push('"/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div>\n <button id="submit_info" type="submit" class="button"><span>');
__out.push(__sanitize(t('Submit')));
__out.push('</span></button>\n </div>\n </form>\n </div>\n </div>\n </div>\n\n <div id="pic_div" style="display:none;">\n <form id="profile_pic_form" enctype="multipart/form-data" method="POST" target="">\n <input type="file" name="picture" id="picture">\n <button id="submit_pic" type="submit" class="button"><span>');
__out.push(__sanitize(t('Upload')));
__out.push('</span></button>\n </form>\n <p>');
__out.push(__sanitize(t('Your current Picture')));
__out.push('</p>\n <img id="settingsProfPic" src="');
__out.push(__sanitize("" + USER.picture_url + "?" + (new Date().getTime())));
__out.push('" />\n <div id="test"></div>\n </div>\n\n <div class="clear"></div>\n </div>\n</div>\n\n<div class="clear"></div>\n<div id="main_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/sign_up": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="form_container">\n <h1>');
__out.push(__sanitize(t('Sign Up')));
__out.push('</h1>\n <div id="standard_form">\n <form action="/" method="">\n\n <h2>');
__out.push(__sanitize(t('Personal Information')));
__out.push('</h2>\n\n <div class="form_label">\n <label for="first_name">');
__out.push(__sanitize(t('First Name')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="first_name" name="first_name" type="text" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="last_name">');
__out.push(__sanitize(t('Last Name')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="last_name" name="last_name" type="text" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="email">');
__out.push(__sanitize(t('Email Address')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="email" name="email" type="text" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="password">');
__out.push(__sanitize(t('Password')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="password" name="password" type="password" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="country">');
__out.push(__sanitize(t('Country')));
__out.push('</label>\n </div>\n <div class="form_input">\n ');
__out.push(app.helpers.countrySelector('location_country'));
__out.push('\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n <div class="form_label">\n <label for="location">');
__out.push(__sanitize(t('Zip/Postal Code')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="location" name="location" class="half" type="text" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_clear"></div>\n <div class="form_label">\n <label for="language">');
__out.push(__sanitize(t('Language')));
__out.push('</label>\n </div>\n <div class="form_input">\n <select id="language" name="language">\n <option value="en">English (US)</option>\n <option value="fr">Français</option>\n </select>\n </div>\n\n <div class="form_clear"></div>\n\n <h2>');
__out.push(__sanitize(t('Mobile Phone Information')));
__out.push('</h2>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="country">');
__out.push(__sanitize(t('Country')));
__out.push('</label>\n </div>\n <div class="form_input">\n ');
__out.push(app.helpers.countrySelector('mobile_country', {
countryCodePrefix: 'mobile_country_code'
}));
__out.push('\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="mobile">');
__out.push(__sanitize(t('Mobile Number')));
__out.push('</label>\n </div>\n <div class="form_input">\n <div id="mobile_country_code" class="phone_country_code">+1</div>\n <input id="mobile" name="mobile" class="phone" type="text" value=""/>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <h2>');
__out.push(__sanitize(t('Payment Information')));
__out.push('</h2>\n\n <div class="form_clear"></div>\n\n <span><span id="top_of_form" class="error_message"></span></span>\n\n\n <div class="form_label">\n <label for="card_number">');
__out.push(__sanitize(t('Credit Card Number')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="card_number" name="card_number" type="text" value=""/>\n <!--img id="card_icon" src="/web/img/cc_mastercard_24.png"-->\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="card_expiration_month">');
__out.push(__sanitize(t('Expiration Date')));
__out.push('</label>\n </div>\n <div class="form_input">\n <select id="card_expiration_month" name="card_expiration_month">\n <option value="01">01</option>\n <option value="02">02</option>\n <option value="03">03</option>\n <option value="04">04</option>\n <option value="05">05</option>\n <option value="06">06</option>\n <option value="07">07</option>\n <option value="08">08</option>\n <option value="09">09</option>\n <option value="10">10</option>\n <option value="11">11</option>\n <option value="12">12</option>\n </select>\n\n <select id="card_expiration_year" name="card_expiration_year">\n <option value="2011">2011</option>\n <option value="2012">2012</option>\n <option value="2013">2013</option>\n <option value="2014">2014</option>\n <option value="2015">2015</option>\n <option value="2016">2016</option>\n <option value="2017">2017</option>\n <option value="2018">2018</option>\n <option value="2019">2019</option>\n <option value="2020">2020</option>\n <option value="2021">2021</option>\n </select>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="card_number">');
__out.push(__sanitize(t('Security Code')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="card_code" name="card_code" type="text" value="" class="half" />\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <div class="form_label">\n <label for="use_case">');
__out.push(__sanitize(t('Type of Card')));
__out.push('</label>\n </div>\n <div class="form_input">\n <select id="use_case" name="use_case">\n <option value="personal">');
__out.push(__sanitize(t('Personal')));
__out.push('</option>\n <option value="business">');
__out.push(__sanitize(t('Business')));
__out.push('</option>\n </select>\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <h2>');
__out.push(__sanitize(t('Promotion Code')));
__out.push('</h2>\n\n <div class="form_label">\n <label for="promotion_code">');
__out.push(__sanitize(t('Code')));
__out.push('</label>\n </div>\n <div class="form_input">\n <input id="promotion_code" name="promotion_code" type="text" value="');
__out.push(__sanitize(this.invite));
__out.push('">\n <span class="error_message"></span>\n </div>\n\n <div class="form_clear"></div>\n\n <h2>');
__out.push(__sanitize(t('Legal Information')));
__out.push('</h2>\n\n <p>');
__out.push(t('Sign Up Agreement', {
terms_link: "<a href='https://www.uber.com/terms' target='_blank' style='line-height:11px;'>" + (t('Terms and Conditions')) + "</a>",
privacy_link: "<a href='https://www.uber.com/privacy' target='_blank' style='line-height:11px;'>" + (t('Privacy Policy')) + "</a>"
}));
__out.push('</p>\n\n <p>');
__out.push(t('Message and Data Rates Disclosure', {
help_string: "<strong>" + (t('HELP')) + "</strong>",
stop_string: "<strong>" + (t('STOP')) + "</strong>"
}));
__out.push('</p>\n\n <p style="display:none" id="terms_error" class="error_message">');
__out.push(__sanitize(t('Sign Up Agreement Error')));
__out.push('</p>\n\n <div id="signup_terms">\n <p>\n <input type="checkbox" name="signup_terms_agreement" />\n <label for="signup_terms_agreement"><strong>');
__out.push(t('I Agree'));
__out.push('</strong></label>\n </p>\n </div>\n\n <div class="formSubmitButton"><button type="submit" class="button" data-theme="a" id="sign_up_submit_button"><span>');
__out.push(__sanitize(t('Sign Up')));
__out.push('</span></button></div>\n\n </form>\n </div>\n</div>\n\n<div id="small_container_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/clients/trip_detail": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var distance, fareBreakdown, printFares, printStar, _ref, _ref2, _ref3, _ref4, _ref5, _ref6;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
printStar = function() {
return __out.push('\n <img alt="Star" src="/web/img/star.png"/>\n');
};
__out.push('\n');
fareBreakdown = this.trip.get('fare_breakdown');
__out.push('\n\n');
printFares = __bind(function(fare, index, list) {
var _ref;
__out.push('\n\n <li>\n <span class="fare">');
__out.push(__sanitize(app.helpers.formatCurrency(fare['amount'], false, (_ref = this.trip.get('fare_breakdown_local')) != null ? _ref.currency : void 0)));
__out.push('</span><br/>\n <span class="subtext">');
__out.push(__sanitize(fare['name']));
__out.push('</span>\n ');
if (fare['variable_rate'] !== 0) {
__out.push('\n <br><span class="subtext">');
__out.push(__sanitize("" + (app.helpers.formatCurrency(fare['variable_rate'], false, this.trip.get('fare_breakdown_local'))) + " x " + (app.helpers.roundNumber(fare['input_amount'], 3)) + " " + fare['input_type']));
__out.push('</span>\n ');
}
__out.push('\n </li>\n ');
if (index !== list.length - 1) {
__out.push('\n <li class="math">+</li>\n ');
}
return __out.push('\n');
}, this);
__out.push('\n\n');
__out.push(require('templates/clients/modules/sub_header').call(this, {
heading: t("Trip Details")
}));
__out.push('\n\n\n<div id="main_content">\n <div class="clear"></div>\n <div>\n <div id="trip_details_map"></div>\n <div id="trip_details_info">\n <h2>\n ');
__out.push(__sanitize(t('Your Trip')));
__out.push('\n </h2>\n\n <div id="avatars">\n <h3>');
__out.push(__sanitize(t('Driver')));
__out.push('</h3>\n <img alt="Driver image" height="45" src="');
__out.push(__sanitize((_ref = this.trip.get('driver')) != null ? _ref.picture_url : void 0));
__out.push('" width="45" />\n <span>');
__out.push(__sanitize((_ref2 = this.trip.get('driver')) != null ? _ref2.first_name : void 0));
__out.push('</span>\n\n <div class="clear"></div>\n </div>\n\n <h3>');
__out.push(__sanitize(t('Rating')));
__out.push('</h3>\n ');
_(this.trip.get('driver_rating')).times(printStar);
__out.push('\n <h3>');
__out.push(__sanitize(t('Trip Info')));
__out.push('</h3>\n <table>\n <tr class="first">\n <td class="label">');
__out.push(__sanitize(t('Pickup time:')));
__out.push('</td>\n <td>');
__out.push(__sanitize(app.helpers.formatDate(this.trip.get('begintrip_at'), true, this.trip.get('city').timezone)));
__out.push('</td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t("" + (app.helpers.capitaliseFirstLetter((_ref3 = this.trip.get('city')) != null ? (_ref4 = _ref3.country) != null ? _ref4.distance_unit : void 0 : void 0)) + "s:")));
__out.push('</td>\n ');
distance = this.trip.get('distance', 0);
__out.push('\n ');
if (((_ref5 = this.trip.get('city')) != null ? (_ref6 = _ref5.country) != null ? _ref6.distance_unit : void 0 : void 0) === "kilometer") {
__out.push('\n ');
distance = distance * 1.609344;
__out.push('\n ');
}
__out.push('\n <td>');
__out.push(__sanitize(app.helpers.roundNumber(distance, 2)));
__out.push('</td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Trip time:')));
__out.push('</td>\n <td>');
__out.push(__sanitize(app.helpers.formatSeconds(this.trip.get('duration'))));
__out.push('</td>\n </tr>\n <tr>\n <td class="label">');
__out.push(__sanitize(t('Fare:')));
__out.push('</td>\n <td>');
__out.push(__sanitize(app.helpers.formatTripFare(this.trip)));
__out.push('</td>\n </tr>\n </table>\n\n <p><button class="resendReceipt"><span>Resend Receipt</span></button> <span class="resendReceiptSuccess success"></span><span class="resendReceiptError error"></span></p>\n\n <p><a id="fare_review" href="">');
__out.push(__sanitize(t('Request a fare review')));
__out.push('</a></p>\n </div>\n <div class="clear"></div>\n\n <div id="fare_review_box">\n\n <span class="success_message" style="display:none;">');
__out.push(__sanitize(t("Fare Review Submitted")));
__out.push('</span>\n <div id="fare_review_form_wrapper">\n <p>');
__out.push(__sanitize(t("Fair Price Consideration")));
__out.push('</p>\n <div id="pricing_breakdown">\n <h3>');
__out.push(__sanitize(t('Your Fare Calculation')));
__out.push('</h3>\n\n <h4>');
__out.push(__sanitize(t('Charges')));
__out.push('</h4>\n <ul>\n ');
_.each(fareBreakdown['charges'], printFares);
__out.push('\n <div class="clear"></div>\n </ul>\n\n <h4>');
__out.push(__sanitize(t('Discounts')));
__out.push('</h4>\n <ul>\n ');
_.each(fareBreakdown['discounts'], printFares);
__out.push('\n <div class="clear"></div>\n </ul>\n\n <h4>');
__out.push(__sanitize(t('Total Charge')));
__out.push('</h4>\n <ul>\n <li class="math">=</li>\n <li class="valign"><span>$');
__out.push(__sanitize(this.trip.get('fare')));
__out.push('</span></li>\n <div class="clear"></div>\n </ul>\n </div>\n <ul>\n <li>');
__out.push(t('Uber Pricing Information Message', {
learn_link: "<a href='" + (app.config.get('url')) + "/learn'>" + (t('Uber pricing information')) + "</a>"
}));
__out.push('</li>\n <li>');
__out.push(__sanitize(t('GPS Point Capture Disclosure')));
__out.push('</li>\n </ul>\n\n <p>');
__out.push(__sanitize(t('Fare Review Note')));
__out.push('</p>\n <span class="error_message" style="display:none;">');
__out.push(__sanitize(t('Fare Review Error')));
__out.push('</span>\n <form id="form_review_form" action="" method="">\n <input type="hidden" id="tripid" name="tripid" value="');
__out.push(__sanitize(this.trip.get('id')));
__out.push('">\n <textarea id="form_review_message" name="message"></textarea>\n <div class="clear"></div>\n <button id="submit_fare_review" type="submit" class="button" data-theme="a"><span>');
__out.push(__sanitize(t('Submit')));
__out.push('</span></button>\n </form>\n <button class="button" id="fare_review_hide" data-theme="a"><span>');
__out.push(__sanitize(t('Cancel')));
__out.push('</span></button>\n </div>\n </div>\n <div class="clear"></div>\n </div>\n</div>\n<div id="main_shadow"></div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "templates/shared/menu": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
__out.push('<div id="menu_main">\n <div class="logo">\n <a href="/"><img src="/web/img/logo-charcoal.png"></a>\n </div>\n <div class="nav">\n <ul>\n ');
if (this.type === 'guest') {
__out.push('\n <li><a class="" href="/#!/sign-up" id="">');
__out.push(__sanitize(t("Sign Up")));
__out.push('</a></li>\n <li><a class="" href="https://www.uber.com/learn" id="">');
__out.push(__sanitize(t("Learn More")));
__out.push('</a></li>\n <li><a class="" href="http://blog.uber.com" id="">');
__out.push(__sanitize(t("Blog")));
__out.push('</a></li>\n <li><a class="" href="/#!/sign-in">');
__out.push(__sanitize(t("Sign In")));
__out.push(' »</a></li>\n ');
}
__out.push('\n ');
if (this.type === 'client') {
__out.push('\n ');
if ($.cookie('user') && JSON.parse($.cookie('user')).is_admin) {
__out.push('\n <li><a class="" href="/#!/request" id="">');
__out.push(__sanitize(t("Ride Request")));
__out.push('</a></li>\n ');
}
__out.push('\n <li><a class="" href="/#!/dashboard" id="">');
__out.push(__sanitize(t("Dashboard")));
__out.push('</a></li>\n <li><a class="" href="/#!/invite" id="">');
__out.push(__sanitize(t("Invite Friends")));
__out.push('</a></li>\n <li><a class="" href="/#!/promotions" id="">');
__out.push(__sanitize(t("Promotions")));
__out.push('</a></li>\n <li><a class="" href="/#!/billing" id="">');
__out.push(__sanitize(t("Billing")));
__out.push('</a></li>\n <li><a class="" href="/#!/settings/information" id="">');
__out.push(__sanitize(t("Settings")));
__out.push('</a></li>\n <li><a class="" href="/#!/sign-out">');
__out.push(__sanitize(t("Sign Out")));
__out.push(' »</a></li>\n ');
}
__out.push('\n </ul>\n </div>\n</div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "translations/en": function(exports, require, module) {(function() {
exports.translations = {
"Uber": "Uber",
"Sign Up": "Sign Up",
"Ride Request": "Ride Request",
"Invite Friends": "Invite Friends",
"Promotions": "Promotions",
"Billing": "Billing",
"Settings": "Settings",
"Forgot Password?": "Forgot Password?",
"Password Recovery": "Password Recovery",
"Login": "Login",
"Trip Detail": "Trip Detail",
"Password Reset": "Password Reset",
"Confirm Email": "Confirm Email",
"Request Ride": "Request Ride",
"Credit Card Number": "Credit Card Number",
"month": "month",
"01-Jan": "01-Jan",
"02-Feb": "02-Feb",
"03-Mar": "03-Mar",
"04-Apr": "04-Apr",
"05-May": "05-May",
"06-Jun": "06-Jun",
"07-Jul": "07-Jul",
"08-Aug": "08-Aug",
"09-Sep": "09-Sep",
"10-Oct": "10-Oct",
"11-Nov": "11-Nov",
"12-Dec": "12-Dec",
"year": "year",
"CVV": "CVV",
"Category": "Category",
"personal": "personal",
"business": "business",
"Default Credit Card": "Default Credit Card",
"Add Credit Card": "Add Credit Card",
"Expiry": "Expiry",
"default card": "default card",
"make default": "make default",
"Edit": "Edit",
"Delete": "Delete",
"Expiry Month": "Expiry Month",
"Expiry Year": "Expiry Year",
"Unable to Verify Card": "Unable to verify card at this time. Please try again later.",
"Credit Card Update Succeeded": "Your card has been successfully updated!",
"Credit Card Update Failed": "We couldn't save your changes. Please try again in a few minutes.",
"Credit Card Delete Succeeded": "Your card has been deleted!",
"Credit Card Delete Failed": "We were unable to delete your card. Please try again later.",
"Credit Card Update Category Succeeded": "Successfully changed card category!",
"Credit Card Update Category Failed": "We couldn't change your card category. Please try again in a few minutes.",
"Credit Card Update Default Succeeded": "Successfully changed default card!",
"Credit Card Update Default Failed": "We couldn't change your default card. Please try again in a few minutes.",
"Hello Greeting": "Hello, <%= name %>",
"Card Ending in": "Card Ending in",
"Trip Map": "Trip Map",
"Amount": "Amount: <%= amount %>",
"Last Attempt to Bill": "Last Attempt to Bill: <%= date %>",
"Charge": "Charge",
"Uber Credit Balance Note": "Your account has an UberCredit balance of <%= amount %>. When billing for trips, we'll deplete your UberCredit balance before applying charges to your credit card.",
"Please Add Credit Card": "Please add a credit card to bill your outstanding charges.",
"Credit Cards": "Credit Cards",
"add a new credit card": "add a new credit card",
"Account Balance": "Account Balance",
"Arrears": "Arrears",
"Billing Succeeded": "Your card was successfully billed.",
"Confirm Email Succeeded": "Successfully confirmed email token, redirecting to log in page...",
"Confirm Email Failed": "Unable to confirm email. Please contact [email protected] if this problem persists.",
"Email Already Confirmed": "Your email address has already been confirmed, redirecting to log in page...",
"Credit Card Added": "Credit Card Added",
"No Credit Card": "No Credit Card",
"Mobile Number Confirmed": "Mobile Number Confirmed",
"No Confirmed Mobile": "No Confirmed Mobile",
"E-mail Address Confirmed": "E-mail Address Confirmed",
"No Confirmed E-mail": "No Confirmed E-mail",
'Reply to sign up text': 'Reply "GO" to the text message you received at sign up.',
"Resend text message": "Resend text message",
"Click sign up link": "Click the link in the email you received at sign up.",
"Resend email": "Resend email",
"Add a credit card to ride": "Add a credit card and you'll be ready to ride Uber.",
"Your Most Recent Trip": "Your Most Recent Trip",
"details": "details",
"Your Trip History ": "Your Trip History ",
"Status": "Status",
"Here's how it works:": "Here's how it works:",
"Show all trips": "Show all trips",
"Set your location:": "Set your location:",
"App search for address": "iPhone/Android app: fix the pin or search for an address",
"SMS text address": "SMS: text your address to UBRCAB (827222)",
"Confirm pickup request": "Confirm your pickup request",
"Uber sends ETA": "Uber will send you an ETA (usually within 5-10 minutes)",
"Car arrives": "When your car is arriving, Uber will inform you again.",
"Ride to destination": "Hop in the car and tell the driver your destination.",
"Thank your driver": "That’s it! Please thank your driver but remember that your tip is included and no cash is necessary.",
"Trip started here": "Trip started here",
"Trip ended here": "Trip ended here",
"Sending Email": "Sending email...",
"Resend Email Succeeded": "We just sent the email. Please click on the confirmation link you recieve.",
"Resend Email Failed": "There was an error sending the email. Please contact support if the problem persists.",
"Resend Text Succeeded": 'We just sent the text message. Please reply "GO" to the message you recieve. It may take a few minutes for the message to reach you phone.',
"Resend Text Failed": "There was an error sending the text message. Please contact support if the problem persists.",
"Password Reset Error": "There was an error processing your password reset request.",
"New Password": "New Password",
"Forgot Password": "Forgot Password",
"Forgot Password Error": "Your email address could not be found. Please make sure to use the same email address you used when you signed up.",
"Forgot Password Success": "Please check your email for a link to reset your password.",
"Forgot Password Enter Email": 'Enter your email address and Uber will send you a link to reset your password. If you remember your password, you can <a href="/#!/sign-in">sign in here</a>.',
"Invite friends": "Invite friends",
"Give $ Get $": "Give $10, Get $10",
"Give $ Get $ Description": "Every friend you invite to Uber gets $10 of Uber credit. After someone you’ve invited takes his/her first ride, you get $10 of Uber credits too!",
"What are you waiting for?": "So, what are you waiting for? Invite away!",
"Tweet": "Tweet",
"Invite Link": "Email or IM this link to your friends:",
"Email Address": "Email Address",
"Reset Password": "Reset Password",
"Enter Promotion Code": "If you have a promotion code, enter it here:",
"Your Active Promotions": "Your Active Promotions",
"Code": "Code",
"Details": "Details",
"Trips Remaining": "Trips Remaining",
"Expires": "Expires",
"No Active Promotions": "There are no active promotions on your account.",
"Your Available Promotions": "Your Available Promotions",
"Where do you want us to pick you up?": "Where do you want us to pick you up?",
"Address to search": "Address to search",
"Search": "Search",
"Driver Name:": "Driver Name:",
"Driver #:": "Driver #:",
"Pickup Address:": "Pickup Address:",
"Add to Favorite Locations": "Add to Favorite Locations",
"Star": "Star",
"Nickname:": "Nickname:",
"Add": "Add",
"Your last trip": "Your last trip",
"Please rate your driver:": "Please rate your driver:",
"Comments: (optional)": "Comments: (optional)",
"Rate Trip": "Rate Trip",
"Pickup time:": "Pickup time:",
"Miles:": "Miles:",
"Trip time:": "Trip time:",
"Fare:": "Fare:",
"Favorite Locations": "Favorite Locations",
"Search Results": "Search Results",
"You have no favorite locations saved.": "You have no favorite locations saved.",
"Loading...": "Loading...",
"Request Pickup": "Request Pickup",
"Cancel Pickup": "Cancel Pickup",
"Requesting Closest Driver": "Requesting the closest driver to pick you up...",
"En Route": "You are currently en route...",
"Rate Last Trip": "Please rate your trip to make another request",
"Rate Before Submitting": "Please rate your trip before submitting the form",
"Address too short": "Address too short",
"or did you mean": "or did you mean",
"Search Address Failed": "Unable to find the given address. Please enter another address close to your location.",
"Sending pickup request...": "Sending pickup request...",
"Cancel Request Prompt": "Are you sure you want to cancel your request?",
"Cancel Request Arrived Prompt": 'Are you sure you want to cancel your request? Your driver has arrived so there is a $10 cancellation fee. It may help to call your driver now',
"Favorite Location Nickname Length Error": "Nickname has to be atleast 3 characters",
"Favorite Location Save Succeeded": "Location Saved!",
"Favorite Location Save Failed": "Unable to save your location. Please try again later.",
"Favorite Location Title": "Favorite Location <%= id %>",
"Search Location Title": "Search Location <%= id %>",
"ETA Message": "ETA: Around <%= minutes %> Minutes",
"Nearest Cab Message": "The closest driver is approximately <%= minutes %> minute(s) away",
"Arrival ETA Message": "Your Uber will arrive in about <%= minutes %> minute(s)",
"Arriving Now Message": "Your Uber is arriving now...",
"Rating Driver Failed": "Unable to contact server. Please try again later or email support if this issue persists.",
"Account Information": "Account Information",
"Mobile Phone Information": "Mobile Phone Information",
"settings": "settings",
"Information": "Information",
"Picture": "Picture",
"Change password": "Change password",
"Your current Picture": "Your current Picture",
"Your Favorite Locations": "Your Favorite Locations",
"You have no favorite locations saved.": "You have no favorite locations saved.",
"Purpose of Mobile": "We send text messages to your mobile phone to tell you when your driver is arriving. You can also request trips using text messages.",
"Country": "Country",
"Mobile Number": "Mobile Number",
"Submit": "Submit",
"Favorite Location": "Favorite Location",
"No Approximate Address": "Could not find an approximate address",
"Address:": "Address:",
"Information Update Succeeded": "Your information has been updated!",
"Information Update Failed": "We couldn't update your information. Please try again in few minutes or contact support if the problem persists.",
"Location Delete Succeeded": "Location deleted!",
"Location Delete Failed": "We were unable to delete your favorite location. Please try again later or contact support of the issue persists.",
"Location Edit Succeeded": "Changes Saved!",
"Location Edit Failed": "We couldn't save your changes. Please try again in a few minutes.",
"Picture Update Succeeded": "Your picture has been updated!",
"Picture Update Failed": "We couldn't change your picture. Please try again in a few minutes.",
"Personal Information": "Personal Information",
"Mobile Phone Number": "Mobile Phone Number",
"Payment Information": "Payment Information",
"Purpose of Credit Card": "We keep your credit card on file so that your trip go as fast as possible. You will not be charged until you take a trip.",
"Your card will not be charged until you take a trip.": "Your card will not be charged until you take a trip.",
"Credit Card Number": "Credit Card Number",
"Expiration Date": "Expiration Date",
"Promotion Code": "Promotion Code",
"Enter Promo Here": "If you have a code for a promotion, invitation or group deal, you can enter it here.",
"Promotion Code Input Label": "Promotion, Invite or Groupon Code (optional)",
"Terms and Conditions": "Terms and Conditions",
"HELP": "HELP",
"STOP": "STOP",
"Legal Information": "Legal Information",
"Sign Up Agreement": "By signing up, I agree to the Uber <%= terms_link %> and <%= privacy_link %> and understand that Uber is a request tool, not a transportation carrier.",
"Sign Up Agreement Error": "You must agree to the Uber Terms and Conditions and Privacy Policy to continue.",
"Message and Data Rates Disclosure": "Message and Data Rates May Apply. Reply <%= help_string %> to 827-222 for help. Reply <%= stop_string %> to 827-222 to stop texts. For additional assistance, visit support.uber.com or call (866) 576-1039. Supported Carriers: AT&T, Sprint, Verizon, and T-Mobile.",
"I Agree": "I agree to the Terms & Conditions and Privacy Policy",
"Security Code": "Security Code",
"Type of Card": "Type of Card",
"Personal": "Personal",
"Business": "Business",
"Code": "Code",
"Zip or Postal Code": "Zip or Postal Code",
"Your Trip": "Your Trip",
"Trip Info": "Trip Info",
"Request a fare review": "Request a fare review",
"Fare Review Submitted": "Your fare review has been submitted. We'll get back to you soon about your request. Sorry for any inconvenience this may have caused!",
"Fair Price Consideration": "We're committed to delivering Uber service at a fair price. Before requesting a fare review, please consider:",
"Your Fare Calculation": "Your Fare Calculation",
"Charges": "Charges",
"Discounts": "Discounts",
"Total Charge": "Total Charge",
"Uber pricing information": "Uber pricing information",
"Uber Pricing Information Message": "<%= learn_link %> is published on our website.",
"GPS Point Capture Disclosure": "Due to a finite number of GPS point captures, corners on your trip map may appear cut off or rounded. These minor inaccuracies result in a shorter measured distance, which always results in a cheaper trip.",
"Fare Review Note": "Please elaborate on why this trip requires a fare review. Your comments below will help us better establish the correct price for your trip:",
"Fare Review Error": "There was an error submitting the review. Please ensure that you have a message.",
"Sign In": "Sign In"
};
}).call(this);
}, "translations/fr": function(exports, require, module) {(function() {
exports.translations = {
"Uber": "Uber",
"Sign Up": "Inscription",
"Ride Request": "Passer une Commande",
"Invite Friends": "Inviter vos Amis",
"Promotions": "Promotions",
"Billing": "Paiement",
"Settings": "Paramètres",
"Forgot Password?": "Mot de passe oublié ?",
"Password Recovery": "Récupération du mot de passe",
"Login": "Connexion",
"Trip Detail": "Détail de la Course",
"Password Reset": "Réinitialisation du mot de passe",
"Confirm Email": "Confirmation de l’e-mail",
"Request Ride": "Passer une Commande",
"Credit Card Number": "Numéro de Carte de Crédit",
"month": "mois",
"01-Jan": "01-Jan",
"02-Feb": "02-Fév",
"03-Mar": "03-Mar",
"04-Apr": "04-Avr",
"05-May": "05-Mai",
"06-Jun": "06-Juin",
"07-Jul": "07-Jui",
"08-Aug": "08-Aoû",
"09-Sep": "09-Sep",
"10-Oct": "10-Oct",
"11-Nov": "11-Nov",
"12-Dec": "12-Déc",
"year": "année",
"CVV": "Code de Sécurité",
"Category": "Type",
"personal": "personnel",
"business": "entreprise",
"Default Credit Card": "Carte par Défaut",
"Add Credit Card": "Ajouter une Carte",
"Expiry": "Expire",
"default card": "carte par défaut",
"make default": "choisir par défaut",
"Edit": "Modifier",
"Delete": "Supprimer",
"Expiry Month": "Mois d’Expiration",
"Expiry Year": "Année d’Expiration",
"Unable to Verify Card": "Impossible de vérifier la carte pour le moment. Merci de réessayer un peu plus tard.",
"Credit Card Update Succeeded": "Votre carte a été mise à jour avec succès !",
"Credit Card Update Failed": "Nous ne pouvons enregistrer vos changements. Merci de réessayer dans quelques minutes.",
"Credit Card Delete Succeeded": "Votre carte a été supprimée !",
"Credit Card Delete Failed": "Nous n’avons pas été en mesure de supprimer votre carte. Merci de réessayer plus tard.",
"Credit Card Update Category Succeeded": "Changement de catégorie de carte réussi !",
"Credit Card Update Category Failed": "Nous ne pouvons pas changer la catégorie de votre carte. Merci de réessayer dans quelques minutes.",
"Credit Card Update Default Succeeded": "Carte par défaut changée avec succès !",
"Credit Card Update Default Failed": "Nous ne pouvons pas changer votre carte par défaut. Merci de réessayer dans quelques minutes.",
"Hello Greeting": "Bonjour, <%= name %>",
"Card Ending in": "La carte expire dans",
"Trip Map": "Carte des Courses",
"Amount": "Montant: <%= amount %>",
"Last Attempt to Bill": "Dernière tentative de prélèvement : <%= date %>",
"Charge": "Débit",
"Uber Credit Balance Note": "Votre compte a un solde de <%= amount %> UberCredits. Lorsque nous facturons des courses, nous réduirons votre solde d’UberCredits avant de prélever votre carte de crédit.",
"Please Add Credit Card": "Merci d’ajouter une carte de crédit pour que nous puissions vous facturer.",
"Credit Cards": "Cartes de crédit",
"add a new credit card": "Ajouter une nouvelle carte de crédit",
"Account Balance": "Solde du compte",
"Arrears": "Arriérés",
"Billing Succeeded": "Votre carte a été correctement débitée.",
"Confirm Email Succeeded": "L’adresse e-mail a bien été validée, vous êtes redirigé vers le tableau de bord...",
"Confirm Email Failed": "Impossible de confirmer l’adresse e-mail. Merci de contacter [email protected] si le problème persiste.",
"Credit Card Added": "Carte de crédit ajoutée",
"No Credit Card": "Pas de carte de crédit",
"Mobile Number Confirmed": "Numéro de téléphone confirmé",
"No Confirmed Mobile": "Pas de numéro de téléphone confirmé",
"E-mail Address Confirmed": "Adresse e-mail confirmée",
"No Confirmed E-mail": "Pas d’adresse e-mail confirmée",
'Reply to sign up text': 'Répondre "GO" au SMS que vous avez reçu à l’inscription.',
"Resend text message": "Renvoyer le SMS",
"Click sign up link": "Cliquez sur le lien contenu dans l’e-mail reçu à l’inscription.",
"Resend email": "Renvoyer l’e-mail",
"Add a credit card to ride": "Ajouter une carte de crédit et vous serez prêt à voyager avec Uber.",
"Your Most Recent Trip": "Votre course la plus récente",
"details": "détails",
"Your Trip History": "Historique de votre trajet",
"Status": "Statut",
"Here's how it works:": "Voici comment ça marche :",
"Show all trips": "Montrer toutes les courses",
"Set your location:": "Définir votre position :",
"App search for address": "Application iPhone/Android : positionner la punaise ou rechercher une adresse",
"SMS text address": "SMS : envoyez votre adresse à UBRCAB (827222)",
"Confirm pickup request": "Validez la commande",
"Uber sends ETA": "Uber envoie un temps d’attente estimé (habituellement entre 5 et 10 minutes)",
"Car arrives": "Lorsque votre voiture arrive, Uber vous en informera encore..",
"Ride to destination": "Montez dans la voiture et donnez votre destination au chauffeur.",
"Thank your driver": "C’est tout ! Remerciez le chauffeur mais souvenez-vous que les pourboires sont compris et qu’il n’est pas nécessaire d’avoir du liquide sur soi.",
"Trip started here": "La course a commencé ici.",
"Trip ended here": "La course s’est terminée ici.",
"Sending Email": "Envoi de l’e-mail...",
"Resend Email Succeeded": "Nous venons d’envoyer l’e-mail. Merci de cliquer sur le lien de confirmation que vous avez reçu.",
"Resend Email Failed": "Il y a eu un problème lors de l’envoi de l’email. Merci de contacter le support si le problème persiste.",
"Resend Text Succeeded": 'Nous venons d’envoyer le SMS. Merci de répondre "GO" au message que vous avez reçu. Il se peut que cela prenne quelques minutes pour que le message arrive sur votre téléphone.',
"Resend Text Failed": "Il y a eu un problème lors de l’envoi du SMS. Merci de contacter le support si le problème persiste.",
"Password Reset Error": "Il y a eu une error lors de la réinitialisation de votre mot de passe.",
"New Password:": "Nouveau mot de passe:",
"Forgot Password Error": "Votre nom d’utilisateur / adresse email ne peut être trouvé. Merci d’utiliser la même qu’à l’inscription.",
"Forgot Password Success": "Merci de consulter votre boîte mail pour suivre la demande de ‘réinitialisation de mot de passe.",
"Forgot Password Enter Email": "Merci de saisir votre adresse email et nous vous enverrons un lien vous permettant de réinitialiser votre mot de passe :",
"Invite friends": "Inviter vos amis",
"Give $ Get $": "Donnez $10, Recevez $10",
"Give $ Get $ Description": "Chaque ami que vous invitez à Uber recevra $10 de crédits Uber. Dès lors qu’une personne que vous aurez invité aura utilisé Uber pour la première, vous recevrez $10 de crédits Uber également !",
"What are you waiting for?": "N’attendez plus ! Lancez les invitations !",
"Tweet": "Tweeter",
"Invite Link": "Envoyez ce lien par email ou messagerie instantanée à vos amis :",
"Enter Promotion Code": "Si vous avez un code promo, saisissez-le ici:",
"Your Active Promotions": "Vos Codes Promos Actifs",
"Code": "Code",
"Details": "Détails",
"Trips Remaining": "Courses restantes",
"Expires": "Expire",
"No Active Promotions": "Vous n’avez pas de code promo actif.",
"Your Available Promotions": "Votres Promos Disponibles",
"Where do you want us to pick you up?": "Où souhaitez-vous que nous vous prenions en charge ?",
"Address to search": "Adresse à rechercher",
"Search": "Chercher",
"Driver Name:": "Nom du chauffeur:",
"Driver #:": "# Chauffeur:",
"Pickup Address:": "Lieu de prise en charge:",
"Add to Favorite Locations": "Ajoutez aux Lieux Favoris",
"Star": "Étoiles",
"Nickname:": "Pseudo",
"Add": "Ajouter",
"Your last trip": "Votre dernière course",
"Please rate your driver:": "Merci de noter votre chauffeur :",
"Comments: (optional)": "Commentaires: (optionnel)",
"Rate Trip": "Notez votre course",
"Pickup time:": "Heure de Prise en Charge :",
"Miles:": "Kilomètres :",
"Trip time:": "Temps de course :",
"Fare:": "Tarif :",
"Favorite Locations": "Lieux Favoris",
"Search Results": "Résultats",
"You have no favorite locations saved.": "Vous n’avez pas de lieux de prise en charge favoris.",
"Loading...": "Chargement...",
"Request Pickup": "Commander ici",
"Cancel Pickup": "Annuler",
"Requesting Closest Driver": "Nous demandons au chauffeur le plus proche de vous prendre en charge...",
"En Route": "Vous êtes actuellement en route...",
"Rate Last Trip": "Merci de noter votre précédent trajet pour faire une autre course.",
"Rate Before Submitting": "Merci de noter votre trajet avant de le valider.",
"Address too short": "L’adresse est trop courte",
"or did you mean": "ou vouliez-vous dire",
"Search Address Failed": "Impossible de trouver l’adresse spécifiée. Merci de saisir une autre adresse proche de l’endroit où vous vous trouvez.",
"Sending pickup request...": "Envoi de la demande de prise en charge...",
"Cancel Request Prompt": "Voulez-vous vraiment annuler votre demande ?",
"Cancel Request Arrived Prompt": 'Voulez-vous vraiment annuler votre demande ? Votre chauffeur est arrivé, vous serez donc facturé de $10 de frais d’annulation. Il pourrait être utile que vous appeliez votre chauffeur maintenant.',
"Favorite Location Nickname Length Error": "Le pseudo doit faire au moins 3 caractères de long",
"Favorite Location Save Succeeded": "Adresse enregistrée !",
"Favorite Location Save Failed": "Impossible d’enregistrer votre adresse. Merci de réessayer ultérieurement.",
"Favorite Location Title": "Adresse favorie <%= id %>",
"Search Location Title": "Recherche d’adresse <%= id %>",
"ETA Message": "Temps d’attente estimé: environ <%= minutes %> minutes",
"Nearest Cab Message": "Le chauffeur le plus proche sera là dans <%= minutes %> minute(s)",
"Arrival ETA Message": "Votre chauffeur arrivera dans <%= minutes %> minute(s)",
"Arriving Now Message": "Votre chauffeur est en approche...",
"Rating Driver Failed": "Impossible de contacter le serveur. Merci de réessayer ultérieurement ou de contacter le support si le problème persiste.",
"settings": "Paramètres",
"Information": "Information",
"Picture": "Photo",
"Change password": "Modifier votre mot de passe",
"Your current Picture": "Votre photo",
"Your Favorite Locations": "Vos lieux favoris",
"You have no favorite locations saved.": "Vous n’avez pas de lieu favori",
"Account Information": "Informations Personnelles",
"Mobile Phone Information": "Informations de Mobile",
"Change Your Password": "Changez votre mot de passe.",
"Country": "Pays",
"Language": "Langue",
"Favorite Location": "Lieu favori",
"No Approximate Address": "Impossible de trouver une adresse même approximative",
"Address:": "Adresse :",
"Information Update Succeeded": "Vos informations ont été mises à jour !",
"Information Update Failed": "Nous n’avons pas pu mettre à jour vos informations. Merci de réessayer dans quelques instants ou de contacter le support si le problème persiste.",
"Location Delete Succeeded": "Adresse supprimée !",
"Location Delete Failed": "Nous n’avons pas pu supprimée votre adresse favorie. Merci de réessayer plus tard ou de contacter le support si le problème persiste.",
"Location Edit Succeeded": "Modifications sauvegardées !",
"Location Edit Failed": "Nous n’avons pas pu sauvegarder vos modifications. Merci de réessayer dans quelques minutes.",
"Picture Update Succeeded": "Votre photo a été mise à jour !",
"Picture Update Failed": "Nous n’avons pas pu mettre à jour votre photo. Merci de réessayer dans quelques instants.",
"Personal Information": "Informations Personnelles",
"Mobile Phone Number": "Numéro de Téléphone Portable",
"Payment Information": "Informations de Facturation",
"Your card will not be charged until you take a trip.": "Votre carte ne sera pas débitée avant votre premier trajet.",
"Card Number": "Numéro de Carte",
"Promotion Code Input Label": "Code promo, code d’invitation ou “deal” acheté en ligne (optionnel)",
"Terms and Conditions": "Conditions Générales",
"HELP": "HELP",
"STOP": "STOP",
"Sign Up Agreement": "En souscrivant, j’accepte les <%= terms_link %> et <%= privacy_link %> et comprends qu’Uber est un outil de commande de chauffeur, et non un transporteur.",
"Sign Up Agreement Error": "Vous devez accepter les Conditions Générales d’utilisation d’Uber Terms and Conditions et la Politique de Confidentialité pour continuer.",
"Message and Data Rates Disclosure": "Les frais d’envoi de SMS et de consommation de données peuvent s’appliquer. Répondez <%= help_string %> au 827-222 pour obtenir de l’aide. Répondez <%= stop_string %> au 827-222 pour ne plus recevoir de SMS. Pour plus d’aide, visitez support.uber.com ou appelez le (866) 576-1039. Opérateurs supportés: AT&T, Sprint, Verizon, T-Mobile, Orange, SFR et Bouygues Telecom.",
"Zip/Postal Code": "Code Postal",
"Expiration Date": "Date D'expiration",
"Security Code": "Code de Sécurité",
"Type of Card": "Type",
"Personal": "Personnel",
"Business": "Entreprise",
"Promotion Code": "Code Promo",
"Legal Information": "Mentions Légales",
"I Agree": "J'accepte.",
"Your Trip": "Votre Course",
"Trip Info": "Informations de la Course",
"Request a fare review": "Demander un contrôle du tarif",
"Fare Review Submitted": "Votre demande de contrôle du tarif a été soumis. Nous reviendrons vers vous rapidement concernant cette demande. Nous nous excusons pour les dérangements éventuellement occasionnés !",
"Fair Price Consideration": "Nous nous engageons à proposer Uber à un tarif juste. Avant de demander un contrôle du tarif, merci de prendre en compte :",
"Your Fare Calculation": "Calcul du Prix",
"Charges": "Coûts",
"Discounts": "Réductions",
"Total Charge": "Coût total",
"Uber pricing information": "Information sur les prix d’Uber",
"Uber Pricing Information Message": "<%= learn_link %> est disponible sur notre site web.",
"GPS Point Capture Disclosure": "A cause d’un nombre limité de coordonnées GPS sauvegardées, les angles de votre trajet sur la carte peuvent apparaître coupés ou arrondis. Ces légères incohérences débouchent sur des distances mesurées plus courtes, ce qui implique toujours un prix du trajet moins élevé.",
"Fare Review Note": "Merci de nous expliquer pourquoi le tarif de cette course nécessite d’être contrôlé. Vos commentaires ci-dessous nous aideront à établir un prix plus juste si nécessaire :",
"Fare Review Error": "Il y a eu une erreur lors de l’envoi de la demande. Assurez-vous d’avoir bien ajouté une description à votre demande."
};
}).call(this);
}, "views/clients/billing": function(exports, require, module) {(function() {
var clientsBillingTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
clientsBillingTemplate = require('templates/clients/billing');
exports.ClientsBillingView = (function() {
__extends(ClientsBillingView, UberView);
function ClientsBillingView() {
ClientsBillingView.__super__.constructor.apply(this, arguments);
}
ClientsBillingView.prototype.id = 'billing_view';
ClientsBillingView.prototype.className = 'view_container';
ClientsBillingView.prototype.events = {
'click a#add_card': 'addCard',
'click .charge_arrear': 'chargeArrear'
};
ClientsBillingView.prototype.render = function() {
this.RefreshUserInfo(__bind(function() {
var cards, newForm;
this.HideSpinner();
$(this.el).html(clientsBillingTemplate());
if (USER.payment_gateway.payment_profiles.length === 0) {
newForm = new app.views.clients.modules.creditcard;
$(this.el).find("#add_card_wrapper").html(newForm.render(0).el);
} else {
cards = new app.views.clients.modules.creditcard;
$("#cards").html(cards.render("all").el);
}
return this.delegateEvents();
}, this));
return this;
};
ClientsBillingView.prototype.addCard = function(e) {
var newCard;
e.preventDefault();
newCard = new app.views.clients.modules.creditcard;
$('#cards').append(newCard.render("new").el);
return $("a#add_card").hide();
};
ClientsBillingView.prototype.chargeArrear = function(e) {
var $el, arrearId, attrs, cardId, options, tryCharge;
e.preventDefault();
$(".error_message").text("");
$el = $(e.currentTarget);
arrearId = $el.attr('id');
cardId = $el.parent().find('#card_to_charge').val();
this.ShowSpinner('submit');
tryCharge = new app.models.clientbills({
id: arrearId
});
attrs = {
payment_profile_id: cardId,
dataType: 'json'
};
options = {
success: __bind(function(data, textStatus, jqXHR) {
$el.parent().find(".success_message").text(t("Billing Succeeded"));
$el.hide();
return $el.parent().find('#card_to_charge').hide();
}, this),
error: __bind(function(jqXHR, status, errorThrown) {
return $el.parent().find(".error_message").text(JSON.parse(status.responseText).error);
}, this),
complete: __bind(function() {
return this.HideSpinner();
}, this)
};
return tryCharge.save(attrs, options);
};
return ClientsBillingView;
})();
}).call(this);
}, "views/clients/confirm_email": function(exports, require, module) {(function() {
var clientsConfirmEmailTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
clientsConfirmEmailTemplate = require('templates/clients/confirm_email');
exports.ClientsConfirmEmailView = (function() {
__extends(ClientsConfirmEmailView, UberView);
function ClientsConfirmEmailView() {
ClientsConfirmEmailView.__super__.constructor.apply(this, arguments);
}
ClientsConfirmEmailView.prototype.id = 'confirm_email_view';
ClientsConfirmEmailView.prototype.className = 'view_container';
ClientsConfirmEmailView.prototype.render = function(token) {
var attrs;
$(this.el).html(clientsConfirmEmailTemplate());
attrs = {
data: {
email_token: token
},
success: __bind(function(data, textStatus, jqXHR) {
var show_dashboard;
this.HideSpinner();
show_dashboard = function() {
return app.routers.clients.navigate('!/dashboard', true);
};
if (data.status === 'OK') {
$('.success_message').show();
return _.delay(show_dashboard, 3000);
} else if (data.status === 'ALREADY_COMFIRMED') {
$('.already_confirmed_message').show();
return _.delay(show_dashboard, 3000);
} else {
return $('.error_message').show();
}
}, this),
error: __bind(function(e) {
this.HideSpinner();
return $('.error_message').show();
}, this),
complete: function(status) {
return $('#attempt_text').hide();
},
dataType: 'json',
type: 'PUT',
url: "" + API + "/users/self"
};
$.ajax(attrs);
this.ShowSpinner('submit');
return this;
};
return ClientsConfirmEmailView;
})();
}).call(this);
}, "views/clients/dashboard": function(exports, require, module) {(function() {
var clientsDashboardTemplate;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsDashboardTemplate = require('templates/clients/dashboard');
exports.ClientsDashboardView = (function() {
var displayFirstTrip;
__extends(ClientsDashboardView, UberView);
function ClientsDashboardView() {
this.showAllTrips = __bind(this.showAllTrips, this);
this.render = __bind(this.render, this);
ClientsDashboardView.__super__.constructor.apply(this, arguments);
}
ClientsDashboardView.prototype.id = 'dashboard_view';
ClientsDashboardView.prototype.className = 'view_container';
ClientsDashboardView.prototype.events = {
'click a.confirmation': 'confirmationClick',
'click #resend_email': 'resendEmail',
'click #resend_mobile': 'resendMobile',
'click #show_all_trips': 'showAllTrips'
};
ClientsDashboardView.prototype.render = function() {
var displayPage, downloadTrips;
this.HideSpinner();
displayPage = __bind(function() {
$(this.el).html(clientsDashboardTemplate());
this.confirmationsSetup();
return this.RequireMaps(__bind(function() {
if (USER.trips.models[0]) {
if (!USER.trips.models[0].get("points")) {
return USER.trips.models[0].fetch({
data: {
relationships: 'points'
},
success: __bind(function() {
this.CacheData("USERtrips", USER.trips);
return displayFirstTrip();
}, this)
});
} else {
return displayFirstTrip();
}
}
}, this));
}, this);
downloadTrips = __bind(function() {
return this.DownloadUserTrips(displayPage, false, 10);
}, this);
this.RefreshUserInfo(downloadTrips);
return this;
};
displayFirstTrip = __bind(function() {
var bounds, endPos, map, myOptions, path, polyline, startPos;
myOptions = {
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoomControl: false,
rotateControl: false,
panControl: false,
mapTypeControl: false,
scrollwheel: false
};
if (USER.trips.length === 10) {
$("#show_all_trips").show();
}
if (USER.trips.length > 0) {
map = new google.maps.Map(document.getElementById("trip_details_map"), myOptions);
bounds = new google.maps.LatLngBounds();
path = [];
_.each(USER.trips.models[0].get('points'), __bind(function(point) {
path.push(new google.maps.LatLng(point.lat, point.lng));
return bounds.extend(_.last(path));
}, this));
map.fitBounds(bounds);
startPos = new google.maps.Marker({
position: _.first(path),
map: map,
title: t('Trip started here'),
icon: 'https://uber-static.s3.amazonaws.com/marker_start.png'
});
endPos = new google.maps.Marker({
position: _.last(path),
map: map,
title: t('Trip ended here'),
icon: 'https://uber-static.s3.amazonaws.com/marker_end.png'
});
polyline = new google.maps.Polyline({
path: path,
strokeColor: '#003F87',
strokeOpacity: 1,
strokeWeight: 5
});
return polyline.setMap(map);
}
}, ClientsDashboardView);
ClientsDashboardView.prototype.confirmationsSetup = function() {
var blink, cardForm, element, _ref, _ref2, _ref3, _ref4, _ref5;
blink = function(element) {
var opacity;
opacity = 0.5;
if (element.css('opacity') === "0.5") {
opacity = 1.0;
}
return element.fadeTo(2000, opacity, function() {
return blink(element);
});
};
if (((_ref = window.USER) != null ? (_ref2 = _ref.payment_gateway) != null ? (_ref3 = _ref2.payment_profiles) != null ? _ref3.length : void 0 : void 0 : void 0) === 0) {
element = $('#confirmed_credit_card');
cardForm = new app.views.clients.modules.creditcard;
$('#card.info').append(cardForm.render().el);
blink(element);
}
if (((_ref4 = window.USER) != null ? _ref4.confirm_email : void 0) === false) {
element = $('#confirmed_email');
blink(element);
}
if ((((_ref5 = window.USER) != null ? _ref5.confirm_mobile : void 0) != null) === false) {
element = $('#confirmed_mobile');
return blink(element);
}
};
ClientsDashboardView.prototype.confirmationClick = function(e) {
e.preventDefault();
$('.info').hide();
$('#more_info').show();
switch (e.currentTarget.id) {
case "card":
return $('#card.info').slideToggle();
case "mobile":
return $('#mobile.info').slideToggle();
case "email":
return $('#email.info').slideToggle();
}
};
ClientsDashboardView.prototype.resendEmail = function(e) {
var $el;
e.preventDefault();
$el = $(e.currentTarget);
$el.removeAttr('href').prop({
disabled: true
});
$el.html(t("Sending Email"));
return $.ajax({
type: 'GET',
url: API + '/users/request_confirm_email',
data: {
token: USER.token
},
dataType: 'json',
success: __bind(function(data, textStatus, jqXHR) {
return $el.html(t("Resend Email Succeeded"));
}, this),
error: __bind(function(jqXHR, textStatus, errorThrown) {
return $el.html(t("Resend Email Failed"));
}, this)
});
};
ClientsDashboardView.prototype.resendMobile = function(e) {
var $el;
e.preventDefault();
$el = $(e.currentTarget);
$el.removeAttr('href').prop({
disabled: true
});
$el.html("Sending message...");
return $.ajax({
type: 'GET',
url: API + '/users/request_confirm_mobile',
data: {
token: USER.token
},
dataType: 'json',
success: __bind(function(data, textStatus, jqXHR) {
return $el.html(t("Resend Text Succeeded"));
}, this),
error: __bind(function(jqXHR, textStatus, errorThrown) {
return $el.html(t("Resend Text Failed"));
}, this)
});
};
ClientsDashboardView.prototype.showAllTrips = function(e) {
e.preventDefault();
$(e.currentTarget).hide();
return this.DownloadUserTrips(this.render, true, 1000);
};
return ClientsDashboardView;
}).call(this);
}).call(this);
}, "views/clients/forgot_password": function(exports, require, module) {(function() {
var clientsForgotPasswordTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
clientsForgotPasswordTemplate = require('templates/clients/forgot_password');
exports.ClientsForgotPasswordView = (function() {
__extends(ClientsForgotPasswordView, UberView);
function ClientsForgotPasswordView() {
ClientsForgotPasswordView.__super__.constructor.apply(this, arguments);
}
ClientsForgotPasswordView.prototype.id = 'forgotpassword_view';
ClientsForgotPasswordView.prototype.className = 'view_container modal_view_container';
ClientsForgotPasswordView.prototype.events = {
"submit #password_reset": "passwordReset",
"click #password_reset_submit": "passwordReset",
"submit #forgot_password": "forgotPassword",
"click #forgot_password_submit": "forgotPassword"
};
ClientsForgotPasswordView.prototype.render = function(token) {
this.HideSpinner();
$(this.el).html(clientsForgotPasswordTemplate({
token: token
}));
this.delegateEvents();
return this;
};
ClientsForgotPasswordView.prototype.forgotPassword = function(e) {
var attrs;
e.preventDefault();
$('.success_message').hide();
$(".error_message").hide();
attrs = {
data: {
login: $("#login").val()
},
success: __bind(function(data, textStatus, jqXHR) {
this.HideSpinner();
$('.success_message').show();
return $("#forgot_password").hide();
}, this),
error: __bind(function(e) {
this.HideSpinner();
return $('.error_message').show();
}, this),
dataType: 'json',
type: 'PUT',
url: "" + API + "/users/forgot_password"
};
$.ajax(attrs);
return this.ShowSpinner('submit');
};
ClientsForgotPasswordView.prototype.passwordReset = function(e) {
var attrs;
e.preventDefault();
attrs = {
data: {
email_token: $("#token").val(),
password: $("#password").val()
},
success: __bind(function(data, textStatus, jqXHR) {
this.HideSpinner();
$.cookie('token', data.token);
amplify.store('USERjson', data);
app.refreshMenu();
return location.hash = '!/dashboard';
}, this),
error: __bind(function(e) {
this.HideSpinner();
return $('#error_reset').show();
}, this),
dataType: 'json',
type: 'PUT',
url: "" + API + "/users/self"
};
$.ajax(attrs);
return this.ShowSpinner('submit');
};
return ClientsForgotPasswordView;
})();
}).call(this);
}, "views/clients/invite": function(exports, require, module) {(function() {
var clientsInviteTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsInviteTemplate = require('templates/clients/invite');
exports.ClientsInviteView = (function() {
__extends(ClientsInviteView, UberView);
function ClientsInviteView() {
ClientsInviteView.__super__.constructor.apply(this, arguments);
}
ClientsInviteView.prototype.id = 'invite_view';
ClientsInviteView.prototype.className = 'view_container';
ClientsInviteView.prototype.render = function() {
this.ReadUserInfo();
this.HideSpinner();
$(this.el).html(clientsInviteTemplate());
console.log(screen);
return this;
};
return ClientsInviteView;
})();
}).call(this);
}, "views/clients/login": function(exports, require, module) {(function() {
var clientsLoginTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsLoginTemplate = require('templates/clients/login');
exports.ClientsLoginView = (function() {
__extends(ClientsLoginView, UberView);
function ClientsLoginView() {
ClientsLoginView.__super__.constructor.apply(this, arguments);
}
ClientsLoginView.prototype.id = 'login_view';
ClientsLoginView.prototype.className = 'view_container modal_view_container';
ClientsLoginView.prototype.events = {
'submit form': 'authenticate',
'click button': 'authenticate'
};
ClientsLoginView.prototype.initialize = function() {
_.bindAll(this, 'render');
return this.render();
};
ClientsLoginView.prototype.render = function() {
this.HideSpinner();
$(this.el).html(clientsLoginTemplate());
this.delegateEvents();
return this.place();
};
ClientsLoginView.prototype.authenticate = function(e) {
e.preventDefault();
return $.ajax({
type: 'POST',
url: API + '/auth/web_login/client',
data: {
login: $("#login").val(),
password: $("#password").val()
},
dataType: 'json',
success: function(data, textStatus, jqXHR) {
$.cookie('user', JSON.stringify(data));
$.cookie('token', data.token);
amplify.store('USERjson', data);
$('header').html(app.views.shared.menu.render().el);
return app.routers.clients.navigate('!/dashboard', true);
},
error: function(jqXHR, textStatus, errorThrown) {
$.cookie('user', null);
$.cookie('token', null);
if (jqXHR.status === 403) {
$.cookie('redirected_user', JSON.stringify(JSON.parse(jqXHR.responseText).error_obj), {
domain: '.uber.com'
});
window.location = 'http://partners.uber.com/';
}
return $('.error_message').html(JSON.parse(jqXHR.responseText).error).hide().fadeIn();
}
});
};
return ClientsLoginView;
})();
}).call(this);
}, "views/clients/modules/credit_card": function(exports, require, module) {(function() {
var creditCardTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
creditCardTemplate = require('templates/clients/modules/credit_card');
exports.CreditCardView = (function() {
__extends(CreditCardView, UberView);
function CreditCardView() {
CreditCardView.__super__.constructor.apply(this, arguments);
}
CreditCardView.prototype.id = 'creditcard_view';
CreditCardView.prototype.className = 'module_container';
CreditCardView.prototype.events = {
'submit #credit_card_form': 'processNewCard',
'click #new_card': 'processNewCard',
'change #card_number': 'showCardType',
'click .edit_card_show': 'showEditCard',
'click .edit_card': 'editCard',
'click .delete_card': 'deleteCard',
'click .make_default': 'makeDefault',
'change .use_case': 'saveUseCase'
};
CreditCardView.prototype.initialize = function() {
return app.collections.paymentprofiles.bind("refresh", __bind(function() {
return this.RefreshUserInfo(__bind(function() {
this.render("all");
return this.HideSpinner();
}, this));
}, this));
};
CreditCardView.prototype.render = function(cards) {
if (cards == null) {
cards = "new";
}
if (cards === "all") {
app.collections.paymentprofiles.reset(USER.payment_gateway.payment_profiles);
cards = app.collections.paymentprofiles;
}
$(this.el).html(creditCardTemplate({
cards: cards
}));
return this;
};
CreditCardView.prototype.processNewCard = function(e) {
var $el, attrs, model, options;
e.preventDefault();
this.ClearGlobalStatus();
$el = $("#credit_card_form");
$el.find('.error_message').html("");
attrs = {
card_number: $el.find('#card_number').val(),
card_code: $el.find('#card_code').val(),
card_expiration_month: $el.find('#card_expiration_month').val(),
card_expiration_year: $el.find('#card_expiration_year').val(),
use_case: $el.find('#use_case').val(),
"default": $el.find('#default_check').prop("checked")
};
options = {
statusCode: {
200: __bind(function(e) {
this.HideSpinner();
$('#cc_form_wrapper').hide();
app.collections.paymentprofiles.trigger("refresh");
$(this.el).remove();
$("a#add_card").show();
return $('section').html(app.views.clients.billing.render().el);
}, this),
406: __bind(function(e) {
var error, errors, _i, _len, _ref, _results;
this.HideSpinner();
errors = JSON.parse(e.responseText);
_ref = _.keys(errors);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
error = _ref[_i];
_results.push(error === "top_of_form" ? $("#top_of_form").html(errors[error]) : $("#credit_card_form").find("#" + error).parent().find(".error_message").html(errors[error]));
}
return _results;
}, this),
420: __bind(function(e) {
this.HideSpinner();
return $("#top_of_form").html(t("Unable to Verify Card"));
}, this)
}
};
this.ShowSpinner("submit");
model = new app.models.paymentprofile;
model.save(attrs, options);
return app.collections.paymentprofiles.add(model);
};
CreditCardView.prototype.showCardType = function(e) {
var $el, reAmerica, reDiscover, reMaster, reVisa, validCard;
reVisa = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/;
reMaster = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/;
reAmerica = /^6011-?\d{4}-?\d{4}-?\d{4}$/;
reDiscover = /^3[4,7]\d{13}$/;
$el = $("#card_logos");
validCard = false;
if (e.currentTarget.value.match(reVisa)) {
validCard = true;
} else if (e.currentTarget.value.match(reMaster)) {
$el.css('background-position', "-60px");
validCard = true;
} else if (e.currentTarget.value.match(reAmerica)) {
$el.css('background-position', "-120px");
validCard = true;
} else if (e.currentTarget.value.match(reDiscover)) {
$el.css('background-position', "-180px");
validCard = true;
}
if (validCard) {
$el.css('width', "60px");
return $el.css('margin-left', "180px");
} else {
$el.css('width', "250px");
return $el.css('margin-left', "80px");
}
};
CreditCardView.prototype.showEditCard = function(e) {
var $el, id;
e.preventDefault();
$el = $(e.currentTarget);
if ($el.html() === t("Edit")) {
id = $el.html(t("Cancel")).parents("tr").attr("id").substring(1);
return $("#e" + id).show();
} else {
id = $el.html(t("Edit")).parents("tr").attr("id").substring(1);
return $("#e" + id).hide();
}
};
CreditCardView.prototype.editCard = function(e) {
var $el, attrs, id, options;
e.preventDefault();
this.ClearGlobalStatus();
$el = $(e.currentTarget).parents("td");
id = $el.parents("tr").attr("id").substring(1);
$el.attr('disabled', 'disabled');
this.ShowSpinner('submit');
attrs = {
card_expiration_month: $el.find('#card_expiration_month').val(),
card_expiration_year: $el.find('#card_expiration_year').val(),
card_code: $el.find('#card_code').val()
};
options = {
success: __bind(function(response) {
this.HideSpinner();
this.ShowSuccess(t("Credit Card Update Succeeded"));
$("#e" + id).hide();
$("#d" + id).find(".edit_card_show").html(t("Edit"));
return app.collections.paymentprofiles.trigger("refresh");
}, this),
error: __bind(function(e) {
this.HideSpinner();
this.ShowError(t("Credit Card Update Failed"));
return $el.removeAttr('disabled');
}, this)
};
app.collections.paymentprofiles.models[id].set(attrs);
return app.collections.paymentprofiles.models[id].save({}, options);
};
CreditCardView.prototype.deleteCard = function(e) {
var $el, id, options;
e.preventDefault();
$el = $(e.currentTarget).parents("td");
id = $el.parents("tr").attr("id").substring(1);
this.ClearGlobalStatus();
this.ShowSpinner('submit');
options = {
success: __bind(function(response) {
this.ShowSuccess(t("Credit Card Delete Succeeded"));
$("form").hide();
app.collections.paymentprofiles.trigger("refresh");
return $('section').html(app.views.clients.billing.render().el);
}, this),
error: __bind(function(xhr, e) {
this.HideSpinner();
return this.ShowError(t("Credit Card Delete Failed"));
}, this)
};
return app.collections.paymentprofiles.models[id].destroy(options);
};
CreditCardView.prototype.saveUseCase = function(e) {
var $el, attrs, id, options, use_case;
this.ClearGlobalStatus();
$el = $(e.currentTarget);
use_case = $el.val();
id = $el.parents("tr").attr("id").substring(1);
attrs = {
use_case: use_case
};
options = {
success: __bind(function(response) {
return this.ShowSuccess(t("Credit Card Update Category Succeeded"));
}, this),
error: __bind(function(e) {
return this.ShowError(t("Credit Card Update Category Failed"));
}, this)
};
app.collections.paymentprofiles.models[id].set(attrs);
return app.collections.paymentprofiles.models[id].save({}, options);
};
CreditCardView.prototype.makeDefault = function(e) {
var $el, attrs, id, options;
e.preventDefault();
this.ClearGlobalStatus();
$el = $(e.currentTarget).parents("td");
id = $el.parents("tr").attr("id").substring(1);
attrs = {
"default": true
};
options = {
success: __bind(function(response) {
this.ShowSuccess(t("Credit Card Update Default Succeeded"));
return app.collections.paymentprofiles.trigger("refresh");
}, this),
error: __bind(function(e) {
return this.ShowError(t("Credit Card Update Default Failed"));
}, this)
};
app.collections.paymentprofiles.models[id].set(attrs);
return app.collections.paymentprofiles.models[id].save({}, options);
};
return CreditCardView;
})();
}).call(this);
}, "views/clients/promotions": function(exports, require, module) {(function() {
var clientsPromotionsTemplate;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsPromotionsTemplate = require('templates/clients/promotions');
exports.ClientsPromotionsView = (function() {
__extends(ClientsPromotionsView, UberView);
function ClientsPromotionsView() {
this.render = __bind(this.render, this);
ClientsPromotionsView.__super__.constructor.apply(this, arguments);
}
ClientsPromotionsView.prototype.id = 'promotions_view';
ClientsPromotionsView.prototype.className = 'view_container';
ClientsPromotionsView.prototype.events = {
'submit form': 'submitPromo',
'click button': 'submitPromo'
};
ClientsPromotionsView.prototype.initialize = function() {
if (this.model) {
return this.RefreshUserInfo(this.render);
}
};
ClientsPromotionsView.prototype.render = function() {
var renderTemplate;
this.ReadUserInfo();
renderTemplate = __bind(function() {
$(this.el).html(clientsPromotionsTemplate({
promos: window.USER.unexpired_client_promotions || []
}));
return this.HideSpinner();
}, this);
this.DownloadUserPromotions(renderTemplate);
return this;
};
ClientsPromotionsView.prototype.submitPromo = function(e) {
var attrs, model, options, refreshTable;
e.preventDefault();
this.ClearGlobalStatus();
refreshTable = __bind(function() {
$('section').html(this.render().el);
return this.HideSpinner();
}, this);
attrs = {
code: $('#code').val()
};
options = {
success: __bind(function(response) {
this.HideSpinner();
if (response.get('first_name')) {
return this.ShowSuccess("Your promotion has been applied in the form of an account credit. <a href='#!/billing'>Click here</a> to check your balance.");
} else {
this.ShowSuccess("Your promotion has successfully been applied");
return this.RefreshUserInfo(this.render, true);
}
}, this),
statusCode: {
400: __bind(function(e) {
this.ShowError(JSON.parse(e.responseText).error);
return this.HideSpinner();
}, this)
}
};
this.ShowSpinner("submit");
model = new app.models.promotions;
return model.save(attrs, options);
};
return ClientsPromotionsView;
})();
}).call(this);
}, "views/clients/request": function(exports, require, module) {(function() {
var clientsRequestTemplate;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsRequestTemplate = require('templates/clients/request');
exports.ClientsRequestView = (function() {
__extends(ClientsRequestView, UberView);
function ClientsRequestView() {
this.AjaxCall = __bind(this.AjaxCall, this);
this.AskDispatch = __bind(this.AskDispatch, this);
this.removeMarkers = __bind(this.removeMarkers, this);
this.displaySearchLoc = __bind(this.displaySearchLoc, this);
this.displayFavLoc = __bind(this.displayFavLoc, this);
this.showFavLoc = __bind(this.showFavLoc, this);
this.addToFavLoc = __bind(this.addToFavLoc, this);
this.removeCabs = __bind(this.removeCabs, this);
this.requestRide = __bind(this.requestRide, this);
this.rateTrip = __bind(this.rateTrip, this);
this.locationChange = __bind(this.locationChange, this);
this.panToLocation = __bind(this.panToLocation, this);
this.clickLocation = __bind(this.clickLocation, this);
this.searchLocation = __bind(this.searchLocation, this);
this.mouseoutLocation = __bind(this.mouseoutLocation, this);
this.mouseoverLocation = __bind(this.mouseoverLocation, this);
this.fetchTripDetails = __bind(this.fetchTripDetails, this);
this.submitRating = __bind(this.submitRating, this);
this.setStatus = __bind(this.setStatus, this);
this.initialize = __bind(this.initialize, this);
ClientsRequestView.__super__.constructor.apply(this, arguments);
}
ClientsRequestView.prototype.id = 'request_view';
ClientsRequestView.prototype.className = 'view_container';
ClientsRequestView.prototype.pollInterval = 2 * 1000;
ClientsRequestView.prototype.events = {
"submit #search_form": "searchAddress",
"click .locations_link": "locationLinkHandle",
"mouseover .location_row": "mouseoverLocation",
"mouseout .location_row": "mouseoutLocation",
"click .location_row": "clickLocation",
"click #search_location": "searchLocation",
"click #pickupHandle": "pickupHandle",
"click .stars": "rateTrip",
"submit #rating_form": "submitRating",
"click #addToFavButton": "showFavLoc",
"click #favLocNickname": "selectInputText",
"submit #favLoc_form": "addToFavLoc"
};
ClientsRequestView.prototype.status = "";
ClientsRequestView.prototype.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker.png";
ClientsRequestView.prototype.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker.png";
ClientsRequestView.prototype.initialize = function() {
var displayCabs;
displayCabs = __bind(function() {
return this.AskDispatch("NearestCab");
}, this);
this.showCabs = _.throttle(displayCabs, this.pollInterval);
return this.numSearchToDisplay = 1;
};
ClientsRequestView.prototype.setStatus = function(status) {
var autocomplete;
if (this.status === status) {
return;
}
try {
google.maps.event.trigger(this.map, 'resize');
} catch (_e) {}
switch (status) {
case "init":
this.AskDispatch("StatusClient");
this.status = "init";
return this.ShowSpinner("load");
case "ready":
this.HideSpinner();
$(".panel").hide();
$("#top_bar").fadeIn();
$("#location_panel").fadeIn();
$("#location_panel_control").fadeIn();
$("#pickupHandle").attr("class", "button_green").fadeIn().find("span").html(t("Request Pickup"));
this.pickup_icon.setDraggable(true);
this.map.panTo(this.pickup_icon.getPosition());
this.showCabs();
try {
this.pickup_icon.setMap(this.map);
this.displayFavLoc();
autocomplete = new google.maps.places.Autocomplete(document.getElementById('address'), {
types: ['geocode']
});
autocomplete.bindTo('bounds', this.map);
} catch (_e) {}
return this.status = "ready";
case "searching":
this.HideSpinner();
this.removeMarkers();
$(".panel").hide();
$("#top_bar").fadeOut();
$("#status_message").html(t("Requesting Closest Driver"));
$("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup"));
this.pickup_icon.setDraggable(false);
this.pickup_icon.setMap(this.map);
return this.status = "searching";
case "waiting":
this.HideSpinner();
this.removeMarkers();
$(".panel").hide();
$("#top_bar").fadeOut();
$("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup"));
$("#waiting_riding").fadeIn();
this.pickup_icon.setDraggable(false);
this.pickup_icon.setMap(this.map);
return this.status = "waiting";
case "arriving":
this.HideSpinner();
this.removeMarkers();
$(".panel").hide();
$("#top_bar").fadeOut();
$("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup"));
$("#waiting_riding").fadeIn();
this.pickup_icon.setDraggable(false);
this.pickup_icon.setMap(this.map);
return this.status = "arriving";
case "riding":
this.HideSpinner();
this.removeMarkers();
$(".panel").hide();
$("#top_bar").fadeOut();
$("#pickupHandle").fadeIn().attr("class", "button_red").find("span").html(t("Cancel Pickup"));
$("#waiting_riding").fadeIn();
this.pickup_icon.setDraggable(false);
this.status = "riding";
return $("#status_message").html(t("En Route"));
case "rate":
this.HideSpinner();
$(".panel").hide();
$("#pickupHandle").fadeOut();
$("#trip_completed_panel").fadeIn();
$('#status_message').html(t("Rate Last Trip"));
return this.status = "rate";
}
};
ClientsRequestView.prototype.render = function() {
this.ReadUserInfo();
this.HideSpinner();
this.ShowSpinner("load");
$(this.el).html(clientsRequestTemplate());
this.cabs = [];
this.RequireMaps(__bind(function() {
var center, myOptions, streetViewPano;
center = new google.maps.LatLng(37.7749295, -122.4194155);
this.markers = [];
this.pickup_icon = new google.maps.Marker({
position: center,
draggable: true,
clickable: true,
icon: this.pickupMarker
});
this.geocoder = new google.maps.Geocoder();
myOptions = {
zoom: 12,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP,
rotateControl: false,
rotateControl: false,
panControl: false
};
this.map = new google.maps.Map($(this.el).find("#map_wrapper_right")[0], myOptions);
if (this.status === "ready") {
this.pickup_icon.setMap(this.map);
}
if (geo_position_js.init()) {
geo_position_js.getCurrentPosition(__bind(function(data) {
var location;
location = new google.maps.LatLng(data.coords.latitude, data.coords.longitude);
this.pickup_icon.setPosition(location);
this.map.panTo(location);
return this.map.setZoom(16);
}, this));
}
this.setStatus("init");
streetViewPano = this.map.getStreetView();
google.maps.event.addListener(streetViewPano, 'visible_changed', __bind(function() {
if (streetViewPano.getVisible()) {
this.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker_large.png";
this.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker_large.png";
} else {
this.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker.png";
this.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker.png";
}
this.pickup_icon.setIcon(this.pickupMarker);
return _.each(this.cabs, __bind(function(cab) {
return cab.setIcon(this.cabMarker);
}, this));
}, this));
if (this.status === "ready") {
return this.displayFavLoc();
}
}, this));
return this;
};
ClientsRequestView.prototype.submitRating = function(e) {
var $el, message, rating;
e.preventDefault();
$el = $(e.currentTarget);
rating = 0;
_(5).times(function(num) {
if ($el.find(".stars#" + (num + 1)).attr("src") === "/web/img/star_active.png") {
return rating = num + 1;
}
});
if (rating === 0) {
$("#status_message").html("").html(t("Rate Before Submitting"));
} else {
this.ShowSpinner("submit");
this.AskDispatch("RatingDriver", {
rating: rating
});
}
message = $el.find("#comments").val().toString();
if (message.length > 5) {
return this.AskDispatch("Feedback", {
message: message
});
}
};
ClientsRequestView.prototype.fetchTripDetails = function(id) {
var trip;
trip = new app.models.trip({
id: id
});
return trip.fetch({
data: {
relationships: 'points,driver,city'
},
dataType: 'json',
success: __bind(function() {
var bounds, endPos, path, polyline, startPos;
bounds = new google.maps.LatLngBounds();
path = [];
_.each(trip.get('points'), __bind(function(point) {
path.push(new google.maps.LatLng(point.lat, point.lng));
return bounds.extend(_.last(path));
}, this));
startPos = new google.maps.Marker({
position: _.first(path),
map: this.map,
title: t("Trip started here"),
icon: 'https://uber-static.s3.amazonaws.com/carstart.png'
});
endPos = new google.maps.Marker({
position: _.last(path),
map: this.map,
title: t("Trip ended here"),
icon: 'https://uber-static.s3.amazonaws.com/carstop.png'
});
polyline = new google.maps.Polyline({
path: path,
strokeColor: '#003F87',
strokeOpacity: 1,
strokeWeight: 5
});
polyline.setMap(this.map);
this.map.fitBounds(bounds);
$("#tripTime").html(app.helpers.parseDateTime(trip.get('pickup_local_time'), trip.get('city.timezone')));
$("#tripDist").html(app.helpers.RoundNumber(trip.get('distance'), 2));
$("#tripDur").html(app.helpers.FormatSeconds(trip.get('duration')));
return $("#tripFare").html(app.helpers.FormatCurrency(trip.get('fare')));
}, this)
});
};
ClientsRequestView.prototype.searchAddress = function(e) {
var $locationsDiv, address, alphabet, bounds, showResults;
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
try {
e.preventDefault();
} catch (_e) {}
$('.error_message').html("");
$locationsDiv = $("<table></table>");
address = $('#address').val();
bounds = new google.maps.LatLngBounds();
if (address.length < 5) {
$('#status_message').html(t("Address too short")).fadeIn();
return false;
}
showResults = __bind(function(address, index) {
var first_cell, row, second_cell;
if (index < this.numSearchToDisplay) {
first_cell = "<td class='marker_logo'><img src='https://www.google.com/mapfiles/marker" + alphabet[index] + ".png' /></td>";
second_cell = "<td class='location_nickname_wrapper'>" + address.formatted_address + "</td>";
row = $("<tr></tr>").attr("id", "s" + index).attr("class", "location_row").html(first_cell + second_cell);
$locationsDiv.append(row);
}
if (index === this.numSearchToDisplay) {
$locationsDiv.append("<tr><td colspan=2>" + (t('or did you mean')) + " </td></tr>");
return $locationsDiv.append("<tr><td colspan=2><a id='search_location' href=''>" + address.formatted_address + "</a></td></tr>");
}
}, this);
return this.geocoder.geocode({
address: address
}, __bind(function(result, status) {
if (status !== "OK") {
$('.error_message').html(t("Search Address Failed")).fadeIn();
return;
}
_.each(result, showResults);
$("#search_results").html($locationsDiv);
this.locationChange("search");
this.searchResults = result;
return this.displaySearchLoc();
}, this));
};
ClientsRequestView.prototype.mouseoverLocation = function(e) {
var $el, id, marker;
$el = $(e.currentTarget);
id = $el.attr("id").substring(1);
marker = this.markers[id];
return marker.setAnimation(google.maps.Animation.BOUNCE);
};
ClientsRequestView.prototype.mouseoutLocation = function(e) {
var $el, id, marker;
$el = $(e.currentTarget);
id = $el.attr("id").substring(1);
marker = this.markers[id];
return marker.setAnimation(null);
};
ClientsRequestView.prototype.searchLocation = function(e) {
e.preventDefault();
$("#address").val($(e.currentTarget).html());
return this.searchAddress();
};
ClientsRequestView.prototype.favoriteClick = function(e) {
var index, location;
e.preventDefault();
$(".favorites").attr("href", "");
index = $(e.currentTarget).removeAttr("href").attr("id");
location = new google.maps.LatLng(USER.locations[index].latitude, USER.locations[index].longitude);
return this.panToLocation(location);
};
ClientsRequestView.prototype.clickLocation = function(e) {
var id;
id = $(e.currentTarget).attr("id").substring(1);
return this.panToLocation(this.markers[id].getPosition());
};
ClientsRequestView.prototype.panToLocation = function(location) {
this.map.panTo(location);
this.map.setZoom(16);
return this.pickup_icon.setPosition(location);
};
ClientsRequestView.prototype.locationLinkHandle = function(e) {
var panelName;
e.preventDefault();
panelName = $(e.currentTarget).attr("id");
return this.locationChange(panelName);
};
ClientsRequestView.prototype.locationChange = function(type) {
$(".locations_link").attr("href", "").css("font-weight", "normal");
switch (type) {
case "favorite":
$(".search_results").attr("href", "");
$(".locations_link#favorite").removeAttr("href").css("font-weight", "bold");
$("#search_results").hide();
$("#favorite_results").fadeIn();
return this.displayFavLoc();
case "search":
$(".favorites").attr("href", "");
$(".locations_link#search").removeAttr("href").css("font-weight", "bold");
$("#favorite_results").hide();
$("#search_results").fadeIn();
return this.displaySearchLoc();
}
};
ClientsRequestView.prototype.rateTrip = function(e) {
var rating;
rating = $(e.currentTarget).attr("id");
$(".stars").attr("src", "/web/img/star_inactive.png");
return _(rating).times(function(index) {
return $(".stars#" + (index + 1)).attr("src", "/web/img/star_active.png");
});
};
ClientsRequestView.prototype.pickupHandle = function(e) {
var $el, callback, message;
e.preventDefault();
$el = $(e.currentTarget).find("span");
switch ($el.html()) {
case t("Request Pickup"):
_.delay(this.requestRide, 3000);
$("#status_message").html(t("Sending pickup request..."));
$el.html(t("Cancel Pickup")).parent().attr("class", "button_red");
this.pickup_icon.setDraggable(false);
this.map.panTo(this.pickup_icon.getPosition());
return this.map.setZoom(18);
case t("Cancel Pickup"):
if (this.status === "ready") {
$el.html(t("Request Pickup")).parent().attr("class", "button_green");
return this.pickup_icon.setDraggable(true);
} else {
callback = __bind(function(v, m, f) {
if (v) {
this.AskDispatch("PickupCanceledClient");
return this.setStatus("ready");
}
}, this);
message = t("Cancel Request Prompt");
if (this.status === "arriving") {
message = 'Cancel Request Arrived Prompt';
}
return $.prompt(message, {
buttons: {
Ok: true,
Cancel: false
},
callback: callback
});
}
}
};
ClientsRequestView.prototype.requestRide = function() {
if ($("#pickupHandle").find("span").html() === t("Cancel Pickup")) {
this.AskDispatch("Pickup");
return this.setStatus("searching");
}
};
ClientsRequestView.prototype.removeCabs = function() {
_.each(this.cabs, __bind(function(point) {
return point.setMap(null);
}, this));
return this.cabs = [];
};
ClientsRequestView.prototype.addToFavLoc = function(e) {
var $el, lat, lng, nickname;
e.preventDefault();
$el = $(e.currentTarget);
$el.find(".error_message").html("");
nickname = $el.find("#favLocNickname").val().toString();
lat = $el.find("#pickupLat").val().toString();
lng = $el.find("#pickupLng").val().toString();
if (nickname.length < 3) {
$el.find(".error_message").html(t("Favorite Location Nickname Length Error"));
return;
}
this.ShowSpinner("submit");
return $.ajax({
type: 'POST',
url: API + "/locations",
dataType: 'json',
data: {
token: USER.token,
nickname: nickname,
latitude: lat,
longitude: lng
},
success: __bind(function(data, textStatus, jqXHR) {
return $el.html(t("Favorite Location Save Succeeded"));
}, this),
error: __bind(function(jqXHR, textStatus, errorThrown) {
return $el.find(".error_message").html(t("Favorite Location Save Failed"));
}, this),
complete: __bind(function(data) {
return this.HideSpinner();
}, this)
});
};
ClientsRequestView.prototype.showFavLoc = function(e) {
$(e.currentTarget).fadeOut();
return $("#favLoc_form").fadeIn();
};
ClientsRequestView.prototype.selectInputText = function(e) {
e.currentTarget.focus();
return e.currentTarget.select();
};
ClientsRequestView.prototype.displayFavLoc = function() {
var alphabet, bounds;
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
this.removeMarkers();
bounds = new google.maps.LatLngBounds();
_.each(USER.locations, __bind(function(location, index) {
var marker;
marker = new google.maps.Marker({
position: new google.maps.LatLng(location.latitude, location.longitude),
map: this.map,
title: t("Favorite Location Title", {
id: alphabet != null ? alphabet[index] : void 0
}),
icon: "https://www.google.com/mapfiles/marker" + alphabet[index] + ".png"
});
this.markers.push(marker);
bounds.extend(marker.getPosition());
return google.maps.event.addListener(marker, 'click', __bind(function() {
return this.pickup_icon.setPosition(marker.getPosition());
}, this));
}, this));
this.pickup_icon.setPosition(_.first(this.markers).getPosition());
return this.map.fitBounds(bounds);
};
ClientsRequestView.prototype.displaySearchLoc = function() {
var alphabet;
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
this.removeMarkers();
return _.each(this.searchResults, __bind(function(result, index) {
var marker;
if (index < this.numSearchToDisplay) {
marker = new google.maps.Marker({
position: result.geometry.location,
map: this.map,
title: t("Search Location Title", {
id: alphabet != null ? alphabet[index] : void 0
}),
icon: "https://www.google.com/mapfiles/marker" + alphabet[index] + ".png"
});
this.markers.push(marker);
return this.panToLocation(result.geometry.location);
}
}, this));
};
ClientsRequestView.prototype.removeMarkers = function() {
_.each(this.markers, __bind(function(marker) {
return marker.setMap(null);
}, this));
return this.markers = [];
};
ClientsRequestView.prototype.AskDispatch = function(ask, options) {
var attrs, lowestETA, processData, showCab;
if (ask == null) {
ask = "";
}
if (options == null) {
options = {};
}
switch (ask) {
case "NearestCab":
attrs = {
latitude: this.pickup_icon.getPosition().lat(),
longitude: this.pickup_icon.getPosition().lng()
};
lowestETA = 99999;
showCab = __bind(function(cab) {
var point;
point = new google.maps.Marker({
position: new google.maps.LatLng(cab.latitude, cab.longitude),
map: this.map,
icon: this.cabMarker,
title: t("ETA Message", {
minutes: app.helpers.FormatSeconds(cab != null ? cab.eta : void 0, true)
})
});
if (cab.eta < lowestETA) {
lowestETA = cab.eta;
}
return this.cabs.push(point);
}, this);
processData = __bind(function(data, textStatus, jqXHR) {
if (this.status === "ready") {
this.removeCabs();
if (data.sorry) {
$("#status_message").html(data.sorry).fadeIn();
} else {
_.each(data.driverLocations, showCab);
$("#status_message").html(t("Nearest Cab Message", {
minutes: app.helpers.FormatSeconds(lowestETA, true)
})).fadeIn();
}
if (Backbone.history.fragment === "!/request") {
return _.delay(this.showCabs, this.pollInterval);
}
}
}, this);
return this.AjaxCall(ask, processData, attrs);
case "StatusClient":
processData = __bind(function(data, textStatus, jqXHR) {
var bounds, cabLocation, locationSaved, point, userLocation;
if (data.messageType === "OK") {
switch (data.status) {
case "completed":
this.removeCabs();
this.setStatus("rate");
return this.fetchTripDetails(data.tripID);
case "open":
return this.setStatus("ready");
case "begintrip":
this.setStatus("riding");
cabLocation = new google.maps.LatLng(data.latitude, data.longitude);
this.removeCabs();
this.pickup_icon.setMap(null);
point = new google.maps.Marker({
position: cabLocation,
map: this.map,
icon: this.cabMarker
});
this.cabs.push(point);
this.map.panTo(point.getPosition());
$("#rideName").html(data.driverName);
$("#ridePhone").html(data.driverMobile);
$("#ride_address_wrapper").hide();
if (Backbone.history.fragment === "!/request") {
return _.delay(this.AskDispatch, this.pollInterval, "StatusClient");
}
break;
case "pending":
this.setStatus("searching");
if (Backbone.history.fragment === "!/request") {
return _.delay(this.AskDispatch, this.pollInterval, "StatusClient");
}
break;
case "accepted":
case "arrived":
if (data.status === "accepted") {
this.setStatus("waiting");
$("#status_message").html(t("Arrival ETA Message", {
minutes: app.helpers.FormatSeconds(data.eta, true)
}));
} else {
this.setStatus("arriving");
$("#status_message").html(t("Arriving Now Message"));
}
userLocation = new google.maps.LatLng(data.pickupLocation.latitude, data.pickupLocation.longitude);
cabLocation = new google.maps.LatLng(data.latitude, data.longitude);
this.pickup_icon.setPosition(userLocation);
this.removeCabs();
$("#rideName").html(data.driverName);
$("#ridePhone").html(data.driverMobile);
if ($("#rideAddress").html() === "") {
locationSaved = false;
_.each(USER.locations, __bind(function(location) {
if (parseFloat(location.latitude) === parseFloat(data.pickupLocation.latitude) && parseFloat(location.longitude) === parseFloat(data.pickupLocation.longitude)) {
return locationSaved = true;
}
}, this));
if (locationSaved) {
$("#addToFavButton").hide();
}
$("#pickupLat").val(data.pickupLocation.latitude);
$("#pickupLng").val(data.pickupLocation.longitude);
this.geocoder.geocode({
location: userLocation
}, __bind(function(result, status) {
$("#rideAddress").html(result[0].formatted_address);
return $("#favLocNickname").val("" + result[0].address_components[0].short_name + " " + result[0].address_components[1].short_name);
}, this));
}
point = new google.maps.Marker({
position: cabLocation,
map: this.map,
icon: this.cabMarker
});
this.cabs.push(point);
bounds = bounds = new google.maps.LatLngBounds();
bounds.extend(cabLocation);
bounds.extend(userLocation);
this.map.fitBounds(bounds);
if (Backbone.history.fragment === "!/request") {
return _.delay(this.AskDispatch, this.pollInterval, "StatusClient");
}
}
}
}, this);
return this.AjaxCall(ask, processData);
case "Pickup":
attrs = {
latitude: this.pickup_icon.getPosition().lat(),
longitude: this.pickup_icon.getPosition().lng()
};
processData = __bind(function(data, textStatus, jqXHR) {
if (data.messageType === "Error") {
return $("#status_message").html(data.description);
} else {
return this.AskDispatch("StatusClient");
}
}, this);
return this.AjaxCall(ask, processData, attrs);
case "PickupCanceledClient":
processData = __bind(function(data, textStatus, jqXHR) {
if (data.messageType === "OK") {
return this.setStatus("ready");
} else {
return $("#status_message").html(data.description);
}
}, this);
return this.AjaxCall(ask, processData, attrs);
case "RatingDriver":
attrs = {
rating: options.rating
};
processData = __bind(function(data, textStatus, jqXHR) {
if (data.messageType === "OK") {
this.setStatus("init");
} else {
$("status_message").html(t("Rating Driver Failed"));
}
return this.HideSpinner();
}, this);
return this.AjaxCall(ask, processData, attrs);
case "Feedback":
attrs = {
message: options.message
};
processData = __bind(function(data, textStatus, jqXHR) {
if (data.messageType === "OK") {
return alert("rated");
}
}, this);
return this.AjaxCall(ask, processData, attrs);
}
};
ClientsRequestView.prototype.AjaxCall = function(type, successCallback, attrs) {
if (attrs == null) {
attrs = {};
}
_.extend(attrs, {
token: USER.token,
messageType: type,
app: "client",
version: "1.0.60",
device: "web"
});
return $.ajax({
type: 'POST',
url: DISPATCH + "/",
processData: false,
data: JSON.stringify(attrs),
success: successCallback,
dataType: 'json',
error: __bind(function(jqXHR, textStatus, errorThrown) {
$("#status_message").html(errorThrown);
return this.HideSpinner();
}, this)
});
};
return ClientsRequestView;
})();
}).call(this);
}, "views/clients/settings": function(exports, require, module) {(function() {
var clientsSettingsTemplate;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsSettingsTemplate = require('templates/clients/settings');
exports.ClientsSettingsView = (function() {
__extends(ClientsSettingsView, UberView);
function ClientsSettingsView() {
this.render = __bind(this.render, this);
this.initialize = __bind(this.initialize, this);
ClientsSettingsView.__super__.constructor.apply(this, arguments);
}
ClientsSettingsView.prototype.id = 'settings_view';
ClientsSettingsView.prototype.className = 'view_container';
ClientsSettingsView.prototype.events = {
'submit #profile_pic_form': 'processPicUpload',
'click #submit_pic': 'processPicUpload',
'click a.setting_change': "changeTab",
'submit #edit_info_form': "submitInfo",
'click #change_password': 'changePass'
};
ClientsSettingsView.prototype.divs = {
'info_div': "Information",
'pic_div': "Picture"
};
ClientsSettingsView.prototype.pageTitle = t("Settings") + " | " + t("Uber");
ClientsSettingsView.prototype.tabTitle = {
'info_div': t("Information"),
'pic_div': t("Picture")
};
ClientsSettingsView.prototype.initialize = function() {
return this.mixin(require('web-lib/mixins/i18n_phone_form').i18nPhoneForm);
};
ClientsSettingsView.prototype.render = function(type) {
if (type == null) {
type = "info";
}
this.RefreshUserInfo(__bind(function() {
var $el, alphabet;
this.delegateEvents();
this.HideSpinner();
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$el = $(this.el);
$(this.el).html(clientsSettingsTemplate({
type: type
}));
$el.find("#" + type + "_div").show();
$el.find("a[href='" + type + "_div']").parent().addClass("active");
return document.title = "" + this.tabTitle[type + '_div'] + " " + this.pageTitle;
}, this));
this.delegateEvents();
return this;
};
ClientsSettingsView.prototype.changeTab = function(e) {
var $eTarget, $el, div, link, pageDiv, _i, _j, _len, _len2, _ref, _ref2;
e.preventDefault();
$eTarget = $(e.currentTarget);
this.ClearGlobalStatus();
$el = $(this.el);
_ref = $el.find(".setting_change");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
link = _ref[_i];
$(link).parent().removeClass("active");
}
$eTarget.parent().addClass("active");
_ref2 = _.keys(this.divs);
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
div = _ref2[_j];
$el.find("#" + div).hide();
}
pageDiv = $eTarget.attr('href');
$el.find("#" + pageDiv).show();
Backbone.history.navigate("!/settings/" + (this.divs[pageDiv].toLowerCase().replace(" ", "-")), false);
document.title = "" + this.tabTitle[pageDiv] + " " + this.pageTitle;
if (pageDiv === "loc_div") {
try {
google.maps.event.trigger(this.map, 'resize');
return this.map.fitBounds(this.bounds);
} catch (_e) {}
}
};
ClientsSettingsView.prototype.submitInfo = function(e) {
var $e, attrs, client, options;
$('#global_status').find('.success_message').text('');
$('#global_status').find('.error_message').text('');
$('.error_message').text('');
e.preventDefault();
$e = $(e.currentTarget);
attrs = $e.serializeToJson();
attrs['mobile_country_id'] = this.$('#mobile_country_id').val();
if (attrs['password'] === '') {
delete attrs['password'];
}
options = {
success: __bind(function(response) {
this.ShowSuccess(t("Information Update Succeeded"));
return this.RefreshUserInfo();
}, this),
error: __bind(function(model, data) {
var errors;
if (data.status === 406) {
errors = JSON.parse(data.responseText);
return _.each(_.keys(errors), function(field) {
return $("#" + field).parent().find('span.error_message').text(errors[field]);
});
} else {
return this.ShowError(t("Information Update Failed"));
}
}, this),
type: "PUT"
};
client = new app.models.client({
id: USER.id
});
return client.save(attrs, options);
};
ClientsSettingsView.prototype.changePass = function(e) {
e.preventDefault();
$(e.currentTarget).hide();
return $("#password").show();
};
ClientsSettingsView.prototype.processPicUpload = function(e) {
e.preventDefault();
this.ShowSpinner("submit");
return $.ajaxFileUpload({
url: API + '/user_pictures',
secureuri: false,
fileElementId: 'picture',
data: {
token: USER.token
},
dataType: 'json',
complete: __bind(function(data, status) {
this.HideSpinner();
if (status === 'success') {
this.ShowSuccess(t("Picture Update Succeeded"));
return this.RefreshUserInfo(__bind(function() {
return $("#settingsProfPic").attr("src", USER.picture_url + ("?" + (Math.floor(Math.random() * 1000))));
}, this));
} else {
if (data.error) {
return this.ShowError(data.error);
} else {
return this.ShowError("Picture Update Failed");
}
}
}, this)
});
};
return ClientsSettingsView;
})();
}).call(this);
}, "views/clients/sign_up": function(exports, require, module) {(function() {
var clientsSignUpTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
clientsSignUpTemplate = require('templates/clients/sign_up');
exports.ClientsSignUpView = (function() {
__extends(ClientsSignUpView, UberView);
function ClientsSignUpView() {
ClientsSignUpView.__super__.constructor.apply(this, arguments);
}
ClientsSignUpView.prototype.id = 'signup_view';
ClientsSignUpView.prototype.className = 'view_container';
ClientsSignUpView.prototype.initialize = function() {
this.mixin(require('web-lib/mixins/i18n_phone_form').i18nPhoneForm);
return $('#location_country').live('change', function() {
if (!$('#mobile').val()) {
return $('#mobile_country').find("option[value=" + ($(this).val()) + "]").attr('selected', 'selected').end().trigger('change');
}
});
};
ClientsSignUpView.prototype.events = {
'submit form': 'signup',
'click button': 'signup',
'change #card_number': 'showCardType',
'change #location_country': 'countryChange'
};
ClientsSignUpView.prototype.render = function(invite) {
this.HideSpinner();
$(this.el).html(clientsSignUpTemplate({
invite: invite
}));
return this;
};
ClientsSignUpView.prototype.signup = function(e) {
var $el, attrs, client, error_messages, options;
e.preventDefault();
$el = $("form");
$el.find('#terms_error').hide();
if (!$el.find('#signup_terms input[type=checkbox]').attr('checked')) {
$('#spinner.submit').hide();
$el.find('#terms_error').show();
return;
}
error_messages = $el.find('.error_message').html("");
attrs = {
first_name: $el.find('#first_name').val(),
last_name: $el.find('#last_name').val(),
email: $el.find('#email').val(),
password: $el.find('#password').val(),
location_country: $el.find('#location_country option:selected').attr('data-iso2'),
location: $el.find('#location').val(),
language: $el.find('#language').val(),
mobile_country: $el.find('#mobile_country option:selected').attr('data-iso2'),
mobile: $el.find('#mobile').val(),
card_number: $el.find('#card_number').val(),
card_expiration_month: $el.find('#card_expiration_month').val(),
card_expiration_year: $el.find('#card_expiration_year').val(),
card_code: $el.find('#card_code').val(),
use_case: $el.find('#use_case').val(),
promotion_code: $el.find('#promotion_code').val()
};
options = {
statusCode: {
200: function(response) {
$.cookie('token', response.token);
amplify.store('USERjson', response);
app.refreshMenu();
return app.routers.clients.navigate('!/dashboard', true);
},
406: function(e) {
var error, errors, _i, _len, _ref, _results;
errors = JSON.parse(e.responseText);
_ref = _.keys(errors);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
error = _ref[_i];
_results.push($('#' + error).parent().find('span').html($('#' + error).parent().find('span').html() + " " + errors[error]));
}
return _results;
}
},
complete: __bind(function(response) {
return this.HideSpinner();
}, this)
};
client = new app.models.client;
$('.spinner#submit').show();
return client.save(attrs, options);
};
ClientsSignUpView.prototype.countryChange = function(e) {
var $e;
$e = $(e.currentTarget);
return $("#mobile_country").val($e.val()).trigger('change');
};
ClientsSignUpView.prototype.showCardType = function(e) {
var $el, reAmerica, reDiscover, reMaster, reVisa, validCard;
reVisa = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/;
reMaster = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/;
reAmerica = /^6011-?\d{4}-?\d{4}-?\d{4}$/;
reDiscover = /^3[4,7]\d{13}$/;
$el = $("#card_logos_signup");
validCard = false;
if (e.currentTarget.value.match(reVisa)) {
$el.find("#overlay_left").css('width', "0px");
return $el.find("#overlay_right").css('width', "75%");
} else if (e.currentTarget.value.match(reMaster)) {
$el.find("#overlay_left").css('width', "25%");
return $el.find("#overlay_right").css('width', "50%");
} else if (e.currentTarget.value.match(reAmerica)) {
$el.find("#overlay_left").css('width', "75%");
$el.find("#overlay_right").css('width', "0px");
return console.log("amex");
} else if (e.currentTarget.value.match(reDiscover)) {
$el.find("#overlay_left").css('width', "50%");
return $el.find("#overlay_right").css('width', "25%");
} else {
$el.find("#overlay_left").css('width', "0px");
return $el.find("#overlay_right").css('width', "0px");
}
};
return ClientsSignUpView;
})();
}).call(this);
}, "views/clients/trip_detail": function(exports, require, module) {(function() {
var clientsTripDetailTemplate;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
clientsTripDetailTemplate = require('templates/clients/trip_detail');
exports.TripDetailView = (function() {
__extends(TripDetailView, UberView);
function TripDetailView() {
this.resendReceipt = __bind(this.resendReceipt, this);
TripDetailView.__super__.constructor.apply(this, arguments);
}
TripDetailView.prototype.id = 'trip_detail_view';
TripDetailView.prototype.className = 'view_container';
TripDetailView.prototype.events = {
'click a#fare_review': 'showFareReview',
'click #fare_review_hide': 'hideFareReview',
'submit #form_review_form': 'submitFareReview',
'click #submit_fare_review': 'submitFareReview',
'click .resendReceipt': 'resendReceipt'
};
TripDetailView.prototype.render = function(id) {
if (id == null) {
id = 'invalid';
}
this.ReadUserInfo();
this.HideSpinner();
this.model = new app.models.trip({
id: id
});
this.model.fetch({
data: {
relationships: 'points,driver,city.country'
},
dataType: 'json',
success: __bind(function() {
var trip;
trip = this.model;
$(this.el).html(clientsTripDetailTemplate({
trip: trip
}));
this.RequireMaps(__bind(function() {
var bounds, endPos, map, myOptions, path, polyline, startPos;
bounds = new google.maps.LatLngBounds();
path = [];
_.each(this.model.get('points'), __bind(function(point) {
path.push(new google.maps.LatLng(point.lat, point.lng));
return bounds.extend(_.last(path));
}, this));
myOptions = {
zoom: 12,
center: path[0],
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoomControl: false,
rotateControl: false,
panControl: false,
mapTypeControl: false,
scrollwheel: false
};
map = new google.maps.Map(document.getElementById("trip_details_map"), myOptions);
map.fitBounds(bounds);
startPos = new google.maps.Marker({
position: _.first(path),
map: map,
title: t("Trip started here"),
icon: 'https://uber-static.s3.amazonaws.com/marker_start.png'
});
endPos = new google.maps.Marker({
position: _.last(path),
map: map,
title: t("Trip ended here"),
icon: 'https://uber-static.s3.amazonaws.com/marker_end.png'
});
startPos.setMap(map);
endPos.setMap(map);
polyline = new google.maps.Polyline({
path: path,
strokeColor: '#003F87',
strokeOpacity: 1,
strokeWeight: 5
});
return polyline.setMap(map);
}, this));
return this.HideSpinner();
}, this)
});
this.ShowSpinner('load');
this.delegateEvents();
return this;
};
TripDetailView.prototype.showFareReview = function(e) {
e.preventDefault();
$('#fare_review_box').slideDown();
return $('#fare_review').hide();
};
TripDetailView.prototype.hideFareReview = function(e) {
e.preventDefault();
$('#fare_review_box').slideUp();
return $('#fare_review').show();
};
TripDetailView.prototype.submitFareReview = function(e) {
var attrs, errorMessage, id, options;
e.preventDefault();
errorMessage = $(".error_message");
errorMessage.hide();
id = $("#tripid").val();
this.model = new app.models.trip({
id: id
});
attrs = {
note: $('#form_review_message').val(),
note_type: 'client_fare_review'
};
options = {
success: __bind(function(response) {
$(".success_message").fadeIn();
return $("#fare_review_form_wrapper").slideUp();
}, this),
error: __bind(function(error) {
return errorMessage.fadeIn();
}, this)
};
return this.model.save(attrs, options);
};
TripDetailView.prototype.resendReceipt = function(e) {
var $e;
e.preventDefault();
$e = $(e.currentTarget);
this.$(".resendReceiptSuccess").empty().show();
this.$(".resentReceiptError").empty().show();
e.preventDefault();
$('#spinner').show();
return $.ajax('/api/trips/func/resend_receipt', {
data: {
token: $.cookie('token'),
trip_id: this.model.id
},
type: 'POST',
complete: __bind(function(xhr) {
var response;
response = JSON.parse(xhr.responseText);
$('#spinner').hide();
switch (xhr.status) {
case 200:
this.$(".resendReceiptSuccess").html("Receipt has been emailed");
return this.$(".resendReceiptSuccess").fadeOut(2000);
default:
this.$(".resendReceiptError").html("Receipt has failed to be emailed");
return this.$(".resendReceiptError").fadeOut(2000);
}
}, this)
});
};
return TripDetailView;
})();
}).call(this);
}, "views/shared/menu": function(exports, require, module) {(function() {
var menuTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
menuTemplate = require('templates/shared/menu');
exports.SharedMenuView = (function() {
__extends(SharedMenuView, Backbone.View);
function SharedMenuView() {
SharedMenuView.__super__.constructor.apply(this, arguments);
}
SharedMenuView.prototype.id = 'menu_view';
SharedMenuView.prototype.render = function() {
var type;
if ($.cookie('token') === null) {
type = 'guest';
} else {
type = 'client';
}
$(this.el).html(menuTemplate({
type: type
}));
return this;
};
return SharedMenuView;
})();
}).call(this);
}, "web-lib/collections/countries": function(exports, require, module) {(function() {
var UberCollection;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
UberCollection = require('web-lib/uber_collection').UberCollection;
exports.CountriesCollection = (function() {
__extends(CountriesCollection, UberCollection);
function CountriesCollection() {
CountriesCollection.__super__.constructor.apply(this, arguments);
}
CountriesCollection.prototype.model = app.models.country;
CountriesCollection.prototype.url = '/countries';
return CountriesCollection;
})();
}).call(this);
}, "web-lib/collections/vehicle_types": function(exports, require, module) {(function() {
var UberCollection, vehicleType, _ref;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
UberCollection = require('web-lib/uber_collection').UberCollection;
vehicleType = (typeof app !== "undefined" && app !== null ? (_ref = app.models) != null ? _ref.vehicleType : void 0 : void 0) || require('models/vehicle_type').VehicleType;
exports.VehicleTypesCollection = (function() {
__extends(VehicleTypesCollection, UberCollection);
function VehicleTypesCollection() {
VehicleTypesCollection.__super__.constructor.apply(this, arguments);
}
VehicleTypesCollection.prototype.model = vehicleType;
VehicleTypesCollection.prototype.url = '/vehicle_types';
VehicleTypesCollection.prototype.defaultColumns = ['id', 'created_at', 'updated_at', 'deleted_at', 'created_by_user_id', 'updated_by_user_id', 'city_id', 'type', 'make', 'model', 'capacity', 'minimum_year', 'actions'];
VehicleTypesCollection.prototype.tableColumns = function(cols) {
var actions, c, capacity, city_id, columnValues, created_at, created_by_user_id, deleted_at, headerRow, id, make, minimum_year, model, type, updated_at, updated_by_user_id, _i, _len;
id = {
sTitle: 'Id'
};
created_at = {
sTitle: 'Created At (UTC)',
'sType': 'string'
};
updated_at = {
sTitle: 'Updated At (UTC)',
'sType': 'string'
};
deleted_at = {
sTitle: 'Deleted At (UTC)',
'sType': 'string'
};
created_by_user_id = {
sTitle: 'Created By'
};
updated_by_user_id = {
sTitle: 'Updated By'
};
city_id = {
sTitle: 'City'
};
type = {
sTitle: 'Type'
};
make = {
sTitle: 'Make'
};
model = {
sTitle: 'Model'
};
capacity = {
sTitle: 'Capacity'
};
minimum_year = {
sTitle: 'Min. Year'
};
actions = {
sTitle: 'Actions'
};
columnValues = {
id: id,
created_at: created_at,
updated_at: updated_at,
deleted_at: deleted_at,
created_by_user_id: created_by_user_id,
updated_by_user_id: updated_by_user_id,
city_id: city_id,
type: type,
make: make,
model: model,
capacity: capacity,
minimum_year: minimum_year,
actions: actions
};
headerRow = [];
for (_i = 0, _len = cols.length; _i < _len; _i++) {
c = cols[_i];
if (columnValues[c]) {
headerRow.push(columnValues[c]);
}
}
return headerRow;
};
return VehicleTypesCollection;
})();
}).call(this);
}, "web-lib/helpers": function(exports, require, module) {(function() {
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
exports.helpers = {
pin: function(num, color) {
if (color == null) {
color = 'FF0000';
}
return "<img src=\"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" + num + "|" + color + "|000000\" width=\"14\" height=\"22\" />";
},
reverseGeocode: function(latitude, longitude) {
if (latitude && longitude) {
return "<span data-point=" + (JSON.stringify({
latitude: latitude,
longitude: longitude
})) + ">" + latitude + ", " + longitude + "</span>";
} else {
return '';
}
},
linkedName: function(model) {
var first_name, id, last_name, role, url;
role = model.role || model.get('role');
id = model.id || model.get('id');
first_name = model.first_name || model.get('first_name');
last_name = model.last_name || model.get('last_name');
url = "/" + role + "s/" + id;
return "<a href=\"#" + url + "\">" + first_name + " " + last_name + "</a>";
},
linkedVehicle: function(vehicle, vehicleType) {
return "<a href=\"/#/vehicles/" + vehicle.id + "\"> " + (vehicleType != null ? vehicleType.get('make') : void 0) + " " + (vehicleType != null ? vehicleType.get('model') : void 0) + " " + (vehicle.get('year')) + " </a>";
},
linkedUserId: function(userType, userId) {
return "<a href=\"#!/" + userType + "/" + userId + "\" data-user-type=\"" + userType + "\" data-user-id=\"" + userId + "\">" + userType + " " + userId + "</a>";
},
timeDelta: function(start, end) {
var delta;
if (typeof start === 'string') {
start = this.parseDate(start);
}
if (typeof end === 'string') {
end = this.parseDate(end);
}
if (end && start) {
delta = end.getTime() - start.getTime();
return this.formatSeconds(delta / 1000);
} else {
return '00:00';
}
},
formatSeconds: function(s) {
var minutes, seconds;
s = Math.floor(s);
minutes = Math.floor(s / 60);
seconds = s - minutes * 60;
return "" + (this.leadingZero(minutes)) + ":" + (this.leadingZero(seconds));
},
formatCurrency: function(strValue, reverseSign, currency) {
var currency_locale, lc, mf;
if (reverseSign == null) {
reverseSign = false;
}
if (currency == null) {
currency = null;
}
strValue = String(strValue);
if (reverseSign) {
strValue = ~strValue.indexOf('-') ? strValue.split('-').join('') : ['-', strValue].join('');
}
currency_locale = i18n.currencyToLocale[currency];
try {
if (!(currency_locale != null) || currency_locale === i18n.locale) {
return i18n.jsworld.mf.format(strValue);
} else {
lc = new jsworld.Locale(POSIX_LC[currency_locale]);
mf = new jsworld.MonetaryFormatter(lc);
return mf.format(strValue);
}
} catch (error) {
i18n.log(error);
return strValue;
}
},
formatTripFare: function(trip, type) {
var _ref, _ref2;
if (type == null) {
type = "fare";
}
if (!trip.get('fare')) {
return 'n/a';
}
if (((_ref = trip.get('fare_breakdown_local')) != null ? _ref.currency : void 0) != null) {
return app.helpers.formatCurrency(trip.get("" + type + "_local"), false, (_ref2 = trip.get('fare_breakdown_local')) != null ? _ref2.currency : void 0);
} else if (trip.get("" + type + "_string") != null) {
return trip.get("" + type + "_string");
} else if (trip.get("" + type + "_local") != null) {
return trip.get("" + type + "_local");
} else {
return 'n/a';
}
},
formatPhoneNumber: function(phoneNumber, countryCode) {
if (countryCode == null) {
countryCode = "+1";
}
if (phoneNumber != null) {
phoneNumber = String(phoneNumber);
switch (countryCode) {
case '+1':
return countryCode + ' ' + phoneNumber.substring(0, 3) + '-' + phoneNumber.substring(3, 6) + '-' + phoneNumber.substring(6, 10);
case '+33':
return countryCode + ' ' + phoneNumber.substring(0, 1) + ' ' + phoneNumber.substring(1, 3) + ' ' + phoneNumber.substring(3, 5) + ' ' + phoneNumber.substring(5, 7) + ' ' + phoneNumber.substring(7, 9);
default:
countryCode + phoneNumber;
}
}
return "" + countryCode + " " + phoneNumber;
},
parseDate: function(d, cityTime, tz) {
var city_filter, parsed, _ref;
if (cityTime == null) {
cityTime = true;
}
if (tz == null) {
tz = null;
}
if (((_ref = !d.substr(-6, 1)) === '+' || _ref === '-') || d.length === 19) {
d += '+00:00';
}
if (/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.test(d)) {
parsed = d.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/);
d = new Date();
d.setUTCFullYear(parsed[1]);
d.setUTCMonth(parsed[2] - 1);
d.setUTCDate(parsed[3]);
d.setUTCHours(parsed[4]);
d.setUTCMinutes(parsed[5]);
d.setUTCSeconds(parsed[6]);
} else {
d = Date.parse(d);
}
if (typeof d === 'number') {
d = new Date(d);
}
d = new timezoneJS.Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 'Etc/UTC');
if (tz) {
d.convertToTimezone(tz);
} else if (cityTime) {
city_filter = $.cookie('city_filter');
if (city_filter) {
tz = $("#city_filter option[value=" + city_filter + "]").attr('data-timezone');
if (tz) {
d.convertToTimezone(tz);
}
}
}
return d;
},
dateToTimezone: function(d) {
var city_filter, tz;
d = new timezoneJS.Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 'Etc/UTC');
city_filter = $.cookie('city_filter');
if (city_filter) {
tz = $("#city_filter option[value=" + city_filter + "]").attr('data-timezone');
d.convertToTimezone(tz);
}
return d;
},
fixAMPM: function(d, formatted) {
if (d.hours >= 12) {
return formatted.replace(/\b[AP]M\b/, 'PM');
} else {
return formatted.replace(/\b[AP]M\b/, 'AM');
}
},
formatDate: function(d, time, timezone) {
var formatted;
if (time == null) {
time = true;
}
if (timezone == null) {
timezone = null;
}
d = this.parseDate(d, true, timezone);
formatted = time ? ("" + (i18n.jsworld.dtf.formatDate(d)) + " ") + this.formatTime(d, d.getTimezoneInfo()) : i18n.jsworld.dtf.formatDate(d);
return this.fixAMPM(d, formatted);
},
formatDateLong: function(d, time, timezone) {
if (time == null) {
time = true;
}
if (timezone == null) {
timezone = null;
}
d = this.parseDate(d, true, timezone);
timezone = d.getTimezoneInfo().tzAbbr;
if (time) {
return (i18n.jsworld.dtf.formatDateTime(d)) + (" " + timezone);
} else {
return i18n.jsworld.dtf.formatDate(d);
}
},
formatTimezoneJSDate: function(d) {
var day, hours, jsDate, minutes, month, year;
year = d.getFullYear();
month = this.leadingZero(d.getMonth());
day = this.leadingZero(d.getDate());
hours = this.leadingZero(d.getHours());
minutes = this.leadingZero(d.getMinutes());
jsDate = new Date(year, month, day, hours, minutes, 0);
return jsDate.toDateString();
},
formatTime: function(d, timezone) {
var formatted;
if (timezone == null) {
timezone = null;
}
formatted = ("" + (i18n.jsworld.dtf.formatTime(d))) + (timezone != null ? " " + (timezone != null ? timezone.tzAbbr : void 0) : "");
return this.fixAMPM(d, formatted);
},
formatISODate: function(d) {
var pad;
pad = function(n) {
if (n < 10) {
return '0' + n;
}
return n;
};
return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + 'Z';
},
formatExpDate: function(d) {
var month, year;
d = this.parseDate(d);
year = d.getFullYear();
month = this.leadingZero(d.getMonth() + 1);
return "" + year + "-" + month;
},
formatLatLng: function(lat, lng, precision) {
if (precision == null) {
precision = 8;
}
return parseFloat(lat).toFixed(precision) + ',' + parseFloat(lng).toFixed(precision);
},
leadingZero: function(num) {
if (num < 10) {
return "0" + num;
} else {
return num;
}
},
roundNumber: function(num, dec) {
return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
},
notesToHTML: function(notes) {
var i, note, notesHTML, _i, _len;
notesHTML = '';
i = 1;
if (notes) {
for (_i = 0, _len = notes.length; _i < _len; _i++) {
note = notes[_i];
notesHTML += "<strong>" + note['userid'] + "</strong> " + (this.formatDate(note['created_at'])) + "<p>" + note['note'] + "</p>";
notesHTML += "<br>";
}
}
return notesHTML.replace("'", '"e');
},
formatPhone: function(n) {
var parts, phone, regexObj;
n = "" + n;
regexObj = /^(?:\+?1[-. ]?)?(?:\(?([0-9]{3})\)?[-. ]?)?([0-9]{3})[-. ]?([0-9]{4})$/;
if (regexObj.test(n)) {
parts = n.match(regexObj);
phone = "";
if (parts[1]) {
phone += "(" + parts[1] + ") ";
}
phone += "" + parts[2] + "-" + parts[3];
} else {
phone = n;
}
return phone;
},
usStates: ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'],
onboardingPages: ['applied', 'ready_to_interview', 'pending_interview', 'interviewed', 'accepted', 'ready_to_onboard', 'pending_onboarding', 'active', 'waitlisted', 'rejected'],
driverBreadCrumb: function(loc, model) {
var onboardingPage, out, _i, _len, _ref;
out = "<a href='#/driver_ops/summary'>Drivers</a> > ";
if (!(model != null)) {
out += "<select name='onboardingPage' id='onboardingPageSelector'>";
_ref = this.onboardingPages;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
onboardingPage = _ref[_i];
out += "<option value='" + onboardingPage + "' " + (onboardingPage === loc ? "selected" : void 0) + ">" + (this.onboardingUrlToName(onboardingPage)) + "</option>";
}
out += "</select>";
} else {
out += "<a href='#/driver_ops/" + (model.get('driver_status')) + "'>" + (this.onboardingUrlToName(model.get('driver_status'))) + "</a>";
out += " > " + (this.linkedName(model)) + " (" + (model.get('role')) + ") #" + (model.get('id'));
}
return out;
},
onboardingUrlToName: function(url) {
return url != null ? url.replace(/_/g, " ").replace(/(^|\s)([a-z])/g, function(m, p1, p2) {
return p1 + p2.toUpperCase();
}) : void 0;
},
formatVehicle: function(vehicle) {
if (vehicle.get('make') && vehicle.get('model') && vehicle.get('license_plate')) {
return "" + (vehicle.get('make')) + " " + (vehicle.get('model')) + " (" + (vehicle.get('license_plate')) + ")";
}
},
docArbitraryFields: function(docName, cityDocs) {
var doc, field, out, _i, _j, _len, _len2, _ref;
out = "";
for (_i = 0, _len = cityDocs.length; _i < _len; _i++) {
doc = cityDocs[_i];
if (doc.name === docName && __indexOf.call(_.keys(doc), "metaFields") >= 0) {
_ref = doc.metaFields;
for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
field = _ref[_j];
out += "" + field.label + ": <input type='text' name='" + field.name + "' class='arbitraryField'><br>";
}
}
}
return out;
},
capitaliseFirstLetter: function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
},
createDocUploadForm: function(docName, driverId, vehicleId, cityMeta, vehicleName, expirationRequired) {
var ddocs, expDropdowns, pdocs, vdocs;
if (driverId == null) {
driverId = "None";
}
if (vehicleId == null) {
vehicleId = "None";
}
if (cityMeta == null) {
cityMeta = [];
}
if (vehicleName == null) {
vehicleName = false;
}
if (expirationRequired == null) {
expirationRequired = false;
}
ddocs = cityMeta["driverRequiredDocs"] || [];
pdocs = cityMeta["partnerRequiredDocs"] || [];
vdocs = cityMeta["vehicleRequiredDocs"] || [];
expDropdowns = "Expiration Date:\n<select name=\"expiration-year\">\n <option value=\"2011\">2011</option>\n <option value=\"2012\">2012</option>\n <option value=\"2013\">2013</option>\n <option value=\"2014\">2014</option>\n <option value=\"2015\">2015</option>\n <option value=\"2016\">2016</option>\n <option value=\"2017\">2017</option>\n <option value=\"2018\">2018</option>\n</select> -\n<select name=\"expiration-month\">\n <option value=\"01\">01</option>\n <option value=\"02\">02</option>\n <option value=\"03\">03</option>\n <option value=\"04\">04</option>\n <option value=\"05\">05</option>\n <option value=\"06\">06</option>\n <option value=\"07\">07</option>\n <option value=\"08\">08</option>\n <option value=\"09\">09</option>\n <option value=\"10\">10</option>\n <option value=\"11\">11</option>\n <option value=\"12\">12</option>\n</select>";
return " <form class=\"documentuploadform\">\n <div>\n <input type=\"hidden\" name=\"fileName\" value=\"" + docName + "\">\n <input type=\"hidden\" name=\"driver_id\" value=\"" + driverId + "\">\n <input type=\"hidden\" name=\"vehicle_id\" value=\"" + vehicleId + "\">\n\n <div>\n <strong>" + (vehicleName ? vehicleName : "") + " " + docName + "</strong>\n </div>\n\n <div>\n <input type=\"file\" name=\"uploadContent\" id=\"" + (vehicleId !== "None" ? "vehicle_" + vehicleId + "_" : "") + "doc_upload_" + (docName.replace(/[\W]/g, "_")) + "\">\n </div>\n\n <div class=\"expiration\">\n " + (expirationRequired ? expDropdowns : "") + "\n </div>\n\n <div>\n " + (app.helpers.docArbitraryFields(docName, _.union(ddocs, pdocs, vdocs))) + "\n </div>\n\n <div>\n <input type=\"submit\" value=\"Upload\">\n </div>\n\n </div>\n</form>";
},
countrySelector: function(name, options) {
var countries, countryCodePrefix, defaultOptions;
if (options == null) {
options = {};
}
defaultOptions = {
selectedKey: 'telephone_code',
selectedValue: '+1',
silent: false
};
_.extend(defaultOptions, options);
options = defaultOptions;
countries = new app.collections.countries();
countries.fetch({
data: {
limit: 300
},
success: function(countries) {
var $option, $select, country, selected, _i, _len, _ref;
selected = false;
_ref = countries.models || [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
country = _ref[_i];
$select = $("select[name=" + name + "]");
$option = $('<option></option>').val(country.id).attr('data-iso2', country.get('iso2')).attr('data-prefix', country.get('telephone_code')).html(country.get('name'));
if (country.get(options.selectedKey) === options.selectedValue && !selected) {
selected = true;
$option.attr('selected', 'selected');
}
$select.append($option);
}
if (selected && !options.silent) {
return $select.val(options.selected).trigger('change');
}
}
});
countryCodePrefix = options.countryCodePrefix ? "data-country-code-prefix='" + options.countryCodePrefix + "'" : '';
return "<select name='" + name + "' id='" + name + "' " + countryCodePrefix + " " + (options.disabled ? 'disabled="disabled"' : "") + "></select>";
},
missingDocsOnDriver: function(driver) {
var city, docsReq, documents, partnerDocs;
city = driver.get('city');
documents = driver.get('documents');
if ((city != null) && (documents != null)) {
docsReq = _.pluck(city != null ? city.get('meta')["driverRequiredDocs"] : void 0, "name");
if (driver.get('role') === "partner") {
partnerDocs = _.pluck(city != null ? city.get('meta')["partnerRequiredDocs"] : void 0, "name");
docsReq = _.union(docsReq, partnerDocs);
}
return _.reject(docsReq, __bind(function(doc) {
return __indexOf.call((documents != null ? documents.pluck("name") : void 0) || [], doc) >= 0;
}, this));
} else {
return [];
}
}
};
}).call(this);
}, "web-lib/i18n": function(exports, require, module) {(function() {
exports.i18n = {
defaultLocale: 'en_US',
cookieName: '_LOCALE_',
locales: {
'en_US': "English (US)",
'fr_FR': "Français"
},
currencyToLocale: {
'USD': 'en_US',
'EUR': 'fr_FR'
},
logglyKey: 'd2d5a9bc-7ebe-4538-a180-81e62c705b1b',
logglyHost: 'https://logs.loggly.com',
init: function() {
this.castor = new window.loggly({
url: this.logglyHost + '/inputs/' + this.logglyKey + '?rt=1',
level: 'error'
});
this.setLocale($.cookie(this.cookieName) || this.defaultLocale);
window.t = _.bind(this.t, this);
this.loadLocaleTranslations(this.locale);
if (!(this[this.defaultLocale] != null)) {
return this.loadLocaleTranslations(this.defaultLocale);
}
},
loadLocaleTranslations: function(locale) {
var loadPaths, path, _i, _len, _results;
loadPaths = ['web-lib/translations/' + locale, 'web-lib/translations/' + locale.slice(0, 2), 'translations/' + locale, 'translations/' + locale.slice(0, 2)];
_results = [];
for (_i = 0, _len = loadPaths.length; _i < _len; _i++) {
path = loadPaths[_i];
locale = path.substring(path.lastIndexOf('/') + 1);
if (this[locale] == null) {
this[locale] = {};
}
_results.push((function() {
try {
return _.extend(this[locale], require(path).translations);
} catch (error) {
}
}).call(this));
}
return _results;
},
getLocale: function() {
return this.locale;
},
setLocale: function(locale) {
var message, parts, _ref;
parts = locale.split('_');
this.locale = parts[0].toLowerCase();
if (parts.length > 1) {
this.locale += "_" + (parts[1].toUpperCase());
}
if (this.locale) {
$.cookie(this.cookieName, this.locale, {
path: '/',
domain: '.uber.com'
});
}
try {
((_ref = this.jsworld) != null ? _ref : this.jsworld = {}).lc = new jsworld.Locale(POSIX_LC[this.locale]);
this.jsworld.mf = new jsworld.MonetaryFormatter(this.jsworld.lc);
this.jsworld.nf = new jsworld.NumericFormatter(this.jsworld.lc);
this.jsworld.dtf = new jsworld.DateTimeFormatter(this.jsworld.lc);
this.jsworld.np = new jsworld.NumericParser(this.jsworld.lc);
this.jsworld.mp = new jsworld.MonetaryParser(this.jsworld.lc);
return this.jsworld.dtp = new jsworld.DateTimeParser(this.jsworld.lc);
} catch (error) {
message = 'JsWorld error with locale: ' + this.locale;
return this.log({
message: message,
error: error
});
}
},
getTemplate: function(id) {
var _ref, _ref2;
return ((_ref = this[this.locale]) != null ? _ref[id] : void 0) || ((_ref2 = this[this.locale.slice(0, 2)]) != null ? _ref2[id] : void 0);
},
getTemplateDefault: function(id) {
var _ref, _ref2;
return ((_ref = this[this.defaultLocale]) != null ? _ref[id] : void 0) || ((_ref2 = this[this.defaultLocale.slice(0, 2)]) != null ? _ref2[id] : void 0);
},
getTemplateOrDefault: function(id) {
return this.getTemplate(id) || this.getTemplateDefault(id);
},
t: function(id, vars) {
var errStr, locale, template;
if (vars == null) {
vars = {};
}
locale = this.getLocale();
template = this.getTemplate(id);
if (template == null) {
if (/dev|test/.test(window.location.host)) {
template = "(?) " + id;
} else {
template = this.getTemplateDefault(id);
}
errStr = "Missing [" + locale + "] translation for [" + id + "] at [" + window.location.hash + "] - Default template is [" + template + "]";
this.log({
error: errStr,
locale: locale,
id: id,
defaultTemplate: template
});
}
if (template) {
return _.template(template, vars);
} else {
return id;
}
},
log: function(error) {
if (/dev/.test(window.location.host)) {
if ((typeof console !== "undefined" && console !== null ? console.log : void 0) != null) {
return console.log(error);
}
} else {
_.extend(error, {
host: window.location.host,
hash: window.location.hash
});
return this.castor.error(JSON.stringify(error));
}
}
};
}).call(this);
}, "web-lib/mixins/i18n_phone_form": function(exports, require, module) {(function() {
exports.i18nPhoneForm = {
_events: {
'change select[data-country-code-prefix]': 'setCountryCodePrefix'
},
setCountryCodePrefix: function(e) {
var $el, prefix;
$el = $(e.currentTarget);
prefix = $el.find('option:selected').attr('data-prefix');
return $("#" + ($el.attr('data-country-code-prefix'))).text(prefix);
}
};
}).call(this);
}, "web-lib/models/country": function(exports, require, module) {(function() {
var UberModel;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
UberModel = require('web-lib/uber_model').UberModel;
exports.Country = (function() {
__extends(Country, UberModel);
function Country() {
Country.__super__.constructor.apply(this, arguments);
}
Country.prototype.url = function() {
if (this.id) {
return "/countries/" + this.id;
} else {
return '/countries';
}
};
return Country;
})();
}).call(this);
}, "web-lib/models/vehicle_type": function(exports, require, module) {(function() {
var UberModel;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
UberModel = require('web-lib/uber_model').UberModel;
exports.VehicleType = (function() {
__extends(VehicleType, UberModel);
function VehicleType() {
this.toString = __bind(this.toString, this);
VehicleType.__super__.constructor.apply(this, arguments);
}
VehicleType.prototype.endpoint = 'vehicle_types';
VehicleType.prototype.toTableRow = function(cols) {
var actions, c, capacity, city_id, columnValues, created_at, created_by_user_id, deleted_at, id, make, minimum_year, model, rows, type, updated_at, updated_by_user_id, _i, _len, _ref;
id = "<a href='#/vehicle_types/" + (this.get('id')) + "'>" + (this.get('id')) + "</a>";
if (this.get('created_at')) {
created_at = app.helpers.formatDate(this.get('created_at'));
}
if (this.get('updated_at')) {
updated_at = app.helpers.formatDate(this.get('updated_at'));
}
if (this.get('deleted_at')) {
deleted_at = app.helpers.formatDate(this.get('deleted_at'));
}
created_by_user_id = "<a href='#/clients/" + (this.get('created_by_user_id')) + "'>" + (this.get('created_by_user_id')) + "</a>";
updated_by_user_id = "<a href='#/clients/" + (this.get('updated_by_user_id')) + "'>" + (this.get('updated_by_user_id')) + "</a>";
city_id = (_ref = this.get('city')) != null ? _ref.get('display_name') : void 0;
type = this.get('type');
make = this.get('make');
model = this.get('model');
capacity = this.get('capacity');
minimum_year = this.get('minimum_year');
actions = "<a href='#/vehicle_types/" + (this.get('id')) + "'>Show</a>";
if (!this.get('deleted_at')) {
actions += " <a href='#/vehicle_types/" + (this.get('id')) + "/edit'>Edit</a>";
actions += " <a id='" + (this.get('id')) + "' class='delete' href='#'>Delete</a>";
}
columnValues = {
id: id,
created_at: created_at,
updated_at: updated_at,
deleted_at: deleted_at,
created_by_user_id: created_by_user_id,
updated_by_user_id: updated_by_user_id,
city_id: city_id,
type: type,
make: make,
model: model,
capacity: capacity,
minimum_year: minimum_year,
actions: actions
};
rows = [];
for (_i = 0, _len = cols.length; _i < _len; _i++) {
c = cols[_i];
rows.push(columnValues[c] ? columnValues[c] : '-');
}
return rows;
};
VehicleType.prototype.toString = function() {
return this.get('make') + ' ' + this.get('model') + ' ' + this.get('type') + (" (" + (this.get('capacity')) + ")");
};
return VehicleType;
})();
}).call(this);
}, "web-lib/templates/footer": function(exports, require, module) {module.exports = function(__obj) {
if (!__obj) __obj = {};
var __out = [], __capture = function(callback) {
var out = __out, result;
__out = [];
callback.call(this);
result = __out.join('');
__out = out;
return __safe(result);
}, __sanitize = function(value) {
if (value && value.ecoSafe) {
return value;
} else if (typeof value !== 'undefined' && value != null) {
return __escape(value);
} else {
return '';
}
}, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
__safe = __obj.safe = function(value) {
if (value && value.ecoSafe) {
return value;
} else {
if (!(typeof value !== 'undefined' && value != null)) value = '';
var result = new String(value);
result.ecoSafe = true;
return result;
}
};
if (!__escape) {
__escape = __obj.escape = function(value) {
return ('' + value)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
};
}
(function() {
(function() {
var locale, title, _ref;
__out.push('<div class="footer_col_2">\n <ul>\n <li class="head">');
__out.push(__sanitize(t("Info")));
__out.push('</li>\n <li><a href="https://www.uber.com/learn">');
__out.push(__sanitize(t("Learn More")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/learn#pricing">');
__out.push(__sanitize(t("Pricing")));
__out.push('</a></li>\n <li><a href="http://support.uber.com">');
__out.push(__sanitize(t("Support & FAQ")));
__out.push('</a></li>\n <li><a href="https://partners.uber.com/#!/partners/new">');
__out.push(__sanitize(t("Apply to Drive")));
__out.push('</a></li>\n </ul>\n</div>\n<div class="footer_col_2">\n <ul>\n <li class="head">');
__out.push(__sanitize(t("Social")));
__out.push('</li>\n <li><a href="http://www.twitter.com/uber">');
__out.push(__sanitize(t("Twitter")));
__out.push('</a></li>\n <li><a href="http://www.facebook.com/uber">');
__out.push(__sanitize(t("Facebook")));
__out.push('</a></li>\n <li><a href="http://blog.uber.com">');
__out.push(__sanitize(t("Blog")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/contact">');
__out.push(__sanitize(t("Contact Us")));
__out.push('</a></li>\n </ul>\n</div>\n<div class="footer_col_2">\n <ul>\n <li class="head">');
__out.push(__sanitize(t("Phones")));
__out.push('</li>\n <li><a href="https://www.uber.com/phones/text">');
__out.push(__sanitize(t("Text Message")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/phones/iphone">');
__out.push(__sanitize(t("iPhone")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/phones/android">');
__out.push(__sanitize(t("Android")));
__out.push('</a></li>\n </ul>\n</div>\n<div class="footer_col_2">\n <ul>\n <li class="head">');
__out.push(__sanitize(t("Company_Footer")));
__out.push('</li>\n <li><a href="https://www.uber.com/privacy">');
__out.push(__sanitize(t("Privacy Policy")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/terms">');
__out.push(__sanitize(t("Terms")));
__out.push('</a></li>\n <li><a href="https://www.uber.com/jobs">');
__out.push(__sanitize(t("Jobs")));
__out.push('</a></li>\n </ul>\n</div>\n<div class="footer_col_copyright">\n <p>');
__out.push(t("Copyright © Uber Technologies, Inc."));
__out.push('</p>\n <p>\n ');
__out.push(__sanitize(t('Language:')));
__out.push('\n ');
_ref = typeof i18n !== "undefined" && i18n !== null ? i18n.locales : void 0;
for (locale in _ref) {
title = _ref[locale];
__out.push('\n ');
if (locale === (typeof i18n !== "undefined" && i18n !== null ? i18n.getLocale() : void 0)) {
__out.push('\n <span class="language current_language" id=\'');
__out.push(__sanitize(locale));
__out.push('\'>');
__out.push(__sanitize(title));
__out.push('</span>\n ');
} else {
__out.push('\n <a href="');
__out.push(__sanitize(window.location.href));
__out.push('" class="language" id=\'');
__out.push(__sanitize(locale));
__out.push('\' title="');
__out.push(__sanitize(title));
__out.push('">');
__out.push(__sanitize(title));
__out.push('</a>\n ');
}
__out.push('\n ');
}
__out.push('\n </p>\n</div>\n');
}).call(this);
}).call(__obj);
__obj.safe = __objSafe, __obj.escape = __escape;
return __out.join('');
}}, "web-lib/translations/en": function(exports, require, module) {(function() {
exports.translations = {
"Info": "Info",
"Learn More": "Learn More",
"Pricing": "Pricing",
"FAQ": "FAQ",
"Support": "Support",
"Support & FAQ": "Support & FAQ",
"Contact Us": "Contact Us",
"Jobs": "Jobs",
"Phones": "Phones",
"Text Message": "Text Message",
"iPhone": "iPhone",
"Android": "Android",
"Drivers": "Drivers",
"Apply": "Apply",
"Sign In": "Sign In",
"Social": "Social",
"Twitter": "Twitter",
"Facebook": "Facebook",
"Blog": "Blog",
"Legal": "Legal",
"Company_Footer": "Company",
"Privacy Policy": "Privacy Policy",
"Terms": "Terms",
"Copyright © Uber Technologies, Inc.": "Copyright © Uber Technologies, Inc.",
"Language:": "Language:",
"Apply to Drive": "Apply to Drive",
"Expiration": "Expiration",
"Fare": "Fare",
"Driver": "Driver ",
"Dashboard": "Dashboard",
"Forgot Password": "Forgot Password",
"Trip Details": "Trip Details",
"Save": "Save",
"Cancel": "Cancel",
"Edit": "Edit",
"Password": "Password",
"First Name": "First Name",
"Last Name": "Last Name",
"Email Address": "Email Address",
"Submit": "Submit",
"Mobile Number": "Mobile Number",
"Zip Code": "Zip Code",
"Sign Out": "Sign Out",
"Confirm Email Message": "Attempting to confirm email...",
"Upload": "Upload",
"Rating": "Rating",
"Pickup Time": "Pickup Time",
"2011": "2011",
"2012": "2012",
"2013": "2013",
"2014": "2014",
"2015": "2015",
"2016": "2016",
"2017": "2017",
"2018": "2018",
"2019": "2019",
"2020": "2020",
"2021": "2021",
"2022": "2022",
"01": "01",
"02": "02",
"03": "03",
"04": "04",
"05": "05",
"06": "06",
"07": "07",
"08": "08",
"09": "09",
"10": "10",
"11": "11",
"12": "12"
};
}).call(this);
}, "web-lib/translations/fr": function(exports, require, module) {(function() {
exports.translations = {
"Info": "Info",
"Learn More": "En Savoir Plus",
"Pricing": "Calcul du Prix",
"Support & FAQ": "Aide & FAQ",
"Contact Us": "Contactez Nous",
"Jobs": "Emplois",
"Phones": "Téléphones",
"Text Message": "SMS",
"iPhone": "iPhone",
"Android": "Android",
"Apply to Drive": "Candidature Chauffeur",
"Sign In": "Connexion",
"Social": "Contact",
"Twitter": "Twitter",
"Facebook": "Facebook",
"Blog": "Blog",
"Privacy Policy": "Protection des Données Personelles",
"Terms": "Conditions Générales",
"Copyright © Uber Technologies, Inc.": "© Uber, Inc.",
"Language:": "Langue:",
"Forgot Password": "Mot de passe oublié",
"Company_Footer": "À Propos d'Uber",
"Expiration": "Expiration",
"Fare": "Tarif",
"Driver": "Chauffeur",
"Drivers": "Chauffeurs",
"Dashboard": "Tableau de bord",
"Forgot Password": "Mot de passe oublié",
"Forgot Password?": "Mot de passe oublié?",
"Trip Details": "Détails de la course",
"Save": "Enregistrer",
"Cancel": "Annuler",
"Edit": "Modifier",
"Password": "Mot de passe",
"First Name": "Prénom",
"Last Name": "Nom",
"Email Address": "E-mail",
"Submit": "Soumettre",
"Mobile Number": "Téléphone Portable",
"Zip Code": "Code Postal",
"Sign Out": "Se déconnecter",
"Confirm Email Message": "E-mail de confirmation",
"Upload": "Télécharger",
"Rating": "Notation",
"Pickup Time": "Heure de prise en charge",
"2011": "2011",
"2012": "2012",
"2013": "2013",
"2014": "2014",
"2015": "2015",
"2016": "2016",
"2017": "2017",
"2018": "2018",
"2019": "2019",
"2020": "2020",
"2021": "2021",
"2022": "2022",
"01": "01",
"02": "02",
"03": "03",
"04": "04",
"05": "05",
"06": "06",
"07": "07",
"08": "08",
"09": "09",
"10": "10",
"11": "11",
"12": "12"
};
}).call(this);
}, "web-lib/uber_collection": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberCollection = (function() {
__extends(UberCollection, Backbone.Collection);
function UberCollection() {
UberCollection.__super__.constructor.apply(this, arguments);
}
UberCollection.prototype.parse = function(data) {
var model, tmp, _i, _in, _len, _out;
_in = data.resources || data;
_out = [];
if (data.meta) {
this.meta = data.meta;
}
for (_i = 0, _len = _in.length; _i < _len; _i++) {
model = _in[_i];
tmp = new this.model;
tmp.set(tmp.parse(model));
_out.push(tmp);
}
return _out;
};
UberCollection.prototype.isRenderable = function() {
if (this.models.length) {
return true;
}
};
UberCollection.prototype.toTableRows = function(cols) {
var tableRows;
tableRows = [];
_.each(this.models, function(model) {
return tableRows.push(model.toTableRow(cols));
});
return tableRows;
};
return UberCollection;
})();
}).call(this);
}, "web-lib/uber_model": function(exports, require, module) {(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
exports.UberModel = (function() {
__extends(UberModel, Backbone.Model);
function UberModel() {
this.refetch = __bind(this.refetch, this);
this.fetch = __bind(this.fetch, this);
this.save = __bind(this.save, this);
this.parse = __bind(this.parse, this);
UberModel.__super__.constructor.apply(this, arguments);
}
UberModel.prototype.endpoint = 'set_api_endpoint_in_subclass';
UberModel.prototype.refetchOptions = {};
UberModel.prototype.url = function(type) {
var endpoint_path;
endpoint_path = "/" + this.endpoint;
if (this.get('id')) {
return endpoint_path + ("/" + (this.get('id')));
} else {
return endpoint_path;
}
};
UberModel.prototype.isRenderable = function() {
var i, key, value, _ref;
i = 0;
_ref = this.attributes;
for (key in _ref) {
if (!__hasProp.call(_ref, key)) continue;
value = _ref[key];
if (this.attributes.hasOwnProperty(key)) {
i += 1;
}
if (i > 1) {
return true;
}
}
return !(i === 1);
};
UberModel.prototype.parse = function(response) {
var attrs, key, model, models, _i, _j, _k, _len, _len2, _len3, _ref, _ref2;
if (typeof response === 'object') {
_ref = _.intersection(_.keys(app.models), _.keys(response));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
if (response[key]) {
attrs = this.parse(response[key]);
if (typeof attrs === 'object') {
response[key] = new app.models[key](attrs);
}
}
}
_ref2 = _.intersection(_.keys(app.collections), _.keys(response));
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
key = _ref2[_j];
models = response[key];
if (_.isArray(models)) {
response[key] = new app.collections[key];
for (_k = 0, _len3 = models.length; _k < _len3; _k++) {
model = models[_k];
attrs = app.collections[key].prototype.model.prototype.parse(model);
response[key].add(new response[key].model(attrs));
}
}
}
}
return response;
};
UberModel.prototype.save = function(attributes, options) {
var attr, _i, _j, _len, _len2, _ref, _ref2;
if (options == null) {
options = {};
}
_ref = _.intersection(_.keys(app.models), _.keys(this.attributes));
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
attr = _ref[_i];
if (typeof this.get(attr) === "object") {
this.unset(attr, {
silent: true
});
}
}
_ref2 = _.intersection(_.keys(app.collections), _.keys(this.attributes));
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
attr = _ref2[_j];
if (typeof this.get(attr) === "object") {
this.unset(attr, {
silent: true
});
}
}
if ((options != null) && options.diff && (attributes != null) && attributes !== {}) {
attributes['id'] = this.get('id');
attributes['token'] = this.get('token');
this.clear({
'silent': true
});
this.set(attributes, {
silent: true
});
}
if (__indexOf.call(_.keys(options), "data") < 0 && __indexOf.call(_.keys(this.refetchOptions || {}), "data") >= 0) {
options.data = this.refetchOptions.data;
}
return Backbone.Model.prototype.save.call(this, attributes, options);
};
UberModel.prototype.fetch = function(options) {
this.refetchOptions = options;
return Backbone.Model.prototype.fetch.call(this, options);
};
UberModel.prototype.refetch = function() {
return this.fetch(this.refetchOptions);
};
return UberModel;
})();
}).call(this);
}, "web-lib/uber_router": function(exports, require, module) {(function() {
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberRouter = (function() {
__extends(UberRouter, Backbone.Router);
function UberRouter() {
UberRouter.__super__.constructor.apply(this, arguments);
}
UberRouter.prototype.datePickers = function(format) {
if (format == null) {
format = "%Z-%m-%dT%H:%i:%s%:";
}
$('.datepicker').AnyTime_noPicker();
return $('.datepicker').AnyTime_picker({
'format': format,
'formatUtcOffset': '%@'
});
};
UberRouter.prototype.autoGrowInput = function() {
return $('.editable input').autoGrowInput();
};
UberRouter.prototype.windowTitle = function(title) {
return $(document).attr('title', title);
};
return UberRouter;
})();
}).call(this);
}, "web-lib/uber_show_view": function(exports, require, module) {(function() {
var UberView;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
UberView = require('web-lib/uber_view').UberView;
exports.UberShowView = (function() {
__extends(UberShowView, UberView);
function UberShowView() {
UberShowView.__super__.constructor.apply(this, arguments);
}
UberShowView.prototype.view = 'show';
UberShowView.prototype.events = {
'click #edit': 'edit',
'submit form': 'save',
'click .cancel': 'cancel'
};
UberShowView.prototype.errors = null;
UberShowView.prototype.showTemplate = null;
UberShowView.prototype.editTemplate = null;
UberShowView.prototype.initialize = function() {
if (this.init_hook) {
this.init_hook();
}
_.bindAll(this, 'render');
return this.model.bind('change', this.render);
};
UberShowView.prototype.render = function() {
var $el;
$el = $(this.el);
this.selectView();
if (this.view === 'show') {
$el.html(this.showTemplate({
model: this.model
}));
} else if (this.view === 'edit') {
$el.html(this.editTemplate({
model: this.model,
errors: this.errors || {},
collections: this.collections || {}
}));
} else {
$el.html(this.newTemplate({
model: this.model,
errors: this.errors || {},
collections: this.collections || {}
}));
}
if (this.render_hook) {
this.render_hook();
}
this.errors = null;
this.userIdsToLinkedNames();
this.datePickers();
return this.place();
};
UberShowView.prototype.selectView = function() {
var url;
if (this.options.urlRendering) {
url = window.location.hash;
if (url.match(/\/new/)) {
return this.view = 'new';
} else if (url.match(/\/edit/)) {
return this.view = 'edit';
} else {
return this.view = 'show';
}
}
};
UberShowView.prototype.edit = function(e) {
e.preventDefault();
if (this.options.urlRendering) {
window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id') + '/edit';
} else {
this.view = 'edit';
}
return this.model.change();
};
UberShowView.prototype.save = function(e) {
var attributes, ele, form_attrs, _i, _len, _ref;
e.preventDefault();
attributes = $(e.currentTarget).serializeToJson();
form_attrs = {};
_ref = $('input[type="radio"]');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
ele = _ref[_i];
if ($(ele).is(':checked')) {
form_attrs[$(ele).attr('name')] = $(ele).attr('value');
}
}
attributes = _.extend(attributes, form_attrs);
if (this.relationships) {
attributes = _.extend(attributes, {
relationships: this.relationships
});
}
if (this.filter_attributes != null) {
this.filter_attributes(attributes);
}
return this.model.save(attributes, {
silent: true,
success: __bind(function(model) {
if (this.options.urlRendering) {
window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id');
} else {
this.view = 'show';
}
return this.flash('success', "Uber save!");
}, this),
statusCode: {
406: __bind(function(xhr) {
this.errors = JSON.parse(xhr.responseText);
return this.flash('error', 'That was not Uber.');
}, this)
},
error: __bind(function(model, xhr) {
var code, message, responseJSON, responseText;
code = xhr.status;
responseText = xhr.responseText;
if (responseText) {
responseJSON = JSON.parse(responseText);
}
if (responseJSON && (typeof responseJSON === 'object') && (responseJSON.hasOwnProperty('error'))) {
message = responseJSON.error;
}
return this.flash('error', (code || 'Unknown') + ' error' + (': ' + message || ''));
}, this),
complete: __bind(function() {
return this.model.change();
}, this)
});
};
UberShowView.prototype.cancel = function(e) {
e.preventDefault();
if (this.options.urlRendering) {
window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id');
} else {
this.view = 'show';
}
return this.model.fetch({
silent: true,
complete: __bind(function() {
return this.model.change();
}, this)
});
};
return UberShowView;
})();
}).call(this);
}, "web-lib/uber_sync": function(exports, require, module) {(function() {
var methodType;
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
methodType = {
create: 'POST',
update: 'PUT',
"delete": 'DELETE',
read: 'GET'
};
exports.UberSync = function(method, model, options) {
var token;
options.type = methodType[method];
options.url = _.isString(this.url) ? '/api' + this.url : '/api' + this.url(options.type);
options.data = _.extend({}, options.data);
if (__indexOf.call(_.keys(options.data), "city_id") < 0) {
if ($.cookie('city_filter')) {
_.extend(options.data, {
city_id: $.cookie('city_filter')
});
}
} else {
delete options.data['city_id'];
}
if (options.type === 'POST' || options.type === 'PUT') {
_.extend(options.data, model.toJSON());
}
token = $.cookie('token') ? $.cookie('token') : typeof USER !== "undefined" && USER !== null ? USER.get('token') : "";
_.extend(options.data, {
token: token
});
if (method === "delete") {
options.contentType = 'application/json';
options.data = JSON.stringify(options.data);
}
return $.ajax(options);
};
}).call(this);
}, "web-lib/uber_view": function(exports, require, module) {(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
exports.UberView = (function() {
__extends(UberView, Backbone.View);
function UberView() {
this.processDocumentUpload = __bind(this.processDocumentUpload, this);
UberView.__super__.constructor.apply(this, arguments);
}
UberView.prototype.className = 'view_container';
UberView.prototype.hashId = function() {
return parseInt(location.hash.split('/')[2]);
};
UberView.prototype.place = function(content) {
var $target;
$target = this.options.scope ? this.options.scope.find(this.options.selector) : $(this.options.selector);
$target[this.options.method || 'html'](content || this.el);
this.delegateEvents();
$('#spinner').hide();
return this;
};
UberView.prototype.mixin = function(m, args) {
var events, self;
if (args == null) {
args = {};
}
self = this;
events = m._events;
_.extend(this, m);
if (m.initialize) {
m.initialize(self, args);
}
return _.each(_.keys(events), function(key) {
var event, func, selector, split;
split = key.split(' ');
event = split[0];
selector = split[1];
func = events[key];
return $(self.el).find(selector).live(event, function(e) {
return self[func](e);
});
});
};
UberView.prototype.datePickers = function(format) {
if (format == null) {
format = "%Z-%m-%dT%H:%i:%s%:";
}
$('.datepicker').AnyTime_noPicker();
return $('.datepicker').AnyTime_picker({
'format': format,
'formatUtcOffset': '%@'
});
};
UberView.prototype.dataTable = function(collection, selector, options, params, cols) {
var defaults;
if (selector == null) {
selector = 'table';
}
if (options == null) {
options = {};
}
if (params == null) {
params = {};
}
if (cols == null) {
cols = [];
}
$(selector).empty();
if (!cols.length) {
cols = collection.defaultColumns;
}
defaults = {
aoColumns: collection.tableColumns(cols),
bDestroy: true,
bSort: false,
bProcessing: true,
bFilter: false,
bServerSide: true,
bPaginate: true,
bScrollInfinite: true,
bScrollCollapse: true,
sScrollY: '600px',
iDisplayLength: 50,
fnServerData: function(source, data, callback) {
var defaultParams;
defaultParams = {
limit: data[4].value,
offset: data[3].value
};
return collection.fetch({
data: _.extend(defaultParams, params),
success: function() {
return callback({
aaData: collection.toTableRows(cols),
iTotalRecords: collection.meta.count,
iTotalDisplayRecords: collection.meta.count
});
},
error: function() {
return new Error({
message: 'Loading error.'
});
}
});
},
fnRowCallback: function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$('[data-tooltip]', nRow).qtip({
content: {
attr: 'data-tooltip'
},
style: {
classes: "ui-tooltip-light ui-tooltip-rounded ui-tooltip-shadow"
}
});
return nRow;
}
};
return $(this.el).find(selector).dataTable(_.extend(defaults, options));
};
UberView.prototype.dataTableLocal = function(collection, selector, options, params, cols) {
var $dataTable, defaults;
if (selector == null) {
selector = 'table';
}
if (options == null) {
options = {};
}
if (params == null) {
params = {};
}
if (cols == null) {
cols = [];
}
$(selector).empty();
if (!cols.length || cols.length === 0) {
cols = collection.defaultColumns;
}
defaults = {
aaData: collection.toTableRows(cols),
aoColumns: collection.tableColumns(cols),
bDestroy: true,
bSort: false,
bProcessing: true,
bFilter: false,
bScrollInfinite: true,
bScrollCollapse: true,
sScrollY: '600px',
iDisplayLength: -1
};
$dataTable = $(this.el).find(selector).dataTable(_.extend(defaults, options));
_.delay(__bind(function() {
if ($dataTable && $dataTable.length > 0) {
return $dataTable.fnAdjustColumnSizing();
}
}, this), 1);
return $dataTable;
};
UberView.prototype.reverseGeocode = function() {
var $el;
return '';
$el = $(this.el);
return this.requireMaps(function() {
var geocoder;
geocoder = new google.maps.Geocoder();
return $el.find('[data-point]').each(function() {
var $this, latLng, point;
$this = $(this);
point = JSON.parse($this.attr('data-point'));
latLng = new google.maps.LatLng(point.latitude, point.longitude);
return geocoder.geocode({
latLng: latLng
}, function(data, status) {
if (status === google.maps.GeocoderStatus.OK) {
return $this.text(data[0].formatted_address);
}
});
});
});
};
UberView.prototype.userIdsToLinkedNames = function() {
var $el;
$el = $(this.el);
return $el.find('a[data-user-id][data-user-type]').each(function() {
var $this, user, userType;
$this = $(this);
userType = $this.attr('data-user-type') === 'user' ? 'client' : $this.attr('data-user-type');
user = new app.models[userType]({
id: $this.attr('data-user-id')
});
return user.fetch({
success: function(user) {
return $this.html(app.helpers.linkedName(user)).attr('href', "!/" + user.role + "s/" + user.id);
},
error: function() {
if ($this.attr('data-user-type') === 'user') {
user = new app.models['driver']({
id: $this.attr('data-user-id')
});
return user.fetch({
success: function(user) {
return $this.html(app.helpers.linkedName(user)).attr('href', "!/driver/" + user.id);
}
});
}
}
});
});
};
UberView.prototype.selectedCity = function() {
var $selected, city, cityFilter;
cityFilter = $.cookie('city_filter');
$selected = $("#city_filter option[value=" + cityFilter + "]");
if (city_filter && $selected.length) {
return city = {
lat: parseFloat($selected.attr('data-lat')),
lng: parseFloat($selected.attr('data-lng')),
timezone: $selected.attr('data-timezone')
};
} else {
return city = {
lat: 37.775,
lng: -122.45,
timezone: 'Etc/UTC'
};
}
};
UberView.prototype.updateModel = function(e, success) {
var $el, attrs, model, self;
e.preventDefault();
$el = $(e.currentTarget);
self = this;
model = new this.model.__proto__.constructor({
id: this.model.id
});
attrs = {};
$el.find('[name]').each(function() {
var $this;
$this = $(this);
return attrs["" + ($this.attr('name'))] = $this.val();
});
self.model.set(attrs);
$el.find('span.error').text('');
return model.save(attrs, {
complete: function(xhr) {
var response;
response = JSON.parse(xhr.responseText);
switch (xhr.status) {
case 200:
self.model = model;
$el.find('[name]').val('');
if (success) {
return success();
}
break;
case 406:
return _.each(response, function(error, field) {
return $el.find("[name=" + field + "]").parent().find('span.error').text(error);
});
default:
return this.unanticipatedError(response);
}
}
});
};
UberView.prototype.autoUpdateModel = function(e) {
var $el, arg, model, self, val;
$el = $(e.currentTarget);
val = $el.val();
self = this;
if (val !== this.model.get($el.attr('id'))) {
arg = {};
arg[$el.attr('id')] = $el.is(':checkbox') ? $el.is(':checked') ? 1 : 0 : val;
$('.editable span').empty();
this.model.set(arg);
model = new this.model.__proto__.constructor({
id: this.model.id
});
return model.save(arg, {
complete: function(xhr) {
var key, response, _i, _len, _ref, _results;
response = JSON.parse(xhr.responseText);
switch (xhr.status) {
case 200:
self.flash('success', 'Saved!');
return $el.blur();
case 406:
self.flash('error', 'That was not Uber.');
_ref = _.keys(response);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
_results.push($el.parent().find('span').html(response[key]));
}
return _results;
break;
default:
return self.unanticipatedError;
}
}
});
}
};
UberView.prototype.unanticipatedError = function(response) {
return self.flash('error', response);
};
UberView.prototype.flash = function(type, text) {
var $banner;
$banner = $("." + type);
$banner.find('p').text(text).end().css('border', '1px solid #999').animate({
top: 0
}, 500);
return setTimeout(function() {
return $banner.animate({
top: -$banner.outerHeight()
}, 500);
}, 3000);
};
UberView.prototype.requireMaps = function(callback) {
if (typeof google !== 'undefined' && google.maps) {
return callback();
} else {
return $.getScript("https://www.google.com/jsapi?key=" + CONFIG.googleJsApiKey, function() {
return google.load('maps', 3, {
callback: callback,
other_params: 'sensor=false&language=en'
});
});
}
};
UberView.prototype.select_drop_down = function(model, key) {
var value;
value = model.get(key);
if (value) {
return $("select[id='" + key + "'] option[value='" + value + "']").attr('selected', 'selected');
}
};
UberView.prototype.processDocumentUpload = function(e) {
var $fi, $form, arbData, curDate, data, expDate, expM, expY, expiration, fileElementId, invalid;
e.preventDefault();
$form = $(e.currentTarget);
$fi = $("input[type=file]", $form);
$(".validationError").removeClass("validationError");
if (!$fi.val()) {
return $fi.addClass("validationError");
} else {
fileElementId = $fi.attr('id');
expY = $("select[name=expiration-year]", $form).val();
expM = $("select[name=expiration-month]", $form).val();
invalid = false;
if (expY && expM) {
expDate = new Date(expY, expM, 28);
curDate = new Date();
if (expDate < curDate) {
invalid = true;
$(".expiration", $form).addClass("validationError");
}
expiration = "" + expY + "-" + expM + "-28T23:59:59Z";
}
arbData = {};
$(".arbitraryField", $form).each(__bind(function(i, e) {
arbData[$(e).attr('name')] = $(e).val();
if ($(e).val() === "") {
invalid = true;
return $(e).addClass("validationError");
}
}, this));
if (!invalid) {
data = {
token: $.cookie('token') || USER.get('token'),
name: $("input[name=fileName]", $form).val(),
meta: escape(JSON.stringify(arbData)),
user_id: $("input[name=driver_id]", $form).val(),
vehicle_id: $("input[name=vehicle_id]", $form).val()
};
if (expiration) {
data['expiration'] = expiration;
}
$("#spinner").show();
return $.ajaxFileUpload({
url: '/api/documents',
secureuri: false,
fileElementId: fileElementId,
data: data,
complete: __bind(function(resp, status) {
var key, _i, _len, _ref, _results;
$("#spinner").hide();
if (status === "success") {
if (this.model) {
this.model.refetch();
} else {
USER.refetch();
}
}
if (status === "error") {
_ref = _.keys(resp);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
key = _ref[_i];
_results.push($("*[name=" + key + "]", $form).addClass("validationError"));
}
return _results;
}
}, this)
});
}
}
};
return UberView;
})();
}).call(this);
}, "web-lib/views/footer": function(exports, require, module) {(function() {
var footerTemplate;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
footerTemplate = require('web-lib/templates/footer');
exports.SharedFooterView = (function() {
__extends(SharedFooterView, Backbone.View);
function SharedFooterView() {
SharedFooterView.__super__.constructor.apply(this, arguments);
}
SharedFooterView.prototype.id = 'footer_view';
SharedFooterView.prototype.events = {
'click .language': 'intl_set_cookie_locale'
};
SharedFooterView.prototype.render = function() {
$(this.el).html(footerTemplate());
this.delegateEvents();
return this;
};
SharedFooterView.prototype.intl_set_cookie_locale = function(e) {
var _ref;
i18n.setLocale(e != null ? (_ref = e.srcElement) != null ? _ref.id : void 0 : void 0);
return location.reload();
};
return SharedFooterView;
})();
}).call(this);
}});
|
misc/tabledrag.js | g-raph/kotr | (function ($) {
/**
* Drag and drop table rows with field manipulation.
*
* Using the drupal_add_tabledrag() function, any table with weights or parent
* relationships may be made into draggable tables. Columns containing a field
* may optionally be hidden, providing a better user experience.
*
* Created tableDrag instances may be modified with custom behaviors by
* overriding the .onDrag, .onDrop, .row.onSwap, and .row.onIndent methods.
* See blocks.js for an example of adding additional functionality to tableDrag.
*/
Drupal.behaviors.tableDrag = {
attach: function (context, settings) {
for (var base in settings.tableDrag) {
$('#' + base, context).once('tabledrag', function () {
// Create the new tableDrag instance. Save in the Drupal variable
// to allow other scripts access to the object.
Drupal.tableDrag[base] = new Drupal.tableDrag(this, settings.tableDrag[base]);
});
}
}
};
/**
* Constructor for the tableDrag object. Provides table and field manipulation.
*
* @param table
* DOM object for the table to be made draggable.
* @param tableSettings
* Settings for the table added via drupal_add_dragtable().
*/
Drupal.tableDrag = function (table, tableSettings) {
var self = this;
// Required object variables.
this.table = table;
this.tableSettings = tableSettings;
this.dragObject = null; // Used to hold information about a current drag operation.
this.rowObject = null; // Provides operations for row manipulation.
this.oldRowElement = null; // Remember the previous element.
this.oldY = 0; // Used to determine up or down direction from last mouse move.
this.changed = false; // Whether anything in the entire table has changed.
this.maxDepth = 0; // Maximum amount of allowed parenting.
this.rtl = $(this.table).css('direction') == 'rtl' ? -1 : 1; // Direction of the table.
// Configure the scroll settings.
this.scrollSettings = { amount: 4, interval: 50, trigger: 70 };
this.scrollInterval = null;
this.scrollY = 0;
this.windowHeight = 0;
// Check this table's settings to see if there are parent relationships in
// this table. For efficiency, large sections of code can be skipped if we
// don't need to track horizontal movement and indentations.
this.indentEnabled = false;
for (var group in tableSettings) {
for (var n in tableSettings[group]) {
if (tableSettings[group][n].relationship == 'parent') {
this.indentEnabled = true;
}
if (tableSettings[group][n].limit > 0) {
this.maxDepth = tableSettings[group][n].limit;
}
}
}
if (this.indentEnabled) {
this.indentCount = 1; // Total width of indents, set in makeDraggable.
// Find the width of indentations to measure mouse movements against.
// Because the table doesn't need to start with any indentations, we
// manually append 2 indentations in the first draggable row, measure
// the offset, then remove.
var indent = Drupal.theme('tableDragIndentation');
var testRow = $('<tr/>').addClass('draggable').appendTo(table);
var testCell = $('<td/>').appendTo(testRow).prepend(indent).prepend(indent);
this.indentAmount = $('.indentation', testCell).get(1).offsetLeft - $('.indentation', testCell).get(0).offsetLeft;
testRow.remove();
}
// Make each applicable row draggable.
// Match immediate children of the parent element to allow nesting.
$('> tr.draggable, > tbody > tr.draggable', table).each(function () { self.makeDraggable(this); });
// Add a link before the table for users to show or hide weight columns.
$(table).before($('<a href="#" class="tabledrag-toggle-weight"></a>')
.attr('title', Drupal.t('Re-order rows by numerical weight instead of dragging.'))
.click(function () {
if ($.cookie('Drupal.tableDrag.showWeight') == 1) {
self.hideColumns();
}
else {
self.showColumns();
}
return false;
})
.wrap('<div class="tabledrag-toggle-weight-wrapper"></div>')
.parent()
);
// Initialize the specified columns (for example, weight or parent columns)
// to show or hide according to user preference. This aids accessibility
// so that, e.g., screen reader users can choose to enter weight values and
// manipulate form elements directly, rather than using drag-and-drop..
self.initColumns();
// Add mouse bindings to the document. The self variable is passed along
// as event handlers do not have direct access to the tableDrag object.
$(document).bind('mousemove', function (event) { return self.dragRow(event, self); });
$(document).bind('mouseup', function (event) { return self.dropRow(event, self); });
};
/**
* Initialize columns containing form elements to be hidden by default,
* according to the settings for this tableDrag instance.
*
* Identify and mark each cell with a CSS class so we can easily toggle
* show/hide it. Finally, hide columns if user does not have a
* 'Drupal.tableDrag.showWeight' cookie.
*/
Drupal.tableDrag.prototype.initColumns = function () {
for (var group in this.tableSettings) {
// Find the first field in this group.
for (var d in this.tableSettings[group]) {
var field = $('.' + this.tableSettings[group][d].target + ':first', this.table);
if (field.length && this.tableSettings[group][d].hidden) {
var hidden = this.tableSettings[group][d].hidden;
var cell = field.closest('td');
break;
}
}
// Mark the column containing this field so it can be hidden.
if (hidden && cell[0]) {
// Add 1 to our indexes. The nth-child selector is 1 based, not 0 based.
// Match immediate children of the parent element to allow nesting.
var columnIndex = $('> td', cell.parent()).index(cell.get(0)) + 1;
$('> thead > tr, > tbody > tr, > tr', this.table).each(function () {
// Get the columnIndex and adjust for any colspans in this row.
var index = columnIndex;
var cells = $(this).children();
cells.each(function (n) {
if (n < index && this.colSpan && this.colSpan > 1) {
index -= this.colSpan - 1;
}
});
if (index > 0) {
cell = cells.filter(':nth-child(' + index + ')');
if (cell[0].colSpan && cell[0].colSpan > 1) {
// If this cell has a colspan, mark it so we can reduce the colspan.
cell.addClass('tabledrag-has-colspan');
}
else {
// Mark this cell so we can hide it.
cell.addClass('tabledrag-hide');
}
}
});
}
}
// Now hide cells and reduce colspans unless cookie indicates previous choice.
// Set a cookie if it is not already present.
if ($.cookie('Drupal.tableDrag.showWeight') === null) {
$.cookie('Drupal.tableDrag.showWeight', 0, {
path: Drupal.settings.basePath,
// The cookie expires in one year.
expires: 365
});
this.hideColumns();
}
// Check cookie value and show/hide weight columns accordingly.
else {
if ($.cookie('Drupal.tableDrag.showWeight') == 1) {
this.showColumns();
}
else {
this.hideColumns();
}
}
};
/**
* Hide the columns containing weight/parent form elements.
* Undo showColumns().
*/
Drupal.tableDrag.prototype.hideColumns = function () {
// Hide weight/parent cells and headers.
$('.tabledrag-hide', 'table.tabledrag-processed').css('display', 'none');
// Show TableDrag handles.
$('.tabledrag-handle', 'table.tabledrag-processed').css('display', '');
// Reduce the colspan of any effected multi-span columns.
$('.tabledrag-has-colspan', 'table.tabledrag-processed').each(function () {
this.colSpan = this.colSpan - 1;
});
// Change link text.
$('.tabledrag-toggle-weight').text(Drupal.t('Show row weights'));
// Change cookie.
$.cookie('Drupal.tableDrag.showWeight', 0, {
path: Drupal.settings.basePath,
// The cookie expires in one year.
expires: 365
});
// Trigger an event to allow other scripts to react to this display change.
$('table.tabledrag-processed').trigger('columnschange', 'hide');
};
/**
* Show the columns containing weight/parent form elements
* Undo hideColumns().
*/
Drupal.tableDrag.prototype.showColumns = function () {
// Show weight/parent cells and headers.
$('.tabledrag-hide', 'table.tabledrag-processed').css('display', '');
// Hide TableDrag handles.
$('.tabledrag-handle', 'table.tabledrag-processed').css('display', 'none');
// Increase the colspan for any columns where it was previously reduced.
$('.tabledrag-has-colspan', 'table.tabledrag-processed').each(function () {
this.colSpan = this.colSpan + 1;
});
// Change link text.
$('.tabledrag-toggle-weight').text(Drupal.t('Hide row weights'));
// Change cookie.
$.cookie('Drupal.tableDrag.showWeight', 1, {
path: Drupal.settings.basePath,
// The cookie expires in one year.
expires: 365
});
// Trigger an event to allow other scripts to react to this display change.
$('table.tabledrag-processed').trigger('columnschange', 'show');
};
/**
* Find the target used within a particular row and group.
*/
Drupal.tableDrag.prototype.rowSettings = function (group, row) {
var field = $('.' + group, row);
for (var delta in this.tableSettings[group]) {
var targetClass = this.tableSettings[group][delta].target;
if (field.is('.' + targetClass)) {
// Return a copy of the row settings.
var rowSettings = {};
for (var n in this.tableSettings[group][delta]) {
rowSettings[n] = this.tableSettings[group][delta][n];
}
return rowSettings;
}
}
};
/**
* Take an item and add event handlers to make it become draggable.
*/
Drupal.tableDrag.prototype.makeDraggable = function (item) {
var self = this;
// Create the handle.
var handle = $('<a href="#" class="tabledrag-handle"><div class="handle"> </div></a>').attr('title', Drupal.t('Drag to re-order'));
// Insert the handle after indentations (if any).
if ($('td:first .indentation:last', item).length) {
$('td:first .indentation:last', item).after(handle);
// Update the total width of indentation in this entire table.
self.indentCount = Math.max($('.indentation', item).length, self.indentCount);
}
else {
$('td:first', item).prepend(handle);
}
// Add hover action for the handle.
handle.hover(function () {
self.dragObject == null ? $(this).addClass('tabledrag-handle-hover') : null;
}, function () {
self.dragObject == null ? $(this).removeClass('tabledrag-handle-hover') : null;
});
// Add the mousedown action for the handle.
handle.mousedown(function (event) {
// Create a new dragObject recording the event information.
self.dragObject = {};
self.dragObject.initMouseOffset = self.getMouseOffset(item, event);
self.dragObject.initMouseCoords = self.mouseCoords(event);
if (self.indentEnabled) {
self.dragObject.indentMousePos = self.dragObject.initMouseCoords;
}
// If there's a lingering row object from the keyboard, remove its focus.
if (self.rowObject) {
$('a.tabledrag-handle', self.rowObject.element).blur();
}
// Create a new rowObject for manipulation of this row.
self.rowObject = new self.row(item, 'mouse', self.indentEnabled, self.maxDepth, true);
// Save the position of the table.
self.table.topY = $(self.table).offset().top;
self.table.bottomY = self.table.topY + self.table.offsetHeight;
// Add classes to the handle and row.
$(this).addClass('tabledrag-handle-hover');
$(item).addClass('drag');
// Set the document to use the move cursor during drag.
$('body').addClass('drag');
if (self.oldRowElement) {
$(self.oldRowElement).removeClass('drag-previous');
}
// Hack for IE6 that flickers uncontrollably if select lists are moved.
if (navigator.userAgent.indexOf('MSIE 6.') != -1) {
$('select', this.table).css('display', 'none');
}
// Hack for Konqueror, prevent the blur handler from firing.
// Konqueror always gives links focus, even after returning false on mousedown.
self.safeBlur = false;
// Call optional placeholder function.
self.onDrag();
return false;
});
// Prevent the anchor tag from jumping us to the top of the page.
handle.click(function () {
return false;
});
// Similar to the hover event, add a class when the handle is focused.
handle.focus(function () {
$(this).addClass('tabledrag-handle-hover');
self.safeBlur = true;
});
// Remove the handle class on blur and fire the same function as a mouseup.
handle.blur(function (event) {
$(this).removeClass('tabledrag-handle-hover');
if (self.rowObject && self.safeBlur) {
self.dropRow(event, self);
}
});
// Add arrow-key support to the handle.
handle.keydown(function (event) {
// If a rowObject doesn't yet exist and this isn't the tab key.
if (event.keyCode != 9 && !self.rowObject) {
self.rowObject = new self.row(item, 'keyboard', self.indentEnabled, self.maxDepth, true);
}
var keyChange = false;
switch (event.keyCode) {
case 37: // Left arrow.
case 63234: // Safari left arrow.
keyChange = true;
self.rowObject.indent(-1 * self.rtl);
break;
case 38: // Up arrow.
case 63232: // Safari up arrow.
var previousRow = $(self.rowObject.element).prev('tr').get(0);
while (previousRow && $(previousRow).is(':hidden')) {
previousRow = $(previousRow).prev('tr').get(0);
}
if (previousRow) {
self.safeBlur = false; // Do not allow the onBlur cleanup.
self.rowObject.direction = 'up';
keyChange = true;
if ($(item).is('.tabledrag-root')) {
// Swap with the previous top-level row.
var groupHeight = 0;
while (previousRow && $('.indentation', previousRow).length) {
previousRow = $(previousRow).prev('tr').get(0);
groupHeight += $(previousRow).is(':hidden') ? 0 : previousRow.offsetHeight;
}
if (previousRow) {
self.rowObject.swap('before', previousRow);
// No need to check for indentation, 0 is the only valid one.
window.scrollBy(0, -groupHeight);
}
}
else if (self.table.tBodies[0].rows[0] != previousRow || $(previousRow).is('.draggable')) {
// Swap with the previous row (unless previous row is the first one
// and undraggable).
self.rowObject.swap('before', previousRow);
self.rowObject.interval = null;
self.rowObject.indent(0);
window.scrollBy(0, -parseInt(item.offsetHeight, 10));
}
handle.get(0).focus(); // Regain focus after the DOM manipulation.
}
break;
case 39: // Right arrow.
case 63235: // Safari right arrow.
keyChange = true;
self.rowObject.indent(1 * self.rtl);
break;
case 40: // Down arrow.
case 63233: // Safari down arrow.
var nextRow = $(self.rowObject.group).filter(':last').next('tr').get(0);
while (nextRow && $(nextRow).is(':hidden')) {
nextRow = $(nextRow).next('tr').get(0);
}
if (nextRow) {
self.safeBlur = false; // Do not allow the onBlur cleanup.
self.rowObject.direction = 'down';
keyChange = true;
if ($(item).is('.tabledrag-root')) {
// Swap with the next group (necessarily a top-level one).
var groupHeight = 0;
var nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
if (nextGroup) {
$(nextGroup.group).each(function () {
groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight;
});
var nextGroupRow = $(nextGroup.group).filter(':last').get(0);
self.rowObject.swap('after', nextGroupRow);
// No need to check for indentation, 0 is the only valid one.
window.scrollBy(0, parseInt(groupHeight, 10));
}
}
else {
// Swap with the next row.
self.rowObject.swap('after', nextRow);
self.rowObject.interval = null;
self.rowObject.indent(0);
window.scrollBy(0, parseInt(item.offsetHeight, 10));
}
handle.get(0).focus(); // Regain focus after the DOM manipulation.
}
break;
}
if (self.rowObject && self.rowObject.changed == true) {
$(item).addClass('drag');
if (self.oldRowElement) {
$(self.oldRowElement).removeClass('drag-previous');
}
self.oldRowElement = item;
self.restripeTable();
self.onDrag();
}
// Returning false if we have an arrow key to prevent scrolling.
if (keyChange) {
return false;
}
});
// Compatibility addition, return false on keypress to prevent unwanted scrolling.
// IE and Safari will suppress scrolling on keydown, but all other browsers
// need to return false on keypress. http://www.quirksmode.org/js/keys.html
handle.keypress(function (event) {
switch (event.keyCode) {
case 37: // Left arrow.
case 38: // Up arrow.
case 39: // Right arrow.
case 40: // Down arrow.
return false;
}
});
};
/**
* Mousemove event handler, bound to document.
*/
Drupal.tableDrag.prototype.dragRow = function (event, self) {
if (self.dragObject) {
self.currentMouseCoords = self.mouseCoords(event);
var y = self.currentMouseCoords.y - self.dragObject.initMouseOffset.y;
var x = self.currentMouseCoords.x - self.dragObject.initMouseOffset.x;
// Check for row swapping and vertical scrolling.
if (y != self.oldY) {
self.rowObject.direction = y > self.oldY ? 'down' : 'up';
self.oldY = y; // Update the old value.
// Check if the window should be scrolled (and how fast).
var scrollAmount = self.checkScroll(self.currentMouseCoords.y);
// Stop any current scrolling.
clearInterval(self.scrollInterval);
// Continue scrolling if the mouse has moved in the scroll direction.
if (scrollAmount > 0 && self.rowObject.direction == 'down' || scrollAmount < 0 && self.rowObject.direction == 'up') {
self.setScroll(scrollAmount);
}
// If we have a valid target, perform the swap and restripe the table.
var currentRow = self.findDropTargetRow(x, y);
if (currentRow) {
if (self.rowObject.direction == 'down') {
self.rowObject.swap('after', currentRow, self);
}
else {
self.rowObject.swap('before', currentRow, self);
}
self.restripeTable();
}
}
// Similar to row swapping, handle indentations.
if (self.indentEnabled) {
var xDiff = self.currentMouseCoords.x - self.dragObject.indentMousePos.x;
// Set the number of indentations the mouse has been moved left or right.
var indentDiff = Math.round(xDiff / self.indentAmount);
// Indent the row with our estimated diff, which may be further
// restricted according to the rows around this row.
var indentChange = self.rowObject.indent(indentDiff);
// Update table and mouse indentations.
self.dragObject.indentMousePos.x += self.indentAmount * indentChange * self.rtl;
self.indentCount = Math.max(self.indentCount, self.rowObject.indents);
}
return false;
}
};
/**
* Mouseup event handler, bound to document.
* Blur event handler, bound to drag handle for keyboard support.
*/
Drupal.tableDrag.prototype.dropRow = function (event, self) {
// Drop row functionality shared between mouseup and blur events.
if (self.rowObject != null) {
var droppedRow = self.rowObject.element;
// The row is already in the right place so we just release it.
if (self.rowObject.changed == true) {
// Update the fields in the dropped row.
self.updateFields(droppedRow);
// If a setting exists for affecting the entire group, update all the
// fields in the entire dragged group.
for (var group in self.tableSettings) {
var rowSettings = self.rowSettings(group, droppedRow);
if (rowSettings.relationship == 'group') {
for (var n in self.rowObject.children) {
self.updateField(self.rowObject.children[n], group);
}
}
}
self.rowObject.markChanged();
if (self.changed == false) {
$(Drupal.theme('tableDragChangedWarning')).insertBefore(self.table).hide().fadeIn('slow');
self.changed = true;
}
}
if (self.indentEnabled) {
self.rowObject.removeIndentClasses();
}
if (self.oldRowElement) {
$(self.oldRowElement).removeClass('drag-previous');
}
$(droppedRow).removeClass('drag').addClass('drag-previous');
self.oldRowElement = droppedRow;
self.onDrop();
self.rowObject = null;
}
// Functionality specific only to mouseup event.
if (self.dragObject != null) {
$('.tabledrag-handle', droppedRow).removeClass('tabledrag-handle-hover');
self.dragObject = null;
$('body').removeClass('drag');
clearInterval(self.scrollInterval);
// Hack for IE6 that flickers uncontrollably if select lists are moved.
if (navigator.userAgent.indexOf('MSIE 6.') != -1) {
$('select', this.table).css('display', 'block');
}
}
};
/**
* Get the mouse coordinates from the event (allowing for browser differences).
*/
Drupal.tableDrag.prototype.mouseCoords = function (event) {
if (event.pageX || event.pageY) {
return { x: event.pageX, y: event.pageY };
}
return {
x: event.clientX + document.body.scrollLeft - document.body.clientLeft,
y: event.clientY + document.body.scrollTop - document.body.clientTop
};
};
/**
* Given a target element and a mouse event, get the mouse offset from that
* element. To do this we need the element's position and the mouse position.
*/
Drupal.tableDrag.prototype.getMouseOffset = function (target, event) {
var docPos = $(target).offset();
var mousePos = this.mouseCoords(event);
return { x: mousePos.x - docPos.left, y: mousePos.y - docPos.top };
};
/**
* Find the row the mouse is currently over. This row is then taken and swapped
* with the one being dragged.
*
* @param x
* The x coordinate of the mouse on the page (not the screen).
* @param y
* The y coordinate of the mouse on the page (not the screen).
*/
Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) {
var rows = $(this.table.tBodies[0].rows).not(':hidden');
for (var n = 0; n < rows.length; n++) {
var row = rows[n];
var indentDiff = 0;
var rowY = $(row).offset().top;
// Because Safari does not report offsetHeight on table rows, but does on
// table cells, grab the firstChild of the row and use that instead.
// http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari.
if (row.offsetHeight == 0) {
var rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
}
// Other browsers.
else {
var rowHeight = parseInt(row.offsetHeight, 10) / 2;
}
// Because we always insert before, we need to offset the height a bit.
if ((y > (rowY - rowHeight)) && (y < (rowY + rowHeight))) {
if (this.indentEnabled) {
// Check that this row is not a child of the row being dragged.
for (var n in this.rowObject.group) {
if (this.rowObject.group[n] == row) {
return null;
}
}
}
else {
// Do not allow a row to be swapped with itself.
if (row == this.rowObject.element) {
return null;
}
}
// Check that swapping with this row is allowed.
if (!this.rowObject.isValidSwap(row)) {
return null;
}
// We may have found the row the mouse just passed over, but it doesn't
// take into account hidden rows. Skip backwards until we find a draggable
// row.
while ($(row).is(':hidden') && $(row).prev('tr').is(':hidden')) {
row = $(row).prev('tr').get(0);
}
return row;
}
}
return null;
};
/**
* After the row is dropped, update the table fields according to the settings
* set for this table.
*
* @param changedRow
* DOM object for the row that was just dropped.
*/
Drupal.tableDrag.prototype.updateFields = function (changedRow) {
for (var group in this.tableSettings) {
// Each group may have a different setting for relationship, so we find
// the source rows for each separately.
this.updateField(changedRow, group);
}
};
/**
* After the row is dropped, update a single table field according to specific
* settings.
*
* @param changedRow
* DOM object for the row that was just dropped.
* @param group
* The settings group on which field updates will occur.
*/
Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
var rowSettings = this.rowSettings(group, changedRow);
// Set the row as its own target.
if (rowSettings.relationship == 'self' || rowSettings.relationship == 'group') {
var sourceRow = changedRow;
}
// Siblings are easy, check previous and next rows.
else if (rowSettings.relationship == 'sibling') {
var previousRow = $(changedRow).prev('tr').get(0);
var nextRow = $(changedRow).next('tr').get(0);
var sourceRow = changedRow;
if ($(previousRow).is('.draggable') && $('.' + group, previousRow).length) {
if (this.indentEnabled) {
if ($('.indentations', previousRow).length == $('.indentations', changedRow)) {
sourceRow = previousRow;
}
}
else {
sourceRow = previousRow;
}
}
else if ($(nextRow).is('.draggable') && $('.' + group, nextRow).length) {
if (this.indentEnabled) {
if ($('.indentations', nextRow).length == $('.indentations', changedRow)) {
sourceRow = nextRow;
}
}
else {
sourceRow = nextRow;
}
}
}
// Parents, look up the tree until we find a field not in this group.
// Go up as many parents as indentations in the changed row.
else if (rowSettings.relationship == 'parent') {
var previousRow = $(changedRow).prev('tr');
while (previousRow.length && $('.indentation', previousRow).length >= this.rowObject.indents) {
previousRow = previousRow.prev('tr');
}
// If we found a row.
if (previousRow.length) {
sourceRow = previousRow[0];
}
// Otherwise we went all the way to the left of the table without finding
// a parent, meaning this item has been placed at the root level.
else {
// Use the first row in the table as source, because it's guaranteed to
// be at the root level. Find the first item, then compare this row
// against it as a sibling.
sourceRow = $(this.table).find('tr.draggable:first').get(0);
if (sourceRow == this.rowObject.element) {
sourceRow = $(this.rowObject.group[this.rowObject.group.length - 1]).next('tr.draggable').get(0);
}
var useSibling = true;
}
}
// Because we may have moved the row from one category to another,
// take a look at our sibling and borrow its sources and targets.
this.copyDragClasses(sourceRow, changedRow, group);
rowSettings = this.rowSettings(group, changedRow);
// In the case that we're looking for a parent, but the row is at the top
// of the tree, copy our sibling's values.
if (useSibling) {
rowSettings.relationship = 'sibling';
rowSettings.source = rowSettings.target;
}
var targetClass = '.' + rowSettings.target;
var targetElement = $(targetClass, changedRow).get(0);
// Check if a target element exists in this row.
if (targetElement) {
var sourceClass = '.' + rowSettings.source;
var sourceElement = $(sourceClass, sourceRow).get(0);
switch (rowSettings.action) {
case 'depth':
// Get the depth of the target row.
targetElement.value = $('.indentation', $(sourceElement).closest('tr')).length;
break;
case 'match':
// Update the value.
targetElement.value = sourceElement.value;
break;
case 'order':
var siblings = this.rowObject.findSiblings(rowSettings);
if ($(targetElement).is('select')) {
// Get a list of acceptable values.
var values = [];
$('option', targetElement).each(function () {
values.push(this.value);
});
var maxVal = values[values.length - 1];
// Populate the values in the siblings.
$(targetClass, siblings).each(function () {
// If there are more items than possible values, assign the maximum value to the row.
if (values.length > 0) {
this.value = values.shift();
}
else {
this.value = maxVal;
}
});
}
else {
// Assume a numeric input field.
var weight = parseInt($(targetClass, siblings[0]).val(), 10) || 0;
$(targetClass, siblings).each(function () {
this.value = weight;
weight++;
});
}
break;
}
}
};
/**
* Copy all special tableDrag classes from one row's form elements to a
* different one, removing any special classes that the destination row
* may have had.
*/
Drupal.tableDrag.prototype.copyDragClasses = function (sourceRow, targetRow, group) {
var sourceElement = $('.' + group, sourceRow);
var targetElement = $('.' + group, targetRow);
if (sourceElement.length && targetElement.length) {
targetElement[0].className = sourceElement[0].className;
}
};
Drupal.tableDrag.prototype.checkScroll = function (cursorY) {
var de = document.documentElement;
var b = document.body;
var windowHeight = this.windowHeight = window.innerHeight || (de.clientHeight && de.clientWidth != 0 ? de.clientHeight : b.offsetHeight);
var scrollY = this.scrollY = (document.all ? (!de.scrollTop ? b.scrollTop : de.scrollTop) : (window.pageYOffset ? window.pageYOffset : window.scrollY));
var trigger = this.scrollSettings.trigger;
var delta = 0;
// Return a scroll speed relative to the edge of the screen.
if (cursorY - scrollY > windowHeight - trigger) {
delta = trigger / (windowHeight + scrollY - cursorY);
delta = (delta > 0 && delta < trigger) ? delta : trigger;
return delta * this.scrollSettings.amount;
}
else if (cursorY - scrollY < trigger) {
delta = trigger / (cursorY - scrollY);
delta = (delta > 0 && delta < trigger) ? delta : trigger;
return -delta * this.scrollSettings.amount;
}
};
Drupal.tableDrag.prototype.setScroll = function (scrollAmount) {
var self = this;
this.scrollInterval = setInterval(function () {
// Update the scroll values stored in the object.
self.checkScroll(self.currentMouseCoords.y);
var aboveTable = self.scrollY > self.table.topY;
var belowTable = self.scrollY + self.windowHeight < self.table.bottomY;
if (scrollAmount > 0 && belowTable || scrollAmount < 0 && aboveTable) {
window.scrollBy(0, scrollAmount);
}
}, this.scrollSettings.interval);
};
Drupal.tableDrag.prototype.restripeTable = function () {
// :even and :odd are reversed because jQuery counts from 0 and
// we count from 1, so we're out of sync.
// Match immediate children of the parent element to allow nesting.
$('> tbody > tr.draggable:visible, > tr.draggable:visible', this.table)
.removeClass('odd even')
.filter(':odd').addClass('even').end()
.filter(':even').addClass('odd');
};
/**
* Stub function. Allows a custom handler when a row begins dragging.
*/
Drupal.tableDrag.prototype.onDrag = function () {
return null;
};
/**
* Stub function. Allows a custom handler when a row is dropped.
*/
Drupal.tableDrag.prototype.onDrop = function () {
return null;
};
/**
* Constructor to make a new object to manipulate a table row.
*
* @param tableRow
* The DOM element for the table row we will be manipulating.
* @param method
* The method in which this row is being moved. Either 'keyboard' or 'mouse'.
* @param indentEnabled
* Whether the containing table uses indentations. Used for optimizations.
* @param maxDepth
* The maximum amount of indentations this row may contain.
* @param addClasses
* Whether we want to add classes to this row to indicate child relationships.
*/
Drupal.tableDrag.prototype.row = function (tableRow, method, indentEnabled, maxDepth, addClasses) {
this.element = tableRow;
this.method = method;
this.group = [tableRow];
this.groupDepth = $('.indentation', tableRow).length;
this.changed = false;
this.table = $(tableRow).closest('table').get(0);
this.indentEnabled = indentEnabled;
this.maxDepth = maxDepth;
this.direction = ''; // Direction the row is being moved.
if (this.indentEnabled) {
this.indents = $('.indentation', tableRow).length;
this.children = this.findChildren(addClasses);
this.group = $.merge(this.group, this.children);
// Find the depth of this entire group.
for (var n = 0; n < this.group.length; n++) {
this.groupDepth = Math.max($('.indentation', this.group[n]).length, this.groupDepth);
}
}
};
/**
* Find all children of rowObject by indentation.
*
* @param addClasses
* Whether we want to add classes to this row to indicate child relationships.
*/
Drupal.tableDrag.prototype.row.prototype.findChildren = function (addClasses) {
var parentIndentation = this.indents;
var currentRow = $(this.element, this.table).next('tr.draggable');
var rows = [];
var child = 0;
while (currentRow.length) {
var rowIndentation = $('.indentation', currentRow).length;
// A greater indentation indicates this is a child.
if (rowIndentation > parentIndentation) {
child++;
rows.push(currentRow[0]);
if (addClasses) {
$('.indentation', currentRow).each(function (indentNum) {
if (child == 1 && (indentNum == parentIndentation)) {
$(this).addClass('tree-child-first');
}
if (indentNum == parentIndentation) {
$(this).addClass('tree-child');
}
else if (indentNum > parentIndentation) {
$(this).addClass('tree-child-horizontal');
}
});
}
}
else {
break;
}
currentRow = currentRow.next('tr.draggable');
}
if (addClasses && rows.length) {
$('.indentation:nth-child(' + (parentIndentation + 1) + ')', rows[rows.length - 1]).addClass('tree-child-last');
}
return rows;
};
/**
* Ensure that two rows are allowed to be swapped.
*
* @param row
* DOM object for the row being considered for swapping.
*/
Drupal.tableDrag.prototype.row.prototype.isValidSwap = function (row) {
if (this.indentEnabled) {
var prevRow, nextRow;
if (this.direction == 'down') {
prevRow = row;
nextRow = $(row).next('tr').get(0);
}
else {
prevRow = $(row).prev('tr').get(0);
nextRow = row;
}
this.interval = this.validIndentInterval(prevRow, nextRow);
// We have an invalid swap if the valid indentations interval is empty.
if (this.interval.min > this.interval.max) {
return false;
}
}
// Do not let an un-draggable first row have anything put before it.
if (this.table.tBodies[0].rows[0] == row && $(row).is(':not(.draggable)')) {
return false;
}
return true;
};
/**
* Perform the swap between two rows.
*
* @param position
* Whether the swap will occur 'before' or 'after' the given row.
* @param row
* DOM element what will be swapped with the row group.
*/
Drupal.tableDrag.prototype.row.prototype.swap = function (position, row) {
Drupal.detachBehaviors(this.group, Drupal.settings, 'move');
$(row)[position](this.group);
Drupal.attachBehaviors(this.group, Drupal.settings);
this.changed = true;
this.onSwap(row);
};
/**
* Determine the valid indentations interval for the row at a given position
* in the table.
*
* @param prevRow
* DOM object for the row before the tested position
* (or null for first position in the table).
* @param nextRow
* DOM object for the row after the tested position
* (or null for last position in the table).
*/
Drupal.tableDrag.prototype.row.prototype.validIndentInterval = function (prevRow, nextRow) {
var minIndent, maxIndent;
// Minimum indentation:
// Do not orphan the next row.
minIndent = nextRow ? $('.indentation', nextRow).length : 0;
// Maximum indentation:
if (!prevRow || $(prevRow).is(':not(.draggable)') || $(this.element).is('.tabledrag-root')) {
// Do not indent:
// - the first row in the table,
// - rows dragged below a non-draggable row,
// - 'root' rows.
maxIndent = 0;
}
else {
// Do not go deeper than as a child of the previous row.
maxIndent = $('.indentation', prevRow).length + ($(prevRow).is('.tabledrag-leaf') ? 0 : 1);
// Limit by the maximum allowed depth for the table.
if (this.maxDepth) {
maxIndent = Math.min(maxIndent, this.maxDepth - (this.groupDepth - this.indents));
}
}
return { 'min': minIndent, 'max': maxIndent };
};
/**
* Indent a row within the legal bounds of the table.
*
* @param indentDiff
* The number of additional indentations proposed for the row (can be
* positive or negative). This number will be adjusted to nearest valid
* indentation level for the row.
*/
Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) {
// Determine the valid indentations interval if not available yet.
if (!this.interval) {
var prevRow = $(this.element).prev('tr').get(0);
var nextRow = $(this.group).filter(':last').next('tr').get(0);
this.interval = this.validIndentInterval(prevRow, nextRow);
}
// Adjust to the nearest valid indentation.
var indent = this.indents + indentDiff;
indent = Math.max(indent, this.interval.min);
indent = Math.min(indent, this.interval.max);
indentDiff = indent - this.indents;
for (var n = 1; n <= Math.abs(indentDiff); n++) {
// Add or remove indentations.
if (indentDiff < 0) {
$('.indentation:first', this.group).remove();
this.indents--;
}
else {
$('td:first', this.group).prepend(Drupal.theme('tableDragIndentation'));
this.indents++;
}
}
if (indentDiff) {
// Update indentation for this row.
this.changed = true;
this.groupDepth += indentDiff;
this.onIndent();
}
return indentDiff;
};
/**
* Find all siblings for a row, either according to its subgroup or indentation.
* Note that the passed-in row is included in the list of siblings.
*
* @param settings
* The field settings we're using to identify what constitutes a sibling.
*/
Drupal.tableDrag.prototype.row.prototype.findSiblings = function (rowSettings) {
var siblings = [];
var directions = ['prev', 'next'];
var rowIndentation = this.indents;
for (var d = 0; d < directions.length; d++) {
var checkRow = $(this.element)[directions[d]]();
while (checkRow.length) {
// Check that the sibling contains a similar target field.
if ($('.' + rowSettings.target, checkRow)) {
// Either add immediately if this is a flat table, or check to ensure
// that this row has the same level of indentation.
if (this.indentEnabled) {
var checkRowIndentation = $('.indentation', checkRow).length;
}
if (!(this.indentEnabled) || (checkRowIndentation == rowIndentation)) {
siblings.push(checkRow[0]);
}
else if (checkRowIndentation < rowIndentation) {
// No need to keep looking for siblings when we get to a parent.
break;
}
}
else {
break;
}
checkRow = $(checkRow)[directions[d]]();
}
// Since siblings are added in reverse order for previous, reverse the
// completed list of previous siblings. Add the current row and continue.
if (directions[d] == 'prev') {
siblings.reverse();
siblings.push(this.element);
}
}
return siblings;
};
/**
* Remove indentation helper classes from the current row group.
*/
Drupal.tableDrag.prototype.row.prototype.removeIndentClasses = function () {
for (var n in this.children) {
$('.indentation', this.children[n])
.removeClass('tree-child')
.removeClass('tree-child-first')
.removeClass('tree-child-last')
.removeClass('tree-child-horizontal');
}
};
/**
* Add an asterisk or other marker to the changed row.
*/
Drupal.tableDrag.prototype.row.prototype.markChanged = function () {
var marker = Drupal.theme('tableDragChangedMarker');
var cell = $('td:first', this.element);
if ($('span.tabledrag-changed', cell).length == 0) {
cell.append(marker);
}
};
/**
* Stub function. Allows a custom handler when a row is indented.
*/
Drupal.tableDrag.prototype.row.prototype.onIndent = function () {
return null;
};
/**
* Stub function. Allows a custom handler when a row is swapped.
*/
Drupal.tableDrag.prototype.row.prototype.onSwap = function (swappedRow) {
return null;
};
Drupal.theme.prototype.tableDragChangedMarker = function () {
return '<span class="warning tabledrag-changed">*</span>';
};
Drupal.theme.prototype.tableDragIndentation = function () {
return '<div class="indentation"> </div>';
};
Drupal.theme.prototype.tableDragChangedWarning = function () {
return '<div class="tabledrag-changed-warning messages warning">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t('Changes made in this table will not be saved until the form is submitted.') + '</div>';
};
})(jQuery);
|
ajax/libs/graphiql/0.6.3/graphiql.min.js | emmy41124/cdnjs | !function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.GraphiQL=f()}}(function(){var define;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function renderType(e,t){return e instanceof _graphql.GraphQLNonNull?_react2.default.createElement("span",null,renderType(e.ofType,t),"!"):e instanceof _graphql.GraphQLList?_react2.default.createElement("span",null,"[",renderType(e.ofType,t),"]"):_react2.default.createElement("a",{className:"type-name",onClick:function(a){return t(e,a)}},e.name)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DocExplorer=void 0;var _createClass=function(){function e(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,a,r){return a&&e(t.prototype,a),r&&e(t,r),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_marked=require("marked"),_marked2=_interopRequireDefault(_marked),_graphql=require("graphql"),DocExplorer=exports.DocExplorer=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this));return e.handleNavBackClick=function(){e.setState({navStack:e.state.navStack.slice(0,-1)})},e.handleClickTypeOrField=function(t){e.showDoc(t)},e.handleSearch=function(t){e.showSearch({name:"Search Results",searchValue:t.target.value})},e.state={navStack:[]},e}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack||this.state.searchValue!==t.searchValue}},{key:"render",value:function(){var e=this.props.schema,t=this.state.navStack,a=void 0;t.length>0&&(a=t[t.length-1]);var r=void 0,c=void 0;a?"Search Results"===a.name?(r=a.name,c=_react2.default.createElement(SearchDoc,{searchValue:a.searchValue,schema:e,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField})):(r=a.name,c=(0,_graphql.isType)(a)?_react2.default.createElement(TypeDoc,{key:a.name,type:a,onClickType:this.handleClickTypeOrField,onClickField:this.handleClickTypeOrField}):_react2.default.createElement(FieldDoc,{key:a.name,field:a,onClickType:this.handleClickTypeOrField})):e&&(r="Documentation Explorer",c=_react2.default.createElement(SchemaDoc,{schema:e,onClickType:this.handleClickTypeOrField,onSearch:this.handleSearch}));var n=void 0;1===t.length?n="Schema":t.length>1&&(n=t[t.length-2].name);var l=_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})),s=c&&(c.type===SearchDoc||c.type===SchemaDoc);return _react2.default.createElement("div",{className:"doc-explorer"},_react2.default.createElement("div",{className:"doc-explorer-title-bar"},n&&_react2.default.createElement("div",{className:"doc-explorer-back",onClick:this.handleNavBackClick},n),_react2.default.createElement("div",{className:"doc-explorer-title"},r),_react2.default.createElement("div",{className:"doc-explorer-rhs"},this.props.children)),_react2.default.createElement("div",{className:"doc-explorer-contents"},_react2.default.createElement(SearchBox,{isShown:s,onSearch:this.handleSearch,searchValue:a?a.searchValue:""}),this.props.schema?c:l))}},{key:"showDoc",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1]===e;a||(t=t.concat([e])),this.setState({navStack:t})}},{key:"showSearch",value:function(e){var t=this.state.navStack,a=t.length>0&&t[t.length-1];a?a.searchValue!==e.searchValue&&(t=t.slice(0,-1).concat([e])):t=t.concat([e]),this.setState({navStack:t})}}]),t}(_react2.default.Component);DocExplorer.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema)};var SearchBox=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return e.isShown!==this.props.isShown||e.searchValue!==this.props.searchValue}},{key:"render",value:function(){var e=this;return _react2.default.createElement("div",null,this.props.isShown&&_react2.default.createElement("label",{className:"search-box-outer"},_react2.default.createElement("input",{className:"search-box-input",onChange:function(t){return e.props.onSearch(t)},type:"text",value:this.props.searchValue,placeholder:"Search the schema ..."})))}}]),t}(_react2.default.Component);SearchBox.propTypes={isShown:_react.PropTypes.bool,searchValue:_react.PropTypes.string,onSearch:_react.PropTypes.func};var SearchDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema||this.props.searchValue!==e.searchValue}},{key:"render",value:function(){var e=this,t=this.props.searchValue,a=this.props.schema,r=this.props.onClickType,c=this.props.onClickField,n=a.getTypeMap(),l=[],s=[];return Object.keys(n).forEach(function(a){var o=n[a],i=[];e._isMatch(a,t)&&i.push("Type Name"),i.length&&l.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:o,onClick:r}))),o.getFields&&!function(){var a=o.getFields();Object.keys(a).forEach(function(n){var l=a[n];if(e._isMatch(n,t))s.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,o,e)}},l.name)," on ",_react2.default.createElement(TypeLink,{type:o,onClick:r})));else if(l.args&&l.args.length){var i=l.args.filter(function(a){return e._isMatch(a.name,t)});i.length>0&&s.push(_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(e){return c(l,o,e)}},l.name),"(",_react2.default.createElement("span",null,i.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:r}))})),")"," on ",_react2.default.createElement(TypeLink,{type:o,onClick:r})))}})}()}),0===l.length&&0===s.length?_react2.default.createElement("span",{className:"doc-alert-text"},"No results found."):_react2.default.createElement("div",null,_react2.default.createElement("div",{className:"doc-category"},(l.length>0||s.length>0)&&_react2.default.createElement("div",{className:"doc-category-title"},"search results"),l,s))}},{key:"_isMatch",value:function(e,t){try{var a=t.replace(/[^_0-9A-Za-z]/g,function(e){return"\\"+e});return-1!==e.search(new RegExp(a,"i"))}catch(r){return-1!==e.toLowerCase().indexOf(t.toLowerCase())}}}]),t}(_react2.default.Component);SearchDoc.propTypes={schema:_react.PropTypes.object,searchValue:_react.PropTypes.string,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var SchemaDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.schema!==e.schema}},{key:"render",value:function(){var e=this.props.schema,t=e.getQueryType(),a=e.getMutationType&&e.getMutationType(),r=e.getSubscriptionType&&e.getSubscriptionType();return _react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:"A GraphQL schema provides a root type for each kind of operation."}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"root types"),_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"query"),": ",_react2.default.createElement(TypeLink,{type:t,onClick:this.props.onClickType})),a&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"mutation"),": ",_react2.default.createElement(TypeLink,{type:a,onClick:this.props.onClickType})),r&&_react2.default.createElement("div",{className:"doc-category-item"},_react2.default.createElement("span",{className:"keyword"},"subscription"),": ",_react2.default.createElement(TypeLink,{type:r,onClick:this.props.onClickType}))))}}]),t}(_react2.default.Component);SchemaDoc.propTypes={schema:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){var e=this.props.type,t=this.props.onClickType,a=this.props.onClickField,r=void 0,c=void 0;e instanceof _graphql.GraphQLUnionType?(r="possible types",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLInterfaceType?(r="implementations",c=e.getPossibleTypes()):e instanceof _graphql.GraphQLObjectType&&(r="implements",c=e.getInterfaces());var n=void 0;c&&c.length>0&&(n=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},r),c.map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement(TypeLink,{type:e,onClick:t}))})));var l=void 0;e.getFields&&!function(){var r=e.getFields(),c=Object.keys(r).map(function(e){return r[e]});l=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"fields"),c.map(function(r){var c=void 0;return r.args&&r.args.length>0&&(c=r.args.map(function(e){return _react2.default.createElement("span",{className:"arg",key:e.name},_react2.default.createElement("span",{className:"arg-name"},e.name),": ",_react2.default.createElement(TypeLink,{type:e.type,onClick:t}))})),_react2.default.createElement("div",{key:r.name,className:"doc-category-item"},_react2.default.createElement("a",{className:"field-name",onClick:function(t){return a(r,e,t)}},r.name),c&&["(",_react2.default.createElement("span",{key:"args"},c),")"],": ",_react2.default.createElement(TypeLink,{type:r.type,onClick:t}))}))}();var s=void 0;return e instanceof _graphql.GraphQLEnumType&&(s=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"values"),e.getValues().map(function(e){return _react2.default.createElement("div",{key:e.name,className:"doc-category-item"},_react2.default.createElement("div",{className:"enum-value"},e.name),_react2.default.createElement(Description,{className:"doc-value-description",markdown:e.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:e.description||"No Description"}),e instanceof _graphql.GraphQLObjectType&&n,l,s,!(e instanceof _graphql.GraphQLObjectType)&&n)}}]),t}(_react2.default.Component);TypeDoc.propTypes={type:_react.PropTypes.object,onClickType:_react.PropTypes.func,onClickField:_react.PropTypes.func};var FieldDoc=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.field!==e.field}},{key:"render",value:function(){var e=this,t=this.props.field,a=void 0;return t.args&&t.args.length>0&&(a=_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"arguments"),t.args.map(function(t){return _react2.default.createElement("div",{key:t.name,className:"doc-category-item"},_react2.default.createElement("div",null,_react2.default.createElement("span",{className:"arg-name"},t.name),": ",_react2.default.createElement(TypeLink,{type:t.type,onClick:e.props.onClickType})),_react2.default.createElement(Description,{className:"doc-value-description",markdown:t.description}))}))),_react2.default.createElement("div",null,_react2.default.createElement(Description,{className:"doc-type-description",markdown:t.description||"No Description"}),_react2.default.createElement("div",{className:"doc-category"},_react2.default.createElement("div",{className:"doc-category-title"},"type"),_react2.default.createElement(TypeLink,{type:t.type,onClick:this.props.onClickType})),a)}}]),t}(_react2.default.Component);FieldDoc.propTypes={field:_react.PropTypes.object,onClickType:_react.PropTypes.func};var TypeLink=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.type!==e.type}},{key:"render",value:function(){return renderType(this.props.type,this.props.onClick)}}]),t}(_react2.default.Component);TypeLink.propTypes={type:_react.PropTypes.object,onClick:_react.PropTypes.func};var Description=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"shouldComponentUpdate",value:function(e){return this.props.markdown!==e.markdown}},{key:"render",value:function(){var e=this.props.markdown;if(!e)return _react2.default.createElement("div",null);var t=(0,_marked2.default)(e,{sanitize:!0});return _react2.default.createElement("div",{className:this.props.className,dangerouslySetInnerHTML:{__html:t}})}}]),t}(_react2.default.Component);Description.propTypes={markdown:_react.PropTypes.string,className:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{graphql:152,marked:214}],2:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExecuteButton=void 0;var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),ExecuteButton=exports.ExecuteButton=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e));return n._onClick=function(){n.props.isRunning?n.props.onStop():n.props.onRun()},n._onOptionSelected=function(e){n.setState({optionsOpen:!1}),n.props.onRun(e.name&&e.name.value)},n._onOptionsOpen=function(e){var t=!0,o=e.target;n.setState({highlight:null,optionsOpen:!0});var r=function(e){t&&e.target===o?t=!1:(document.removeEventListener("mouseup",r),r=null,n.setState({optionsOpen:!1}))};document.addEventListener("mouseup",r)},n.state={optionsOpen:!1,highlight:null},n}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this,t=this.props.operations,n=this.state.optionsOpen,o=t&&t.length>1,r=null;o&&n&&!function(){var n=e.state.highlight;r=_react2.default.createElement("ul",{className:"execute-options"},t.map(function(t){return _react2.default.createElement("li",{key:t.name?t.name.value:"*",className:t===n&&"selected",onMouseOver:function(){return e.setState({highlight:t})},onMouseOut:function(){return e.setState({highlight:null})},onMouseUp:function(){return e._onOptionSelected(t)}},t.name?t.name.value:"<Unnamed>")}))}();var u=void 0;!this.props.isRunning&&o||(u=this._onClick);var a=void 0;return this.props.isRunning||!o||n||(a=this._onOptionsOpen),_react2.default.createElement("div",{className:"execute-button-wrap"},_react2.default.createElement("button",{className:"execute-button",onMouseDown:a,onClick:u,title:"Execute Query (Ctrl-Enter)"},_react2.default.createElement("svg",{width:"34",height:"34"},this.props.isRunning?_react2.default.createElement("path",{d:"M 10 10 L 23 10 L 23 23 L 10 23 z"}):_react2.default.createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"}))),r)}}]),t}(_react2.default.Component);ExecuteButton.propTypes={onRun:_react.PropTypes.func,onStop:_react.PropTypes.func,isRunning:_react.PropTypes.bool,operations:_react.PropTypes.array}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function isPromise(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.then}function isObservable(e){return"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"function"==typeof e.subscribe}Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphiQL=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_graphql=require("graphql"),_ExecuteButton=require("./ExecuteButton"),_ToolbarButton=require("./ToolbarButton"),_QueryEditor=require("./QueryEditor"),_VariableEditor=require("./VariableEditor"),_ResultViewer=require("./ResultViewer"),_DocExplorer=require("./DocExplorer"),_CodeMirrorSizer=require("../utility/CodeMirrorSizer"),_CodeMirrorSizer2=_interopRequireDefault(_CodeMirrorSizer),_getQueryFacts=require("../utility/getQueryFacts"),_getQueryFacts2=_interopRequireDefault(_getQueryFacts),_getSelectedOperationName=require("../utility/getSelectedOperationName"),_getSelectedOperationName2=_interopRequireDefault(_getSelectedOperationName),_debounce=require("../utility/debounce"),_debounce2=_interopRequireDefault(_debounce),_find=require("../utility/find"),_find2=_interopRequireDefault(_find),_fillLeafs2=require("../utility/fillLeafs"),_elementPosition=require("../utility/elementPosition"),_introspectionQueries=require("../utility/introspectionQueries"),GraphiQL=exports.GraphiQL=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e));if(_initialiseProps.call(r),"function"!=typeof e.fetcher)throw new TypeError("GraphiQL requires a fetcher function.");r._storage=e.storage||window.localStorage;var n=void 0!==e.query?e.query:void 0!==r._storageGet("query")?r._storageGet("query"):void 0!==e.defaultQuery?e.defaultQuery:defaultQuery,o=(0,_getQueryFacts2.default)(e.schema,n),i=void 0!==e.variables?e.variables:r._storageGet("variables"),a=void 0!==e.operationName?e.operationName:(0,_getSelectedOperationName2.default)(null,r._storageGet("operationName"),o&&o.operations);return r.state=_extends({schema:e.schema,query:n,variables:i,operationName:a,response:e.response,editorFlex:Number(r._storageGet("editorFlex"))||1,variableEditorOpen:Boolean(i),variableEditorHeight:Number(r._storageGet("variableEditorHeight"))||200,docExplorerOpen:!1,docExplorerWidth:Number(r._storageGet("docExplorerWidth"))||350,isWaitingForResponse:!1,subscription:null},o),r._editorQueryID=0,"object"===("undefined"==typeof window?"undefined":_typeof(window))&&window.addEventListener("beforeunload",function(){return r.componentWillUnmount()}),r}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){this._ensureOfSchema(),this.codeMirrorSizer=new _CodeMirrorSizer2.default,document.addEventListener("keydown",this._keyHandler,!0)}},{key:"componentWillReceiveProps",value:function(e){var t=this.state.schema,r=this.state.query,n=this.state.variables,o=this.state.operationName,i=this.state.response;void 0!==e.schema&&(t=e.schema),void 0!==e.query&&(r=e.query),void 0!==e.variables&&(n=e.variables),void 0!==e.operationName&&(o=e.operationName),void 0!==e.response&&(i=e.response),t===this.state.schema&&r===this.state.query&&o===this.state.operationName||this._updateQueryFacts(),this.setState({schema:t,query:r,variables:n,operationName:o,response:i})}},{key:"componentDidUpdate",value:function(){this.codeMirrorSizer.updateSizes([this.queryEditorComponent,this.variableEditorComponent,this.resultComponent])}},{key:"componentWillUnmount",value:function(){this._storageSet("query",this.state.query),this._storageSet("variables",this.state.variables),this._storageSet("operationName",this.state.operationName),this._storageSet("editorFlex",this.state.editorFlex),this._storageSet("variableEditorHeight",this.state.variableEditorHeight),this._storageSet("docExplorerWidth",this.state.docExplorerWidth),document.removeEventListener("keydown",this._keyHandler,!0)}},{key:"render",value:function(){var e=this,r=_react2.default.Children.toArray(this.props.children),n=(0,_find2.default)(r,function(e){return e.type===t.Logo})||_react2.default.createElement(t.Logo,null),o=(0,_find2.default)(r,function(e){return e.type===t.Toolbar})||_react2.default.createElement(t.Toolbar,null),i=(0,_find2.default)(r,function(e){return e.type===t.Footer}),a={WebkitFlex:this.state.editorFlex,flex:this.state.editorFlex},s={display:this.state.docExplorerOpen?"block":"none",width:this.state.docExplorerWidth},u=this.state.variableEditorOpen,l={height:u?this.state.variableEditorHeight:null};return _react2.default.createElement("div",{id:"graphiql-container"},_react2.default.createElement("div",{className:"editorWrap"},_react2.default.createElement("div",{className:"topBarWrap"},_react2.default.createElement("div",{className:"topBar"},n,_react2.default.createElement(_ExecuteButton.ExecuteButton,{isRunning:Boolean(this.state.subscription),onRun:this.handleRunQuery,onStop:this.handleStopQuery,operations:this.state.operations}),_react2.default.createElement(t.ToolbarButton,{onClick:this.handlePrettifyQuery,title:"Prettify Query",label:"Prettify"}),o),!this.state.docExplorerOpen&&_react2.default.createElement("button",{className:"docExplorerShow",onClick:this.handleToggleDocs},"Docs")),_react2.default.createElement("div",{ref:function(t){e.editorBarComponent=t},className:"editorBar",onMouseDown:this.handleResizeStart},_react2.default.createElement("div",{className:"queryWrap",style:a},_react2.default.createElement(_QueryEditor.QueryEditor,{ref:function(t){e.queryEditorComponent=t},schema:this.state.schema,value:this.state.query,onEdit:this.handleEditQuery,onHintInformationRender:this.handleHintInformationRender}),_react2.default.createElement("div",{className:"variable-editor",style:l},_react2.default.createElement("div",{className:"variable-editor-title",style:{cursor:u?"row-resize":"n-resize"},onMouseDown:this.handleVariableResizeStart},"Query Variables"),_react2.default.createElement(_VariableEditor.VariableEditor,{ref:function(t){e.variableEditorComponent=t},value:this.state.variables,variableToType:this.state.variableToType,onEdit:this.handleEditVariables,onHintInformationRender:this.handleHintInformationRender}))),_react2.default.createElement("div",{className:"resultWrap"},this.state.isWaitingForResponse&&_react2.default.createElement("div",{className:"spinner-container"},_react2.default.createElement("div",{className:"spinner"})),_react2.default.createElement(_ResultViewer.ResultViewer,{ref:function(t){e.resultComponent=t},value:this.state.response}),i))),_react2.default.createElement("div",{className:"docExplorerWrap",style:s},_react2.default.createElement("div",{className:"docExplorerResizer",onMouseDown:this.handleDocsResizeStart}),_react2.default.createElement(_DocExplorer.DocExplorer,{ref:function(t){e.docExplorerComponent=t},schema:this.state.schema},_react2.default.createElement("div",{className:"docExplorerHide",onClick:this.handleToggleDocs},"✕"))))}},{key:"autoCompleteLeafs",value:function(){var e=this,t=(0,_fillLeafs2.fillLeafs)(this.state.schema,this.state.query,this.props.getDefaultFieldNames),r=t.insertions,n=t.result;return r&&r.length>0&&!function(){var t=e.queryEditorComponent.getCodeMirror();t.operation(function(){var e=t.getCursor(),o=t.indexFromPos(e);t.setValue(n);var i=0,a=r.map(function(e){var r=e.index,n=e.string;return t.markText(t.posFromIndex(r+i),t.posFromIndex(r+(i+=n.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})});setTimeout(function(){return a.forEach(function(e){return e.clear()})},7e3);var s=o;r.forEach(function(e){var t=e.index,r=e.string;o>t&&(s+=r.length)}),t.setCursor(t.posFromIndex(s))})}(),n}},{key:"_ensureOfSchema",value:function(){var e=this;if(void 0===this.state.schema){var t=this.props.fetcher,r=t({query:_introspectionQueries.introspectionQuery});return isPromise(r)?void r.then(function(e){if(e.data)return e;var n=t({query:_introspectionQueries.introspectionQuerySansSubscriptions});if(!isPromise(r))throw new Error("Fetcher did not return a Promise for introspection.");return n}).then(function(t){if(void 0===e.state.schema)if(t&&t.data){var r=(0,_graphql.buildClientSchema)(t.data),n=(0,_getQueryFacts2.default)(r,e.state.query);e.setState(_extends({schema:r},n))}else{var o="string"==typeof t?t:JSON.stringify(t,null,2);e.setState({response:o})}}).catch(function(t){e.setState({response:t&&(t.stack||String(t))})}):void this.setState({response:"Fetcher did not return a Promise for introspection."})}}},{key:"_storageGet",value:function(e){return this._storage&&this._storage.getItem("graphiql:"+e)}},{key:"_storageSet",value:function(e,t){this._storage&&this._storage.setItem("graphiql:"+e,t)}},{key:"_fetchQuery",value:function(e,t,r,n){var o=this,i=this.props.fetcher,a=i({query:e,variables:t,operationName:r});if(isPromise(a))a.then(n).catch(function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e))})});else{if(isObservable(a)){var s=a.subscribe({next:n,error:function(e){o.setState({isWaitingForResponse:!1,response:e&&(e.stack||String(e)),subscription:null})},complete:function(){o.setState({isWaitingForResponse:!1,subscription:null})}});return s}this.setState({isWaitingForResponse:!1,response:"Fetcher did not return Promise or Observable."})}}},{key:"_runQueryAtCursor",value:function(){if(this.state.subscription)return void this.handleStopQuery();var e=void 0,t=this.state.operations;if(t){var r=this.queryEditorComponent.getCodeMirror();if(r.hasFocus())for(var n=r.getCursor(),o=r.indexFromPos(n),i=0;i<t.length;i++){var a=t[i];if(a.loc.start<=o&&a.loc.end>=o){e=a.name&&a.name.value;break}}}this.handleRunQuery(e)}},{key:"_didClickDragBar",value:function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var r=_reactDom2.default.findDOMNode(this.resultComponent);t;){if(t===r)return!0;t=t.parentNode}return!1}}]),t}(_react2.default.Component);GraphiQL.propTypes={fetcher:_react.PropTypes.func.isRequired,schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),query:_react.PropTypes.string,variables:_react.PropTypes.string,operationName:_react.PropTypes.string,response:_react.PropTypes.string,storage:_react.PropTypes.shape({getItem:_react.PropTypes.func,setItem:_react.PropTypes.func}),defaultQuery:_react.PropTypes.string,onEditQuery:_react.PropTypes.func,onEditVariables:_react.PropTypes.func,onEditOperationName:_react.PropTypes.func,getDefaultFieldNames:_react.PropTypes.func};var _initialiseProps=function(){var e=this;this.handleRunQuery=function(t){e._editorQueryID++;var r=e._editorQueryID,n=e.autoCompleteLeafs()||e.state.query,o=e.state.variables,i=e.state.operationName;if(t&&t!==i){i=t;var a=e.props.onEditOperationName;a&&a(i)}var s=e._fetchQuery(n,o,i,function(t){r===e._editorQueryID&&e.setState({isWaitingForResponse:!1,response:JSON.stringify(t,null,2)})});e.setState({isWaitingForResponse:!0,response:null,subscription:s,operationName:i})},this.handleStopQuery=function(){var t=e.state.subscription;e.setState({isWaitingForResponse:!1,subscription:null}),t&&t.unsubscribe()},this._keyHandler=function(t){(t.metaKey||t.ctrlKey)&&13===t.keyCode&&(t.preventDefault(),e._runQueryAtCursor())},this.handlePrettifyQuery=function(){var t=(0,_graphql.print)((0,_graphql.parse)(e.state.query)),r=e.queryEditorComponent.getCodeMirror();r.setValue(t)},this.handleEditQuery=function(t){return e.state.schema&&e._updateQueryFacts(t),e.setState({query:t}),e.props.onEditQuery?e.props.onEditQuery(t):void 0},this._updateQueryFacts=(0,_debounce2.default)(150,function(t){var r=(0,_getQueryFacts2.default)(e.state.schema,t);
if(r){var n=(0,_getSelectedOperationName2.default)(e.state.operations,e.state.operationName,r.operations),o=e.props.onEditOperationName;o&&n!==e.state.operationName&&o(n),e.setState(_extends({operationName:n},r))}}),this.handleEditVariables=function(t){e.setState({variables:t}),e.props.onEditVariables&&e.props.onEditVariables(t)},this.handleHintInformationRender=function(t){t.addEventListener("click",e._onClickHintInformation);var r=void 0;t.addEventListener("DOMNodeRemoved",r=function(){t.removeEventListener("DOMNodeRemoved",r),t.removeEventListener("click",e._onClickHintInformation)})},this._onClickHintInformation=function(t){if("typeName"===t.target.className){var r=t.target.innerHTML,n=e.state.schema;n&&!function(){var t=n.getType(r);t&&e.setState({docExplorerOpen:!0},function(){e.docExplorerComponent.showDoc(t)})}()}},this.handleToggleDocs=function(){e.setState({docExplorerOpen:!e.state.docExplorerOpen})},this.handleResizeStart=function(t){if(e._didClickDragBar(t)){t.preventDefault();var r=t.clientX-(0,_elementPosition.getLeft)(t.target),n=function(t){if(0===t.buttons)return o();var n=_reactDom2.default.findDOMNode(e.editorBarComponent),i=t.clientX-(0,_elementPosition.getLeft)(n)-r,a=n.clientWidth-i;e.setState({editorFlex:i/a})},o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o),n=null,o=null});document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}},this.handleDocsResizeStart=function(t){t.preventDefault();var r=e.state.docExplorerWidth,n=t.clientX-(0,_elementPosition.getLeft)(t.target),o=function(t){if(0===t.buttons)return i();var r=_reactDom2.default.findDOMNode(e),o=t.clientX-(0,_elementPosition.getLeft)(r)-n,a=r.clientWidth-o;100>a?e.setState({docExplorerOpen:!1}):e.setState({docExplorerOpen:!0,docExplorerWidth:Math.min(a,650)})},i=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.state.docExplorerOpen||e.setState({docExplorerWidth:r}),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),o=null,i=null});document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)},this.handleVariableResizeStart=function(t){t.preventDefault();var r=!1,n=e.state.variableEditorOpen,o=e.state.variableEditorHeight,i=t.clientY-(0,_elementPosition.getTop)(t.target),a=function(t){if(0===t.buttons)return s();r=!0;var n=_reactDom2.default.findDOMNode(e.editorBarComponent),a=t.clientY-(0,_elementPosition.getTop)(n)-i,u=n.clientHeight-a;60>u?e.setState({variableEditorOpen:!1,variableEditorHeight:o}):e.setState({variableEditorOpen:!0,variableEditorHeight:u})},s=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){r||e.setState({variableEditorOpen:!n}),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),a=null,s=null});document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}};GraphiQL.Logo=function(e){return _react2.default.createElement("div",{className:"title"},e.children||_react2.default.createElement("span",null,"Graph",_react2.default.createElement("em",null,"i"),"QL"))},GraphiQL.Toolbar=function(e){return _react2.default.createElement("div",{className:"toolbar"},e.children)},GraphiQL.ToolbarButton=_ToolbarButton.ToolbarButton,GraphiQL.Footer=function(e){return _react2.default.createElement("div",{className:"footer"},e.children)};var defaultQuery="# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser IDE for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will\n# see intelligent typeaheads aware of the current GraphQL type schema and\n# live syntax and validation errors highlighted within the text.\n#\n# To bring up the auto-complete at any point, just press Ctrl-Space.\n#\n# Press the run button above, or Cmd-Enter to execute the query, and the result\n# will appear in the pane to the right.\n\n"}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/CodeMirrorSizer":9,"../utility/debounce":10,"../utility/elementPosition":11,"../utility/fillLeafs":12,"../utility/find":13,"../utility/getQueryFacts":14,"../utility/getSelectedOperationName":15,"../utility/introspectionQueries":16,"./DocExplorer":1,"./ExecuteButton":2,"./QueryEditor":4,"./ResultViewer":5,"./ToolbarButton":6,"./VariableEditor":7,graphql:152}],4:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueryEditor=void 0;var _createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql");require("codemirror/addon/hint/show-hint"),require("codemirror/addon/comment/comment"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/hint"),require("codemirror-graphql/lint"),require("codemirror-graphql/mode");var _onHasCompletion=require("../utility/onHasCompletion"),_onHasCompletion2=_interopRequireDefault(_onHasCompletion),QueryEditor=exports.QueryEditor=function(e){function t(e){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this));return o._onKeyUp=function(e,t){var r=t.keyCode;(r>=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&50===r||t.shiftKey&&57===r)&&o.editor.execCommand("autocomplete")},o._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},o._onHasCompletion=function(e,t){(0,_onHasCompletion2.default)(e,t,o.props.onHintInformationRender)},o.cachedValue=e.value||"",o}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){var e=this;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql",theme:"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{schema:this.props.schema},hintOptions:{schema:this.props.schema,closeOnUnfocus:!1,completeSingle:!1},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!0})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!0})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!0})},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)}},{key:"componentDidUpdate",value:function(e){this.ignoreChangeEvent=!0,this.props.schema!==e.schema&&(this.editor.options.lint.schema=this.props.schema,this.editor.options.hintOptions.schema=this.props.schema,_codemirror2.default.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1}},{key:"componentWillUnmount",value:function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null}},{key:"render",value:function(){return _react2.default.createElement("div",{className:"query-editor"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);QueryEditor.propTypes={schema:_react.PropTypes.instanceOf(_graphql.GraphQLSchema),value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:59,"codemirror-graphql/hint":39,"codemirror-graphql/lint":40,"codemirror-graphql/mode":41,"codemirror/addon/comment/comment":49,"codemirror/addon/edit/closebrackets":50,"codemirror/addon/edit/matchbrackets":51,"codemirror/addon/fold/brace-fold":52,"codemirror/addon/fold/foldgutter":54,"codemirror/addon/hint/show-hint":55,"codemirror/addon/lint/lint":56,"codemirror/keymap/sublime":58,graphql:152}],5:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResultViewer=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/fold/brace-fold"),require("codemirror/keymap/sublime"),require("codemirror/mode/javascript/javascript");var ResultViewer=exports.ResultViewer=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){this.viewer=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",readOnly:!0,theme:"graphiql",mode:{name:"javascript",json:!0},keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-foldgutter"],extraKeys:{"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}})}},{key:"shouldComponentUpdate",value:function(e){return this.props.value!==e.value}},{key:"componentDidUpdate",value:function(){this.viewer.setValue(this.props.value||"")}},{key:"componentWillUnmount",value:function(){this.viewer=null}},{key:"render",value:function(){return _react2.default.createElement("div",{className:"result-window"})}},{key:"getCodeMirror",value:function(){return this.viewer}}]),t}(_react2.default.Component);ResultViewer.propTypes={value:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{codemirror:59,"codemirror/addon/fold/brace-fold":52,"codemirror/addon/fold/foldgutter":54,"codemirror/keymap/sublime":58,"codemirror/mode/javascript/javascript":60}],6:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ToolbarButton=void 0;var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,r,o){return r&&e(t.prototype,r),o&&e(t,o),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),ToolbarButton=exports.ToolbarButton=function(e){function t(e){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this,e));return r.handleClick=function(e){e.preventDefault();try{r.props.onClick(),r.setState({error:null})}catch(t){r.setState({error:t})}},r.state={error:null},r}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.state.error;return _react2.default.createElement("a",{className:"toolbar-button"+(e?" error":""),onClick:this.handleClick,title:e?e.message:this.props.title},this.props.label)}}]),t}(_react2.default.Component);ToolbarButton.propTypes={onClick:_react.PropTypes.func,title:_react.PropTypes.string,label:_react.PropTypes.string}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.VariableEditor=void 0;var _createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),_react="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,_react2=_interopRequireDefault(_react),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),_codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);require("codemirror/addon/hint/show-hint"),require("codemirror/addon/edit/matchbrackets"),require("codemirror/addon/edit/closebrackets"),require("codemirror/addon/fold/brace-fold"),require("codemirror/addon/fold/foldgutter"),require("codemirror/addon/lint/lint"),require("codemirror/keymap/sublime"),require("codemirror-graphql/variables/hint"),require("codemirror-graphql/variables/lint"),require("codemirror-graphql/variables/mode");var _onHasCompletion=require("../utility/onHasCompletion"),_onHasCompletion2=_interopRequireDefault(_onHasCompletion),VariableEditor=exports.VariableEditor=function(e){function t(e){_classCallCheck(this,t);var o=_possibleConstructorReturn(this,Object.getPrototypeOf(t).call(this));return o._onKeyUp=function(e,t){var r=t.keyCode;(r>=65&&90>=r||!t.shiftKey&&r>=48&&57>=r||t.shiftKey&&189===r||t.shiftKey&&222===r)&&o.editor.execCommand("autocomplete")},o._onEdit=function(){o.ignoreChangeEvent||(o.cachedValue=o.editor.getValue(),o.props.onEdit&&o.props.onEdit(o.cachedValue))},o._onHasCompletion=function(e,t){(0,_onHasCompletion2.default)(e,t,o.props.onHintInformationRender)},o.cachedValue=e.value||"",o}return _inherits(t,e),_createClass(t,[{key:"componentDidMount",value:function(){var e=this;this.editor=(0,_codemirror2.default)(_reactDom2.default.findDOMNode(this),{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,foldGutter:{minFoldSize:4},lint:{variableToType:this.props.variableToType},hintOptions:{variableToType:this.props.variableToType},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1})},"Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight"}}),this.editor.on("change",this._onEdit),this.editor.on("keyup",this._onKeyUp),this.editor.on("hasCompletion",this._onHasCompletion)}},{key:"componentDidUpdate",value:function(e){this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,_codemirror2.default.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue&&(this.cachedValue=this.props.value,this.editor.setValue(this.props.value)),this.ignoreChangeEvent=!1}},{key:"componentWillUnmount",value:function(){this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null}},{key:"render",value:function(){return _react2.default.createElement("div",{className:"codemirrorWrap"})}},{key:"getCodeMirror",value:function(){return this.editor}}]),t}(_react2.default.Component);VariableEditor.propTypes={variableToType:_react.PropTypes.object,value:_react.PropTypes.string,onEdit:_react.PropTypes.func,onHintInformationRender:_react.PropTypes.func}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utility/onHasCompletion":17,codemirror:59,"codemirror-graphql/variables/hint":46,"codemirror-graphql/variables/lint":47,"codemirror-graphql/variables/mode":48,"codemirror/addon/edit/closebrackets":50,"codemirror/addon/edit/matchbrackets":51,"codemirror/addon/fold/brace-fold":52,"codemirror/addon/fold/foldgutter":54,"codemirror/addon/hint/show-hint":55,"codemirror/addon/lint/lint":56,"codemirror/keymap/sublime":58}],8:[function(require,module,exports){"use strict";module.exports=require("./components/GraphiQL").GraphiQL},{"./components/GraphiQL":3}],9:[function(require,module,exports){(function(global){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_reactDom="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof global?global.ReactDOM:null,_reactDom2=_interopRequireDefault(_reactDom),CodeMirrorSizer=function(){function e(){_classCallCheck(this,e),this.sizes=[]}return _createClass(e,[{key:"updateSizes",value:function(e){var t=this;e.forEach(function(e,r){var n=_reactDom2.default.findDOMNode(e).clientHeight;r<=t.sizes.length&&n!==t.sizes[r]&&e.getCodeMirror().setSize(),t.sizes[r]=n})}}]),e}();exports.default=CodeMirrorSizer}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(require,module,exports){"use strict";function debounce(e,t){var u=void 0;return function(){var o=this,n=arguments;clearTimeout(u),u=setTimeout(function(){u=null,t.apply(o,n)},e)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=debounce},{}],11:[function(require,module,exports){"use strict";function getLeft(e){for(var t=0,f=e;f.offsetParent;)t+=f.offsetLeft,f=f.offsetParent;return t}function getTop(e){for(var t=0,f=e;f.offsetParent;)t+=f.offsetTop,f=f.offsetParent;return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLeft=getLeft,exports.getTop=getTop},{}],12:[function(require,module,exports){"use strict";function fillLeafs(e,t,r){var n=[];if(!e)return{insertions:n,result:t};var i=void 0;try{i=(0,_graphql.parse)(t)}catch(a){return{insertions:n,result:t}}var l=r||defaultGetDefaultFieldNames,s=new _graphql.TypeInfo(e);return(0,_graphql.visit)(i,{leave:function(e){s.leave(e)},enter:function(e){if(s.enter(e),"Field"===e.kind&&!e.selectionSet){var r=s.getType(),i=buildSelectionSet(r,l);if(i){var a=getIndentation(t,e.loc.start);n.push({index:e.loc.end,string:" "+(0,_graphql.print)(i).replace(/\n/g,"\n"+a)})}}}}),{insertions:n,result:withInsertions(t,n)}}function defaultGetDefaultFieldNames(e){if(!e.getFields)return[];var t=e.getFields();if(t.id)return["id"];if(t.edges)return["edges"];if(t.node)return["node"];var r=[];return Object.keys(t).forEach(function(e){(0,_graphql.isLeafType)(t[e].type)&&r.push(e)}),r}function buildSelectionSet(e,t){var r=(0,_graphql.getNamedType)(e);if(e&&!(0,_graphql.isLeafType)(e)){var n=t(r);if(Array.isArray(n)&&0!==n.length)return{kind:"SelectionSet",selections:n.map(function(e){var n=r.getFields()[e],i=n?n.type:null;return{kind:"Field",name:{kind:"Name",value:e},selectionSet:buildSelectionSet(i,t)}})}}}function withInsertions(e,t){if(0===t.length)return e;var r="",n=0;return t.forEach(function(t){var i=t.index,a=t.string;r+=e.slice(n,i)+a,n=i}),r+=e.slice(n)}function getIndentation(e,t){for(var r=t,n=t;r;){var i=e.charCodeAt(r-1);if(10===i||13===i||8232===i||8233===i)break;r--,9!==i&&11!==i&&12!==i&&32!==i&&160!==i&&(n=r)}return e.substring(r,n)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.fillLeafs=fillLeafs;var _graphql=require("graphql")},{graphql:152}],13:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=find},{}],14:[function(require,module,exports){"use strict";function getQueryFacts(e,r){if(r){var a=void 0;try{a=(0,_graphql.parse)(r)}catch(i){return}var t=e?collectVariables(e,a):null,n=[];return a.definitions.forEach(function(e){"OperationDefinition"===e.kind&&n.push(e)}),{variableToType:t,operations:n}}}function collectVariables(e,r){var a=Object.create(null);return r.definitions.forEach(function(r){if("OperationDefinition"===r.kind){var i=r.variableDefinitions;i&&i.forEach(function(r){var i=r.variable,t=r.type,n=(0,_graphql.typeFromAST)(e,t);n&&(a[i.name.value]=n)})}}),a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getQueryFacts,exports.collectVariables=collectVariables;var _graphql=require("graphql")},{graphql:152}],15:[function(require,module,exports){"use strict";function getSelectedOperationName(e,t,n){if(n&&!(n.length<1)){var r=n.map(function(e){return e.name&&e.name.value});if(t&&-1!==r.indexOf(t))return t;if(t&&e){var a=e.map(function(e){return e.name&&e.name.value}),u=a.indexOf(t);if(u&&u<r.length)return r[u]}return r[0]}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getSelectedOperationName},{}],16:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _graphql=require("graphql");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _graphql.introspectionQuery}});exports.introspectionQuerySansSubscriptions="\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n args {\n ...InputValue\n }\n onOperation\n onFragment\n onField\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n"},{graphql:152}],17:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function onHasCompletion(e,r,t){var n=void 0,o=void 0;_codemirror2.default.on(r,"select",function(r,i){n||!function(){var r=i.parentNode,t=r.parentNode;n=document.createElement("div"),t.appendChild(n);var a=r.style.top,d="",p=e.cursorCoords().top;parseInt(a,10)<p&&(a="",d=window.innerHeight-p+3+"px"),n.className="CodeMirror-hints-wrapper",n.style.left=r.style.left,n.style.top=a,n.style.bottom=d,r.style.left="",r.style.top="",o=document.createElement("div"),o.className="CodeMirror-hint-information",d?(n.appendChild(o),n.appendChild(r)):(n.appendChild(r),n.appendChild(o));var l=void 0;n.addEventListener("DOMNodeRemoved",l=function(e){e.target===r&&(n.removeEventListener("DOMNodeRemoved",l),n.parentNode.removeChild(n),n=null,o=null,l=null)})}();var a=r.description?(0,_marked2.default)(r.description,{smartypants:!0}):"Self descriptive.",d=r.type?'<span class="infoType">'+renderType(r.type)+"</span>":"";o.innerHTML='<div class="content">'+("<p>"===a.slice(0,3)?"<p>"+d+a.slice(3):d+a)+"</div>",t&&t(o)})}function renderType(e){return e instanceof _graphql.GraphQLNonNull?renderType(e.ofType)+"!":e instanceof _graphql.GraphQLList?"["+renderType(e.ofType)+"]":'<a class="typeName">'+e.name+"</a>"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=onHasCompletion;var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_marked=require("marked"),_marked2=_interopRequireDefault(_marked)},{codemirror:59,graphql:152,marked:214}],18:[function(require,module,exports){module.exports={default:require("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":61}],19:[function(require,module,exports){module.exports={default:require("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":62}],20:[function(require,module,exports){module.exports={default:require("core-js/library/fn/is-iterable"),__esModule:!0}},{"core-js/library/fn/is-iterable":63}],21:[function(require,module,exports){module.exports={default:require("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":64}],22:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":65}],23:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":66}],24:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":67}],25:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/get-own-property-descriptor"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-descriptor":68}],26:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":69}],27:[function(require,module,exports){module.exports={default:require("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":70}],28:[function(require,module,exports){module.exports={default:require("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":71}],29:[function(require,module,exports){module.exports={default:require("core-js/library/fn/set"),__esModule:!0}},{"core-js/library/fn/set":72}],30:[function(require,module,exports){"use strict";exports.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},exports.__esModule=!0},{}],31:[function(require,module,exports){"use strict";var _Object$defineProperty=require("babel-runtime/core-js/object/define-property").default;exports.default=function(){function e(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),_Object$defineProperty(e,n.key,n)}}return function(r,t,n){return t&&e(r.prototype,t),n&&e(r,n),r}}(),exports.__esModule=!0},{"babel-runtime/core-js/object/define-property":24}],32:[function(require,module,exports){"use strict";var _Object$assign=require("babel-runtime/core-js/object/assign").default;exports.default=_Object$assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},exports.__esModule=!0},{"babel-runtime/core-js/object/assign":22}],33:[function(require,module,exports){"use strict";var _Object$getOwnPropertyDescriptor=require("babel-runtime/core-js/object/get-own-property-descriptor").default;exports.default=function(r,e,t){for(var o=!0;o;){var i=r,u=e,n=t;o=!1,null===i&&(i=Function.prototype);var a=_Object$getOwnPropertyDescriptor(i,u);if(void 0!==a){if("value"in a)return a.value;var c=a.get;if(void 0===c)return;return c.call(n)}var l=Object.getPrototypeOf(i);if(null===l)return;r=l,e=u,t=n,o=!0,a=l=void 0}},exports.__esModule=!0},{"babel-runtime/core-js/object/get-own-property-descriptor":25}],
34:[function(require,module,exports){"use strict";var _Object$create=require("babel-runtime/core-js/object/create").default,_Object$setPrototypeOf=require("babel-runtime/core-js/object/set-prototype-of").default;exports.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=_Object$create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(_Object$setPrototypeOf?_Object$setPrototypeOf(e,t):e.__proto__=t)},exports.__esModule=!0},{"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/set-prototype-of":27}],35:[function(require,module,exports){"use strict";exports.default=function(e){return e&&e.__esModule?e:{default:e}},exports.__esModule=!0},{}],36:[function(require,module,exports){"use strict";exports.default=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r},exports.__esModule=!0},{}],37:[function(require,module,exports){"use strict";var _getIterator=require("babel-runtime/core-js/get-iterator").default,_isIterable=require("babel-runtime/core-js/is-iterable").default;exports.default=function(){function r(r,e){var t=[],n=!0,a=!1,i=void 0;try{for(var u,o=_getIterator(r);!(n=(u=o.next()).done)&&(t.push(u.value),!e||t.length!==e);n=!0);}catch(l){a=!0,i=l}finally{try{!n&&o.return&&o.return()}finally{if(a)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(_isIterable(Object(e)))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),exports.__esModule=!0},{"babel-runtime/core-js/get-iterator":19,"babel-runtime/core-js/is-iterable":20}],38:[function(require,module,exports){"use strict";var _Array$from=require("babel-runtime/core-js/array/from").default;exports.default=function(r){if(Array.isArray(r)){for(var e=0,a=Array(r.length);e<r.length;e++)a[e]=r[e];return a}return _Array$from(r)},exports.__esModule=!0},{"babel-runtime/core-js/array/from":18}],39:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTypeInfo(e,t){var i={type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return _utilsForEachState2.default(t,function(t){switch(t.kind){case"Query":case"ShortQuery":i.type=e.getQueryType();break;case"Mutation":i.type=e.getMutationType();break;case"Subscription":i.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(i.type=e.getType(t.type));break;case"Field":i.fieldDef=i.type&&t.name?getFieldDef(e,i.parentType,t.name):null,i.type=i.fieldDef&&i.fieldDef.type;break;case"SelectionSet":i.parentType=_graphql.getNamedType(i.type);break;case"Directive":i.directiveDef=t.name&&e.getDirective(t.name);break;case"Arguments":i.argDefs="Field"===t.prevState.kind?i.fieldDef&&i.fieldDef.args:"Directive"===t.prevState.kind?i.directiveDef&&i.directiveDef.args:null;break;case"Argument":if(i.argDef=null,i.argDefs)for(var n=0;n<i.argDefs.length;n++)if(i.argDefs[n].name===t.name){i.argDef=i.argDefs[n];break}i.inputType=i.argDef&&i.argDef.type;break;case"ListValue":var r=_graphql.getNullableType(i.inputType);i.inputType=r instanceof _graphql.GraphQLList?r.ofType:null;break;case"ObjectValue":var a=_graphql.getNamedType(i.inputType);i.objectFieldDefs=a instanceof _graphql.GraphQLInputObjectType?a.getFields():null;break;case"ObjectField":var p=t.name&&i.objectFieldDefs?i.objectFieldDefs[t.name]:null;i.inputType=p&&p.type}}),i}function getDefinitionState(e){var t=void 0;return _utilsForEachState2.default(e,function(e){switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}}),t}function getFragmentDefinitions(e){var t=[];return runMode(e,"graphql",function(e){"FragmentDefinition"===e.kind&&e.name&&e.type&&t.push({kind:"FragmentDefinition",name:{kind:"Name",value:e.name},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.type}}})}),t}function runMode(e,t,i){var n=_codemirror2.default.getMode(_codemirror2.default.defaults,t),r=_codemirror2.default.startState(n);e.eachLine(function(e){for(var t=new _codemirror2.default.StringStream(e.text);!t.eol();){var a=n.token(t,r);i(r,a,t),t.start=t.pos}})}function getFieldDef(e,t,i){return i===_graphqlTypeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.SchemaMetaFieldDef:i===_graphqlTypeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_graphqlTypeIntrospection.TypeMetaFieldDef:i===_graphqlTypeIntrospection.TypeNameMetaFieldDef.name&&_graphql.isCompositeType(t)?_graphqlTypeIntrospection.TypeNameMetaFieldDef:t.getFields?t.getFields()[i]:void 0}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_graphqlTypeIntrospection=require("graphql/type/introspection"),_utilsForEachState=require("./utils/forEachState"),_utilsForEachState2=_interopRequireDefault(_utilsForEachState),_utilsHintList=require("./utils/hintList"),_utilsHintList2=_interopRequireDefault(_utilsHintList);require("./mode"),_codemirror2.default.registerHelper("hint","graphql",function(e,t){var i=t.schema;if(i){var n=e.getCursor(),r=e.getTokenAt(n),a=getTypeInfo(i,r.state),p=r.state,u=p.kind,o=p.step;if("comment"!==r.type){if("Document"===u)return _utilsHintList2.default(e,t,n,r,[{text:"query"},{text:"mutation"},{text:"subscription"},{text:"fragment"},{text:"{"}]);if(("SelectionSet"===u||"Field"===u||"AliasedField"===u)&&a.parentType){var l;if(a.parentType.getFields){var s=a.parentType.getFields();l=Object.keys(s).map(function(e){return s[e]})}else l=[];return _graphql.isAbstractType(a.parentType)&&l.push(_graphqlTypeIntrospection.TypeNameMetaFieldDef),a.parentType===i.getQueryType()&&l.push(_graphqlTypeIntrospection.SchemaMetaFieldDef,_graphqlTypeIntrospection.TypeMetaFieldDef),_utilsHintList2.default(e,t,n,r,l.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("Arguments"===u||"Argument"===u&&0===o){var f=a.argDefs;if(f)return _utilsHintList2.default(e,t,n,r,f.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if(("ObjectValue"===u||"ObjectField"===u&&0===o)&&a.objectFieldDefs){var c=Object.keys(a.objectFieldDefs).map(function(e){return a.objectFieldDefs[e]});return _utilsHintList2.default(e,t,n,r,c.map(function(e){return{text:e.name,type:e.type,description:e.description}}))}if("EnumValue"===u||"ListValue"===u&&1===o||"ObjectField"===u&&2===o||"Argument"===u&&2===o){var d=_graphql.getNamedType(a.inputType);if(d instanceof _graphql.GraphQLEnumType){var y=d.getValues(),g=Object.keys(y).map(function(e){return y[e]});return _utilsHintList2.default(e,t,n,r,g.map(function(e){return{text:e.name,type:d,description:e.description}}))}if(d===_graphql.GraphQLBoolean)return _utilsHintList2.default(e,t,n,r,[{text:"true",type:_graphql.GraphQLBoolean,description:"Not false."},{text:"false",type:_graphql.GraphQLBoolean,description:"Not true."}])}if("TypeCondition"===u&&1===o||"NamedType"===u&&"TypeCondition"===p.prevState.kind){var m;return a.parentType?m=_graphql.isAbstractType(a.parentType)?a.parentType.getPossibleTypes():[a.parentType]:!function(){var e=i.getTypeMap();m=Object.keys(e).map(function(t){return e[t]}).filter(_graphql.isCompositeType)}(),_utilsHintList2.default(e,t,n,r,m.map(function(e){return{text:e.name,description:e.description}}))}if("FragmentSpread"===u&&1===o){var T=function(){var p=i.getTypeMap(),u=getDefinitionState(r.state),o=getFragmentDefinitions(e),l=o.filter(function(e){return p[e.typeCondition.name.value]&&!(u&&"FragmentDefinition"===u.kind&&u.name===e.name.value)&&_graphql.doTypesOverlap(a.parentType,p[e.typeCondition.name.value])});return{v:_utilsHintList2.default(e,t,n,r,l.map(function(e){return{text:e.name.value,type:p[e.typeCondition.name.value],description:"fragment "+e.name.value+" on "+e.typeCondition.name.value}}))}}();if("object"==typeof T)return T.v}if("VariableDefinition"===u&&2===o||"ListType"===u&&1===o||"NamedType"===u&&("VariableDefinition"===p.prevState.kind||"ListType"===p.prevState.kind)){var D=i.getTypeMap(),v=Object.keys(D).map(function(e){return D[e]}).filter(_graphql.isInputType);return _utilsHintList2.default(e,t,n,r,v.map(function(e){return{text:e.name,description:e.description}}))}if("Directive"===u){var _=i.getDirectives().filter(function(e){return e.onField&&"Field"===p.prevState.kind||e.onFragment&&("FragmentDefinition"===p.prevState.kind||"InlineFragment"===p.prevState.kind||"FragmentSpread"===p.prevState.kind)||e.onOperation&&("Query"===p.prevState.kind||"Mutation"===p.prevState.kind||"Subscription"===p.prevState.kind)});return _utilsHintList2.default(e,t,n,r,_.map(function(e){return{text:e.name,description:e.description}}))}}}})},{"./mode":41,"./utils/forEachState":42,"./utils/hintList":43,codemirror:59,graphql:152,"graphql/type/introspection":169}],40:[function(require,module,exports){"use strict";function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function errorAnnotations(r,e){return e.nodes.map(function(o){var t="Variable"!==o.kind&&o.name?o.name:o.variable?o.variable:o;return{message:e.message,severity:"error",type:"validation",from:r.posFromIndex(t.loc.start),to:r.posFromIndex(t.loc.end)}})}function mapCat(r,e){return Array.prototype.concat.apply([],r.map(e))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql");_codemirror2.default.registerHelper("lint","graphql",function(r,e,o){var t=e.schema;try{var a=_graphql.parse(r)}catch(n){var i=n.locations[0],l=_codemirror2.default.Pos(i.line-1,i.column),s=o.getTokenAt(l);return[{message:n.message,severity:"error",type:"syntax",from:_codemirror2.default.Pos(i.line-1,s.start),to:_codemirror2.default.Pos(i.line-1,s.end)}]}var u=t?_graphql.validate(t,a):[];return mapCat(u,function(r){return errorAnnotations(o,r)})})},{codemirror:59,graphql:152}],41:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indent(e,n){var i=e.levels,t=i&&0!==i.length?i[i.length-1]-(this.electricInput.test(n)?1:0):e.indentLevel;return t*this.config.indentUnit}function word(e){return{style:"keyword",match:function(n){return"Name"===n.kind&&n.value===e}}}function name(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,n){e.name=n.value}}}function type(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,n){e.prevState.type=n.value}}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_utilsOnlineParser=require("./utils/onlineParser"),_utilsOnlineParser2=_interopRequireDefault(_utilsOnlineParser);_codemirror2.default.defineMode("graphql",function(e){var n=_utilsOnlineParser2.default({eatWhitespace:function(e){return e.eatWhile(isIgnored)},LexRules:LexRules,ParseRules:ParseRules});return{config:e,startState:n.startState,token:n.getToken,indent:indent,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}});var isIgnored=function(e){return" "===e||" "===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e},LexRules={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|@|\[|\]|\{|\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/},ParseRules={Document:[_utilsOnlineParser.list("Definition")],Definition:function(e){switch(e.value){case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return"FragmentDefinition";case"{":return"ShortQuery"}},Query:[word("query"),_utilsOnlineParser.opt(name("def")),_utilsOnlineParser.opt("VariableDefinitions"),_utilsOnlineParser.list("Directive"),"SelectionSet"],ShortQuery:["SelectionSet"],Mutation:[word("mutation"),_utilsOnlineParser.opt(name("def")),_utilsOnlineParser.opt("VariableDefinitions"),_utilsOnlineParser.list("Directive"),"SelectionSet"],Subscription:[word("subscription"),_utilsOnlineParser.opt(name("def")),_utilsOnlineParser.opt("VariableDefinitions"),_utilsOnlineParser.list("Directive"),"SelectionSet"],VariableDefinitions:[_utilsOnlineParser.p("("),_utilsOnlineParser.list("VariableDefinition"),_utilsOnlineParser.p(")")],VariableDefinition:["Variable",_utilsOnlineParser.p(":"),"Type",_utilsOnlineParser.opt("DefaultValue")],Variable:[_utilsOnlineParser.p("$","variable"),name("variable")],DefaultValue:[_utilsOnlineParser.p("="),"Value"],SelectionSet:[_utilsOnlineParser.p("{"),_utilsOnlineParser.list("Selection"),_utilsOnlineParser.p("}")],Selection:function(e,n){return"..."===e.value?n.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":n.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[name("qualifier"),_utilsOnlineParser.p(":"),"Field"],Field:[name("property"),_utilsOnlineParser.opt("Arguments"),_utilsOnlineParser.list("Directive"),_utilsOnlineParser.opt("SelectionSet")],Arguments:[_utilsOnlineParser.p("("),_utilsOnlineParser.list("Argument"),_utilsOnlineParser.p(")")],Argument:[name("attribute"),_utilsOnlineParser.p(":"),"Value"],FragmentSpread:[_utilsOnlineParser.p("..."),name("def"),_utilsOnlineParser.list("Directive")],InlineFragment:[_utilsOnlineParser.p("..."),_utilsOnlineParser.opt("TypeCondition"),_utilsOnlineParser.list("Directive"),"SelectionSet"],FragmentDefinition:[word("fragment"),_utilsOnlineParser.opt(_utilsOnlineParser.butNot(name("def"),[word("on")])),"TypeCondition",_utilsOnlineParser.list("Directive"),"SelectionSet"],TypeCondition:[word("on"),type("atom")],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"EnumValue"}},NumberValue:[_utilsOnlineParser.t("Number","number")],StringValue:[_utilsOnlineParser.t("String","string")],BooleanValue:[_utilsOnlineParser.t("Name","builtin")],EnumValue:[name("string-2")],ListValue:[_utilsOnlineParser.p("["),_utilsOnlineParser.list("Value"),_utilsOnlineParser.p("]")],ObjectValue:[_utilsOnlineParser.p("{"),_utilsOnlineParser.list("ObjectField"),_utilsOnlineParser.p("}")],ObjectField:[name("attribute"),_utilsOnlineParser.p(":"),"Value"],Type:function(e){return"["===e.value?"ListType":"NamedType"},ListType:[_utilsOnlineParser.p("["),"NamedType",_utilsOnlineParser.p("]"),_utilsOnlineParser.opt(_utilsOnlineParser.p("!"))],NamedType:[name("atom"),_utilsOnlineParser.opt(_utilsOnlineParser.p("!"))],Directive:[_utilsOnlineParser.p("@","meta"),name("meta"),_utilsOnlineParser.opt("Arguments")]}},{"./utils/onlineParser":45,codemirror:59}],42:[function(require,module,exports){"use strict";function forEachState(t,e){for(var r=[],o=t;o&&o.kind;)r.push(o),o=o.prevState;for(var a=r.length-1;a>=0;a--)e(r[a])}exports.__esModule=!0,exports.default=forEachState,module.exports=exports.default},{}],43:[function(require,module,exports){"use strict";function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function hintList(t,r,e,n,i){var o=filterAndSortList(i,normalizeText(n.string));if(o){var l=null!==n.type&&/"|\w/.test(n.string[0])?n.start:n.end,u={list:o,from:_codemirror2.default.Pos(e.line,l),to:_codemirror2.default.Pos(e.line,n.end)};return _codemirror2.default.signal(t,"hasCompletion",t,u,n),u}}function filterAndSortList(t,r){var e=r?t.map(function(t){return{proximity:getProximity(normalizeText(t.text),r),entry:t}}).filter(function(t){return t.proximity<=2}).sort(function(t,r){return t.proximity-r.proximity||t.entry.text.length-r.entry.text.length}).map(function(t){return t.entry}):t;return e.length>0?e:t}function normalizeText(t){return t.toLowerCase().replace(/\W/g,"")}function getProximity(t,r){var e=lexicalDistance(r,t);return t.length>r.length&&(e-=t.length-r.length-1,e+=0===t.indexOf(r)?0:.5),e}function lexicalDistance(t,r){var e=void 0,n=void 0,i=[],o=t.length,l=r.length;for(e=0;o>=e;e++)i[e]=[e];for(n=1;l>=n;n++)i[0][n]=n;for(e=1;o>=e;e++)for(n=1;l>=n;n++){var u=t[e-1]===r[n-1]?0:1;i[e][n]=Math.min(i[e-1][n]+1,i[e][n-1]+1,i[e-1][n-1]+u),e>1&&n>1&&t[e-1]===r[n-2]&&t[e-2]===r[n-1]&&(i[e][n]=Math.min(i[e][n],i[e-2][n-2]+u))}return i[o][l]}exports.__esModule=!0,exports.default=hintList;var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror);module.exports=exports.default},{codemirror:59}],44:[function(require,module,exports){"use strict";function jsonParse(e){string=e,strLen=e.length,start=end=lastEnd=-1,ch(),lex();var r=parseObj();return expect("EOF"),r}function parseObj(){var e=start,r=[];if(expect("{"),!skip("}")){do r.push(parseMember());while(skip(","));expect("}")}return{kind:"Object",start:e,end:lastEnd,members:r}}function parseMember(){var e=start,r="String"===kind?curToken():null;expect("String"),expect(":");var t=parseVal();return{kind:"Member",start:e,end:lastEnd,key:r,value:t}}function parseArr(){var e=start,r=[];if(expect("["),!skip("]")){do r.push(parseVal());while(skip(","));expect("]")}return{kind:"Array",start:e,end:lastEnd,values:r}}function parseVal(){switch(kind){case"[":return parseArr();case"{":return parseObj();case"String":case"Number":case"Boolean":case"Null":var e=curToken();return lex(),e}return expect("Value")}function curToken(){return{kind:kind,start:start,end:end,value:JSON.parse(string.slice(start,end))}}function expect(e){if(kind===e)return void lex();var r=void 0;if("EOF"===kind)r="[end of file]";else if(end-start>1)r="`"+string.slice(start,end)+"`";else{var t=string.slice(start).match(/^.+?\b/);r="`"+(t?t[0]:string[start])+"`"}throw syntaxError("Expected "+e+" but found "+r+".")}function syntaxError(e){return{message:e,start:start,end:end}}function skip(e){return kind===e?(lex(),!0):void 0}function ch(){strLen>end&&(end++,code=end===strLen?0:string.charCodeAt(end))}function lex(){for(lastEnd=end;9===code||10===code||13===code||32===code;)ch();if(0===code)return void(kind="EOF");switch(start=end,code){case 34:return kind="String",readString();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return kind="Number",readNumber();case 102:if("false"!==string.slice(start,start+5))break;return end+=4,ch(),void(kind="Boolean");case 110:if("null"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Null");case 116:if("true"!==string.slice(start,start+4))break;return end+=3,ch(),void(kind="Boolean")}kind=string[start],ch()}function readString(){for(ch();34!==code;)if(ch(),92===code)switch(ch(),code){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:ch();break;case 117:ch(),readHex(),readHex(),readHex(),readHex();break;default:throw syntaxError("Bad character escape sequence.")}else if(end===strLen)throw syntaxError("Unterminated string.");if(34===code)return void ch();throw syntaxError("Unterminated string.")}function readHex(){if(code>=48&&57>=code||code>=65&&70>=code||code>=97&&102>=code)return ch();throw syntaxError("Expected hexadecimal digit.")}function readNumber(){45===code&&ch(),48===code?ch():readDigits(),46===code&&(ch(),readDigits()),69!==code&&101!==code||(ch(),43!==code&&45!==code||ch(),readDigits())}function readDigits(){if(48>code||code>57)throw syntaxError("Expected decimal digit.");do ch();while(code>=48&&57>=code)}exports.__esModule=!0,exports.default=jsonParse;var string=void 0,strLen=void 0,start=void 0,end=void 0,lastEnd=void 0,code=void 0,kind=void 0;module.exports=exports.default},{}],45:[function(require,module,exports){"use strict";function onlineParser(e){var t=e.eatWhitespace,n=e.LexRules,r=e.ParseRules;return{startState:function(){var e={level:0};return pushRule(r,e,"Document"),e},getToken:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,u){return getToken(t,n,r,this,e,u)})}}function opt(e){return{ofRule:e}}function list(e,t){return{ofRule:e,isList:!0,separator:t}}function butNot(e,t){var n=e.match;return e.match=function(e){return n(e)&&t.every(function(t){return!t.match(e)})},e}function t(e,t){return{style:t,match:function(t){return t.kind===e}}}function p(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}function getToken(e,t,n,r,u,a){if(a.needsAdvance&&(a.needsAdvance=!1,advanceRule(a,!0)),u.sol()&&(a.indentLevel=Math.floor(u.indentation()/r.config.tabSize)),e(u))return"ws";if(r.lineComment&&u.match(r.lineComment))return u.skipToEnd(),"comment";var s=lex(t,u);if(!s)return u.match(/\S+/),"invalidchar";if(saveState(a),"Punctuation"===s.kind)if(/^[{([]/.test(s.value))a.levels=(a.levels||[]).concat(a.indentLevel+1);else if(/^[})\]]/.test(s.value)){var i=a.levels=(a.levels||[]).slice(0,-1);i.length>0&&i[i.length-1]<a.indentLevel&&(a.indentLevel=i[i.length-1])}for(;a.rule;){var o="function"==typeof a.rule?0===a.step?a.rule(s,u):null:a.rule[a.step];if(a.needsSeperator&&(o=o&&o.separator),o){if(o.ofRule&&(o=o.ofRule),"string"==typeof o){pushRule(n,a,o);continue}if(o.match&&o.match(s))return o.update&&o.update(a,s),"Punctuation"===s.kind?advanceRule(a,!0):a.needsAdvance=!0,o.style}unsuccessful(a)}return restoreState(a),"invalidchar"}function assign(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}function saveState(e){assign(stateCache,e)}function restoreState(e){assign(e,stateCache)}function pushRule(e,t,n){t.prevState=assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeperator=!1}function popRule(e){e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeperator=e.prevState.needsSeperator,e.prevState=e.prevState.prevState}function advanceRule(e,t){if(isList(e)){if(e.rule[e.step].separator&&(e.needsSeperator=!e.needsSeperator,!e.needsSeperator))return;if(t)return}for(e.needsSeperator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)popRule(e),e.rule&&(isList(e)?e.rule[e.step].separator&&(e.needsSeperator=!e.needsSeperator):(e.needsSeperator=!1,e.step++))}function isList(e){return Array.isArray(e.rule)&&e.rule[e.step].isList}function unsuccessful(e){for(;e.rule&&(!Array.isArray(e.rule)||!e.rule[e.step].ofRule);)popRule(e);e.rule&&advanceRule(e,!1)}function lex(e,t){for(var n=Object.keys(e),r=0;r<n.length;r++){var u=t.match(e[n[r]]);if(u)return{kind:n[r],value:u[0]}}}exports.__esModule=!0,exports.default=onlineParser,exports.opt=opt,exports.list=list,exports.butNot=butNot,exports.t=t,exports.p=p;var stateCache={}},{}],46:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTypeInfo(e,t){var r={type:null,fields:null};return _utilsForEachState2.default(t,function(t){if("Variable"===t.kind)r.type=e[t.name];else if("ListValue"===t.kind){var i=_graphql.getNullableType(r.type);r.type=i instanceof _graphql.GraphQLList?i.ofType:null}else if("ObjectValue"===t.kind){var a=_graphql.getNamedType(r.type);r.fields=a instanceof _graphql.GraphQLInputObjectType?a.getFields():null}else if("ObjectField"===t.kind){var n=t.name&&r.fields?r.fields[t.name]:null;r.type=n&&n.type}}),r}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_utilsForEachState=require("../utils/forEachState"),_utilsForEachState2=_interopRequireDefault(_utilsForEachState),_utilsHintList=require("../utils/hintList"),_utilsHintList2=_interopRequireDefault(_utilsHintList);require("./mode"),_codemirror2.default.registerHelper("hint","graphql-variables",function(e,t){var r=e.getCursor(),i=e.getTokenAt(r),a=i.state,n=a.kind,l=a.step;if("Document"===n&&0===l)return _utilsHintList2.default(e,t,r,i,[{text:"{"}]);var u=t.variableToType;if(u){var p=getTypeInfo(u,i.state);if("Document"===n||"Variable"===n&&0===l){var s=Object.keys(u);return _utilsHintList2.default(e,t,r,i,s.map(function(e){return{text:'"'+e+'": ',type:u[e]}}))}if(("ObjectValue"===n||"ObjectField"===n&&0===l)&&p.fields){var o=Object.keys(p.fields).map(function(e){return p.fields[e]});return _utilsHintList2.default(e,t,r,i,o.map(function(e){return{text:'"'+e.name+'": ',type:e.type,description:e.description}}))}if("StringValue"===n||"NumberValue"===n||"BooleanValue"===n||"NullValue"===n||"ListValue"===n&&1===l||"ObjectField"===n&&2===l||"Variable"===n&&2===l){var f=function(){var a=_graphql.getNamedType(p.type);if(a instanceof _graphql.GraphQLInputObjectType)return{v:_utilsHintList2.default(e,t,r,i,[{text:"{"}])};if(a instanceof _graphql.GraphQLEnumType){var n=function(){var n=a.getValues(),l=Object.keys(n).map(function(e){return n[e]});return{v:{v:_utilsHintList2.default(e,t,r,i,l.map(function(e){return{text:'"'+e.name+'"',type:a,description:e.description}}))}}}();if("object"==typeof n)return n.v}else if(a===_graphql.GraphQLBoolean)return{v:_utilsHintList2.default(e,t,r,i,[{text:"true",type:_graphql.GraphQLBoolean,description:"Not false."},{text:"false",type:_graphql.GraphQLBoolean,description:"Not true."}])}}();if("object"==typeof f)return f.v}}})},{"../utils/forEachState":42,"../utils/hintList":43,"./mode":48,codemirror:59,graphql:152}],47:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function validateVariables(e,r,a){var n=[];return a.members.forEach(function(a){var t=a.key.value,i=r[t];i?validateValue(i,a.value).forEach(function(r){var a=r[0],t=r[1];n.push(lintError(e,a,t))}):n.push(lintError(e,a.key,'Variable "$'+t+'" does not appear in any GraphQL query.'))}),n}function validateValue(e,r){for(var a=!0;a;){var n=e,t=r;if(i=u=void 0,a=!1,!(n instanceof _graphql.GraphQLNonNull)){if("Null"===t.kind)return[];if(n instanceof _graphql.GraphQLList){var i=function(){var e=n.ofType;return"Array"===t.kind?{v:mapCat(t.values,function(r){return validateValue(e,r)})}:{v:validateValue(e,t)}}();if("object"==typeof i)return i.v}if(n instanceof _graphql.GraphQLInputObjectType){var u=function(){if("Object"!==t.kind)return{v:[[t,'Type "'+n+'" must be an Object.']]};var e=Object.create(null),r=mapCat(t.members,function(r){var a=r.key.value;e[a]=!0;var t=n.getFields()[a];if(!t)return[[r.key,'Type "'+n+'" does not have a field "'+a+'".']];var i=t?t.type:void 0;return validateValue(i,r.value)});return Object.keys(n.getFields()).forEach(function(a){if(!e[a]){var i=n.getFields()[a].type;i instanceof _graphql.GraphQLNonNull&&r.push([t,'Object of type "'+n+'" is missing required field "'+a+'".'])}}),{v:r}}();if("object"==typeof u)return u.v}return"Boolean"===n.name&&"Boolean"!==t.kind||"String"===n.name&&"String"!==t.kind||"ID"===n.name&&"Number"!==t.kind&&"String"!==t.kind||"Float"===n.name&&"Number"!==t.kind||"Int"===n.name&&("Number"!==t.kind||(0|t.value)!==t.value)?[[t,'Expected value of type "'+n+'".']]:(n instanceof _graphql.GraphQLEnumType||n instanceof _graphql.GraphQLScalarType)&&("String"!==t.kind&&"Number"!==t.kind&&"Boolean"!==t.kind&&"Null"!==t.kind||isNullish(n.parseValue(t.value)))?[[t,'Expected value of type "'+n+'".']]:[]}if("Null"===t.kind)return[[t,'Type "'+n+'" is non-nullable and cannot be null.']];e=n.ofType,r=t,a=!0}}function lintError(e,r,a){return{message:a,severity:"error",type:"validation",from:e.posFromIndex(r.start),to:e.posFromIndex(r.end)}}function isNullish(e){return null===e||void 0===e||e!==e}function mapCat(e,r){return Array.prototype.concat.apply([],e.map(r))}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_graphql=require("graphql"),_utilsJsonParse=require("../utils/jsonParse"),_utilsJsonParse2=_interopRequireDefault(_utilsJsonParse);_codemirror2.default.registerHelper("lint","graphql-variables",function(e,r,a){if(!e)return[];var n=void 0;try{n=_utilsJsonParse2.default(e)}catch(t){if(t.stack)throw t;return[lintError(a,t,t.message)]}var i=r.variableToType;return i?validateVariables(a,i,n):[]})},{"../utils/jsonParse":44,codemirror:59,graphql:152}],48:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function indent(e,r){var n=e.levels,t=n&&0!==n.length?n[n.length-1]-(this.electricInput.test(r)?1:0):e.indentLevel;return t*this.config.indentUnit}function namedKey(e){return{style:e,match:function(e){return"String"===e.kind},update:function(e,r){e.name=r.value.slice(1,-1)}}}var _codemirror=require("codemirror"),_codemirror2=_interopRequireDefault(_codemirror),_utilsOnlineParser=require("../utils/onlineParser"),_utilsOnlineParser2=_interopRequireDefault(_utilsOnlineParser);_codemirror2.default.defineMode("graphql-variables",function(e){var r=_utilsOnlineParser2.default({eatWhitespace:function(e){return e.eatSpace()},LexRules:LexRules,ParseRules:ParseRules});return{config:e,startState:r.startState,token:r.getToken,indent:indent,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}});var LexRules={Punctuation:/^\[|\]|\{|\}|\:|\,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},ParseRules={Document:[_utilsOnlineParser.p("{"),_utilsOnlineParser.list("Variable",_utilsOnlineParser.p(",")),_utilsOnlineParser.p("}")],Variable:[namedKey("variable"),_utilsOnlineParser.p(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[_utilsOnlineParser.t("Number","number")],StringValue:[_utilsOnlineParser.t("String","string")],BooleanValue:[_utilsOnlineParser.t("Keyword","builtin")],NullValue:[_utilsOnlineParser.t("Keyword","keyword")],ListValue:[_utilsOnlineParser.p("["),_utilsOnlineParser.list("Value",_utilsOnlineParser.p(",")),_utilsOnlineParser.p("]")],ObjectValue:[_utilsOnlineParser.p("{"),_utilsOnlineParser.list("ObjectField",_utilsOnlineParser.p(",")),_utilsOnlineParser.p("}")],ObjectField:[namedKey("attribute"),_utilsOnlineParser.p(":"),"Value"]}},{"../utils/onlineParser":45,codemirror:59}],49:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(i);return-1==n?0:n}var t={},i=/[^\s\u00a0]/,l=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),r=null,a=o.length-1;a>=0;a--){var m=o[a].from(),c=o[a].to();m.line>=i||(c.line>=i&&(c=l(i,0)),i=m.line,null==r?n.uncomment(m,c,e)?r="un":(n.lineComment(m,c,e),r="line"):"un"==r?n.uncomment(m,c,e):n.lineComment(m,c,e))}}),e.defineExtension("lineComment",function(e,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent){for(var t=null,o=e.line;g>o;++o){var m=a.getLine(o),f=m.slice(0,n(m));(null==t||t.length>f.length)&&(t=f)}for(var o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;
if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var C=o.blockCommentStart||m.blockCommentStart,p=o.blockCommentEnd||m.blockCommentEnd;if(!C||!p)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(C),R=L.lastIndexOf(p);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(p)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(C,e.ch),E=-1==O?-1:k.slice(0,e.ch).indexOf(p,O+C.length);if(-1!=O&&-1!=E&&E+p.length!=e.ch)return!1;E=L.indexOf(p,n.ch);var M=L.slice(n.ch).lastIndexOf(C,E-n.ch);return O=-1==E||-1==M?-1:n.ch+M,-1!=E&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+p.length));var e=x+C.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})})},{"../../lib/codemirror":59}],50:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=t(i,"pairs"),o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}for(var s=o.length-1;s>=0;s--){var f=o[s].head;n.replaceRange("",h(f.line,f.ch-1),h(f.line,f.ch+1),"+delete")}}function a(n){var i=r(n),a=i&&t(i,"explode");if(!a||n.getOption("disableInput"))return e.Pass;for(var o=n.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var l=c(n,o[s].head);if(!l||a.indexOf(l)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),o=n.listSelections();for(var e=0;e<o.length;e++){var t=o[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function o(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var a=r(n);if(!a||n.getOption("disableInput"))return e.Pass;var s=t(a,"pairs"),c=s.indexOf(i);if(-1==c)return e.Pass;for(var u,d,g=t(a,"triples"),p=s.charAt(c+1)==i,v=n.listSelections(),m=c%2==0,b=0;b<v.length;b++){var x,C=v[b],P=C.head,d=n.getRange(P,h(P.line,P.ch+1));if(m&&!C.empty())x="surround";else if(!p&&m||d!=i)if(p&&P.ch>1&&g.indexOf(i)>=0&&n.getRange(h(P.line,P.ch-2),P)==i+i&&(P.ch<=2||n.getRange(h(P.line,P.ch-3),h(P.line,P.ch-2))!=i))x="addFour";else if(p){if(e.isWordChar(d)||!f(n,P,i))return e.Pass;x="both"}else{if(!m||n.getLine(P.line).length!=P.ch&&!l(d,s)&&!/\s/.test(d))return e.Pass;x="both"}else x=g.indexOf(i)>=0&&n.getRange(P,h(P.line,P.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=x)return e.Pass}else u=x}var S=c%2?s.charAt(c-1):i,k=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=S+t[e]+k;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=o(t[e]);n.setSelections(t)}else"both"==u?(n.replaceSelection(S+k,null),n.triggerElectric(S+k),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(S+S+S+S,"before"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var n=e.getRange(h(t.line,t.ch-1),h(t.line,t.ch+1));return 2==n.length?n:null}function f(t,n,r){var i=t.getLine(n.line),a=t.getTokenAt(n);if(/\bstring2?\b/.test(a.type))return!1;var o=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=n.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(g))});for(var d=u.pairs+"`",g={Backspace:i,Enter:a},p=0;p<d.length;p++)g["'"+d.charAt(p)+"'"]=n(d.charAt(p))})},{"../../lib/codemirror":59}],51:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){var o=e.getLineHandle(t.line),f=t.ch-1,l=f>=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(0>n?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l<f.length;l++){var u=f[l].empty()&&t(e,f[l].head,!1,i);if(u&&e.getLine(u.from.line).length<=r){var h=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";c.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:h})),u.to&&e.getLine(u.to.line).length<=r&&c.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:h}))}}if(c.length){o&&e.state.focused&&e.focus();var s=function(){e.operation(function(){for(var e=0;e<c.length;e++)c[e].clear()})};if(!n)return s;setTimeout(s,800)}}function r(e){e.operation(function(){f&&(f(),f=null),f=i(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})})},{"../../lib/codemirror":59}],52:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u<n.ch)break;if(o=r.getTokenTypeAt(e.Pos(l,u+1)),!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==s)break;s=1,i=f.length}}}var i,o,l=n.line,f=r.getLine(l),s="{",u="}",i=t("{");if(null==i&&(s="[",u="]",i=t("[")),null!=i){var a,d,c=1,g=r.lastLine();e:for(var v=l;g>=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),e.registerHelper("fold","include",function(r,n){function t(n){if(n<r.firstLine()||n>r.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})})},{"../../lib/codemirror":59}],53:[function(require,module,exports){!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.line<u)return null;for(var r=o.findMarksAt(e.from),t=0;t<r.length;++t)if(r[t].__isFold&&"fold"!==f){if(!n)return null;e.cleared=!0,r[t].clear()}return e}if(t&&t.call){var d=t;t=null}else var d=r(o,t,"rangeFinder");"number"==typeof i&&(i=n.Pos(i,0));var u=r(o,t,"minFoldSize"),a=l(!0);if(r(o,t,"scanUp"))for(;!a&&i.line>o.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e<o.length;++e)if(o[e].__isFold)return!0}),n.commands.toggleFold=function(n){n.foldCode(n.getCursor())},n.commands.fold=function(n){n.foldCode(n.getCursor(),null,"fold")},n.commands.unfold=function(n){n.foldCode(n.getCursor(),null,"unfold")},n.commands.foldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r<n.length;++r){var i=n[r](o,e);if(i)return i}}}),n.registerHelper("fold","auto",function(n,o){for(var e=n.getHelpers(o,"fold"),r=0;r<e.length;r++){var i=e[r](n,o);if(i)return i}});var i={rangeFinder:n.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};n.defineOption("foldOptions",null),n.defineExtension("foldOption",function(n,o){return r(this,n,o)})})},{"../../lib/codemirror":59}],54:[function(require,module,exports){!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],o):o(CodeMirror)}(function(o){"use strict";function t(o){this.options=o,this.from=this.to=0}function e(o){return o===!0&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o}function r(o,t){for(var e=o.findMarksAt(c(t)),r=0;r<e.length;++r)if(e[r].__isFold&&e[r].find().from.line==t)return e[r]}function n(o){if("string"==typeof o){var t=document.createElement("div");return t.className=o+" CodeMirror-guttermarker-subtle",t}return o.cloneNode(!0)}function i(o,t,e){var i=o.state.foldGutter.options,f=t,d=o.foldOption(i,"minFoldSize"),a=o.foldOption(i,"rangeFinder");o.eachLine(t,e,function(t){var e=null;if(r(o,f))e=n(i.indicatorFolded);else{var u=c(f,0),l=a&&a(o,u);l&&l.to.line-l.from.line>=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var n=o.state.foldGutter;if(n){var i=n.options;if(e==i.gutter){var f=r(o,t);f?f.clear():o.foldCode(c(t,0),i.rangeFinder)}}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.from<t.from&&(i(o,e.from,t.from),t.from=e.from),e.to>t.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r<e.to&&i(o,r,r+1)}}o.defineOption("foldGutter",!1,function(r,n,i){i&&i!=o.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",d),r.off("change",a),r.off("viewportChange",u),r.off("fold",l),r.off("unfold",l),r.off("swapDoc",a)),n&&(r.state.foldGutter=new t(e(n)),f(r),r.on("gutterClick",d),r.on("change",a),r.on("viewportChange",u),r.on("fold",l),r.on("unfold",l),r.on("swapDoc",a))});var c=o.Pos})},{"../../lib/codemirror":59,"./foldcode":53}],55:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function i(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on("cursorActivity",this.activityFunc=function(){e.cursorActivity()})}function e(t,i,e){var n=t.options.hintOptions,o={};for(var s in d)o[s]=d[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);return o.hint.resolve&&(o.hint=o.hint.resolve(t,i)),o}function n(t){return"string"==typeof t?t:t.text}function o(t,i){function e(t,e){var o;o="string"!=typeof e?function(t){return e(t,i)}:n.hasOwnProperty(e)?n[e]:e,s[t]=o}var n={Up:function(){i.moveFocus(-1)},Down:function(){i.moveFocus(1)},PageUp:function(){i.moveFocus(-i.menuSize()+1,!0)},PageDown:function(){i.moveFocus(i.menuSize()-1,!0)},Home:function(){i.setFocus(0)},End:function(){i.setFocus(i.length-1)},Enter:i.pick,Tab:i.pick,Esc:i.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&e(c,o[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&e(c,r[c]);return s}function s(t,i){for(;i&&i!=t;){if("LI"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function c(i,e){this.completion=i,this.data=e,this.picked=!1;var c=this,r=i.cm,h=this.hints=document.createElement("ul");h.className="CodeMirror-hints",this.selectedHint=e.selectedHint||0;for(var u=e.list,f=0;f<u.length;++f){var d=h.appendChild(document.createElement("li")),p=u[f],m=l+(f!=this.selectedHint?"":" "+a);null!=p.className&&(m=p.className+" "+m),d.className=m,p.render?p.render(d,e,p):d.appendChild(document.createTextNode(p.displayText||n(p))),d.hintId=f}var g=r.cursorCoords(i.options.alignWithWord?e.from:null),v=g.left,y=g.bottom,w=!0;h.style.left=v+"px",h.style.top=y+"px";var k=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),H=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(i.options.container||document.body).appendChild(h);var C=h.getBoundingClientRect(),b=C.bottom-H;if(b>0){var A=C.bottom-C.top,x=g.top-(g.bottom-C.top);if(x-A>0)h.style.top=(y=g.top-A)+"px",w=!1;else if(A>H){h.style.height=H-5+"px",h.style.top=(y=g.bottom-C.top)+"px";var S=r.getCursor();e.from.ch!=S.ch&&(g=r.cursorCoords(S),h.style.left=(v=g.left)+"px",C=h.getBoundingClientRect())}}var T=C.right-k;if(T>0&&(C.right-C.left>k&&(h.style.width=k-5+"px",T-=C.right-C.left-k),h.style.left=(v=g.left-T)+"px"),r.addKeyMap(this.keyMap=o(i,{moveFocus:function(t,i){c.changeActive(c.selectedHint+t,i)},setFocus:function(t){c.changeActive(t)},menuSize:function(){return c.screenAmount()},length:u.length,close:function(){i.close()},pick:function(){c.pick()},data:e})),i.options.closeOnUnfocus){var M;r.on("blur",this.onBlur=function(){M=setTimeout(function(){i.close()},100)}),r.on("focus",this.onFocus=function(){clearTimeout(M)})}var F=r.getScrollInfo();return r.on("scroll",this.onScroll=function(){var t=r.getScrollInfo(),e=r.getWrapperElement().getBoundingClientRect(),n=y+F.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return w||(o+=h.offsetHeight),o<=e.top||o>=e.bottom?i.close():(h.style.top=n+"px",void(h.style.left=v+F.left-t.left+"px"))}),t.on(h,"dblclick",function(t){var i=s(h,t.target||t.srcElement);i&&null!=i.hintId&&(c.changeActive(i.hintId),c.pick())}),t.on(h,"click",function(t){var e=s(h,t.target||t.srcElement);e&&null!=e.hintId&&(c.changeActive(e.hintId),i.options.completeOnSingleClick&&c.pick())}),t.on(h,"mousedown",function(){setTimeout(function(){r.focus()},20)}),t.signal(e,"select",u[0],h.firstChild),!0}function r(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n<i.length;n++)i[n].supportsSelection&&e.push(i[n]);return e}function h(i,e){var n,o=i.getHelpers(e,"hint");if(o.length){for(var s,c=!1,h=0;h<o.length;h++)o[h].async&&(c=!0);return c?(s=function(t,i,e){function n(o,c){if(o==s.length)return i(null);var r=s[o];if(r.async)r(t,function(t){t?i(t):n(o+1)},e);else{var c=r(t,e);c?i(c):n(o+1)}}var s=r(t,o);n(0)},s.async=!0):s=function(t,i){for(var e=r(t,o),n=0;n<e.length;n++){var s=e[n](t,i);if(s&&s.list.length)return s}},s.supportsSelection=!0,s}return(n=i.getHelper(i.getCursor(),"hintWords"))?function(i){return t.hint.fromList(i,{words:n})}:t.hint.anyword?function(i,e){return t.hint.anyword(i,e)}:function(){}}var l="CodeMirror-hint",a="CodeMirror-hint-active";t.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},t.defineExtension("showHint",function(n){n=e(this,this.getCursor("start"),n);var o=this.listSelections();if(!(o.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var s=0;s<o.length;s++)if(o[s].head.line!=o[s].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var c=this.state.completionActive=new i(this,n);c.options.hint&&(t.signal(this,"startCompletion",this),c.update(!0))}});var u=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},f=window.cancelAnimationFrame||clearTimeout;i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&t.signal(this.data,"close"),this.widget&&this.widget.close(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(i,e){var o=i.list[e];o.hint?o.hint(this.cm,i,o):this.cm.replaceRange(n(o),o.from||i.from,o.to||i.to,"complete"),t.signal(i,"pick",o),this.close()},cursorActivity:function(){this.debounce&&(f(this.debounce),this.debounce=0);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch<this.startPos.ch||this.cm.somethingSelected()||t.ch&&this.options.closeCharacters.test(i.charAt(t.ch-1)))this.close();else{var e=this;this.debounce=u(function(){e.update()}),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick)if(this.options.hint.async){var i=++this.tick,e=this;this.options.hint(this.cm,function(n){e.tick==i&&e.finishUpdate(n,t)},this.options)}else this.finishUpdate(this.options.hint(this.cm,this.options),t)},finishUpdate:function(i,e){this.data&&t.signal(this.data,"update"),i&&this.data&&t.cmpPos(i.from,this.data.from)&&(i=null),this.data=i;var n=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),i&&i.list.length&&(n&&1==i.list.length?this.pick(i,0):(this.widget=new c(this,i),t.signal(i,"shown")))}},c.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(i,e){if(i>=this.data.list.length?i=e?this.data.list.length-1:0:0>i&&(i=e?0:this.data.list.length-1),this.selectedHint!=i){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+a,""),n=this.hints.childNodes[this.selectedHint=i],n.className+=" "+a,n.offsetTop<this.hints.scrollTop?this.hints.scrollTop=n.offsetTop-3:n.offsetTop+n.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",{resolve:h}),t.registerHelper("hint","fromList",function(i,e){var n=i.getCursor(),o=i.getTokenAt(n),s=t.Pos(n.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var c=o.string,r=t.Pos(n.line,o.start);else var c="",r=s;for(var h=[],l=0;l<e.words.length;l++){var a=e.words[l];a.slice(0,c.length)==c&&h.push(a)}return h.length?{list:h,from:r,to:s}:void 0}),t.commands.autocomplete=t.showHint;var d={hint:t.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};t.defineOption("hintOptions",null)})},{"../../lib/codemirror":59}],56:[function(require,module,exports){!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),l&&(o(l),l=null)}var l=e(n,r),s=setInterval(function(){if(l)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}return l?void 0:clearInterval(s)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)},this.waitingFor=0}function a(t,e){return e instanceof Function?{getAnnotations:e}:(e&&e!==!0||(e={}),e)}function l(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(y);for(var n=0;n<e.marked.length;++n)e.marked[n].clear();e.marked.length=0}function s(e,n,o,i){var a=document.createElement("div"),l=a;return a.className="CodeMirror-lint-marker-"+n,o&&(l=a.appendChild(document.createElement("div")),l.className="CodeMirror-lint-marker-multiple"),0!=i&&t.on(l,"mouseover",function(t){r(t,e,l)}),a}function u(t,e){return"error"==t?t:e}function c(t){for(var e=[],n=0;n<t.length;++n){var o=t[n],r=o.from.line;(e[r]||(e[r]=[])).push(o)}return e}function f(t){var e=t.severity;e||(e="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+e,n.appendChild(document.createTextNode(t.message)),n}function m(e,n,o){function r(){a=-1,e.off("change",r)}var i=e.state.lint,a=++i.waitingFor;e.on("change",r),n(e.getValue(),function(n,o){e.off("change",r),i.waitingFor==a&&(o&&n instanceof t&&(n=o),p(e,n))},o,e)}function d(e){var n=e.state.lint,o=n.options,r=o.options||o,i=o.getAnnotations||e.getHelper(t.Pos(0,0),"lint");i&&(o.async||i.async?m(e,i,r):p(e,i(e.getValue(),r,e)))}function p(t,e){l(t);for(var n=t.state.lint,o=n.options,r=c(e),i=0;i<r.length;++i){var a=r[i];if(a){for(var m=null,d=n.hasGutter&&document.createDocumentFragment(),p=0;p<a.length;++p){var v=a[p],h=v.severity;h||(h="error"),m=u(m,h),o.formatAnnotation&&(v=o.formatAnnotation(v)),n.hasGutter&&d.appendChild(f(v)),v.to&&n.marked.push(t.markText(v.from,v.to,{className:"CodeMirror-lint-mark-"+h,__annotation:v}))}n.hasGutter&&t.setGutterMarker(i,y,s(d,m,a.length>1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function v(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500))}function h(t,e){var n=e.target||e.srcElement;r(e,f(t),n)}function g(t,e){var n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var o=n.getBoundingClientRect(),r=(o.left+o.right)/2,i=(o.top+o.bottom)/2,a=t.findMarksAt(t.coordsChar({left:r,top:i},"client")),l=0;l<a.length;++l){var s=a[l].__annotation;if(s)return h(s,e)}}var y="CodeMirror-lint-markers";t.defineOption("lint",!1,function(e,n,o){if(o&&o!=t.Init&&(l(e),e.state.lint.options.lintOnChange!==!1&&e.off("change",v),t.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver),clearTimeout(e.state.lint.timeout),delete e.state.lint),n){for(var r=e.getOption("gutters"),s=!1,u=0;u<r.length;++u)r[u]==y&&(s=!0);var c=e.state.lint=new i(e,a(e,n),s);c.options.lintOnChange!==!1&&e.on("change",v),0!=c.options.tooltips&&t.on(e.getWrapperElement(),"mouseover",c.onMouseOver),d(e)}}),t.defineExtension("performLint",function(){this.state.lint&&d(this)})})},{"../../lib/codemirror":59}],57:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var o,s,l=e.getLine(r.line).slice(0,r.ch),h=0;;){t.lastIndex=h;var c=t.exec(l);if(!c)break;if(o=c,s=o.index,h=o.index+(o[0].length||1),h==l.length)break}var f=o&&o[0].length||0;f||(0==s&&0==l.length?o=void 0:s!=e.getLine(r.line).length&&f++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),o=t.exec(l),f=o&&o[0].length||0,s=o&&o.index;s+f==l.length||f||(f=1)}return o&&f?{from:i(r.line,s),to:i(r.line,s+f),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},h=t.split("\n");if(1==h.length)t.length?this.matches=function(r,o){if(r){var h=e.getLine(o.line).slice(0,o.ch),c=l(h),f=c.lastIndexOf(t);if(f>-1)return f=n(h,c,f),{from:i(o.line,f),to:i(o.line,f+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),c=l(h),f=c.indexOf(t);if(f>-1)return f=n(h,c,f)+o.ch,{from:i(o.line,f),to:i(o.line,f+s.length)}}}:this.matches=function(){};else{var c=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[r].length))!=h[h.length-1])return;for(var o=i(n.line,c[r].length),s=n.line-1,f=r-1;f>=1;--f,--s)if(h[f]!=l(e.getLine(s)))return;var u=e.getLine(s),a=u.length-c[0].length;if(l(u.slice(a))!=h[0])return;return{from:i(s,a),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),a=u.length-c[0].length;if(l(u.slice(a))==h[0]){for(var g=i(n.line,a),s=n.line+1,f=1;r>f;++f,++s)if(h[f]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,c[r].length))==h[r])return{from:g,to:i(s,c[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var r=e.splitLines(t);this.doc.replaceRange(r,this.pos.from,this.pos.to,n),this.pos.to=i(this.pos.from.line+r.length-1,r[r.length-1].length+(1==r.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i=[],r=this.getSearchCursor(t,this.getCursor("from"),n);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)i.push({anchor:r.from(),head:r.to()});i.length&&this.setSelections(i,0)})})},{"../../lib/codemirror":59}],58:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";
function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(h(n.line-1));var o=t.getLine(n.line);if(r>0&&n.ch>=o.length)return t.clipPos(h(n.line+1,0));for(var i,a="start",l=n.ch,s=0>r?0:o.length,c=0;l!=s;l+=r,c++){var f=o.charAt(0>r?l-1:l),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==a)"o"!=u&&(a="in",i=u);else if("in"==a&&i!=u){if("w"==i&&"W"==u&&0>r&&l--,"W"==i&&"w"==u&&r>0){i="w";continue}break}}return h(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:void t.operation(function(){for(var e=t.listSelections().length,r=[],o=-1,i=0;e>i;i++){var a=t.listSelections()[i].head;if(!(a.line<=o)){var l=h(a.line+(n?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),o=a.line+1}}t.setSelections(r)})}function o(t,n){for(var r=n.ch,o=r,i=t.getLine(n.line);r&&e.isWordChar(i.charAt(r-1));)--r;for(;o<i.length&&e.isWordChar(i.charAt(o));)++o;return{from:h(n.line,r),to:h(n.line,o),word:i.slice(r,o)}}function i(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==g.charAt(g.indexOf(n.ch)+1))return e.setSelection(h(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=h(r.pos.line,r.pos.ch+1)}}function a(t,n){if(t.isReadOnly())return e.Pass;for(var r,o=t.listSelections(),i=[],a=0;a<o.length;a++){var l=o[a];if(!l.empty()){for(var s=l.from().line,c=l.to().line;a<o.length-1&&o[a+1].from().line==c;)c=l[++a].to().line;i.push(s,c)}}i.length?r=!0:i.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],o=0;o<i.length;o+=2){var a=i[o],l=i[o+1],s=h(a,0),c=h(l),f=t.getRange(s,c,!1);n?f.sort():f.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),t.replaceRange(f,s,c),r&&e.push({anchor:s,head:c})}r&&t.setSelections(e,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),i=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(i.push(l),a.push("")):a.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(a,"around","case");for(var c,l=i.length-1;l>=0;l--){var s=r[i[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=o(t,s.head);c=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function c(e,t){var n=s(e);if(n){var r=n.query,o=e.getSearchCursor(r,t?n.to:n.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(r,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap.default==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)};var m=d?"Ctrl-Alt-":"Ctrl-";u[f[m+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},u[f[m+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var o=t[r].from(),i=t[r].to(),a=o.line;a<=i.line;++a)i.line>o.line&&a==i.line&&0==i.ch||n.push({anchor:a==o.line?o:h(a,0),head:a==i.line?i:h(a)});e.setSelections(n,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var o=t[r];n.push({anchor:h(o.from().line,0),head:h(o.to().line+1,0)})}e.setSelections(n)},f["Shift-Ctrl-K"]="deleteLine",u[f[p+"Enter"]="insertLineAfter"]=function(e){return r(e,!1)},u[f["Shift-"+p+"Enter"]="insertLineBefore"]=function(e){return r(e,!0)},u[f[p+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),i=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=o(t,n);if(!a.word)return;t.setSelection(a.from,a.to),i=!0}else{var l=t.getRange(n,r),s=i?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(s,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(s,h(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}i&&(t.state.sublimeFindFullWord=t.doc.sel)};var g="(){}[]";u[f["Shift-"+p+"Space"]="selectScope"]=function(e){i(e)||e.execCommand("selectAll")},u[f["Shift-"+p+"M"]="selectBetweenBrackets"]=function(t){return i(t)?void 0:e.Pass},u[f[p+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var o=t.scanForBracket(n.head,-1);return o&&h(o.pos.line,o.pos.ch+1)||n.head})};var v=d?"Cmd-Ctrl-":"Shift-Ctrl-";u[f[v+"Up"]="swapLineUp"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],o=t.firstLine()-1,i=[],a=0;a<n.length;a++){var l=n[a],s=l.from().line-1,c=l.to().line;i.push({anchor:h(l.anchor.line-1,l.anchor.ch),head:h(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--c,s>o?r.push(s,c):r.length&&(r[r.length-1]=c),o=c}t.operation(function(){for(var e=0;e<r.length;e+=2){var n=r[e],o=r[e+1],a=t.getLine(n);t.replaceRange("",h(n,0),h(n+1,0),"+swapLine"),o>t.lastLine()?t.replaceRange("\n"+a,h(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",h(o,0),null,"+swapLine")}t.setSelections(i),t.scrollIntoView()})},u[f[v+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],o=t.lastLine()+1,i=n.length-1;i>=0;i--){var a=n[i],l=a.to().line+1,s=a.from().line;0!=a.to().ch||a.empty()||l--,o>l?r.push(l,s):r.length&&(r[r.length-1]=s),o=s}t.operation(function(){for(var e=r.length-2;e>=0;e-=2){var n=r[e],o=r[e+1],i=t.getLine(n);n==t.lastLine()?t.replaceRange("",h(n-1),h(n),"+swapLine"):t.replaceRange("",h(n,0),h(n+1,0),"+swapLine"),t.replaceRange(i+"\n",h(o,0),null,"+swapLine")}t.scrollIntoView()})},u[f[p+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},u[f[p+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var o=t[r],i=o.from(),a=i.line,l=o.to().line;r<t.length-1&&t[r+1].from().line==l;)l=t[++r].to().line;n.push({start:a,end:l,anchor:!o.empty()&&i})}e.operation(function(){for(var t=0,r=[],o=0;o<n.length;o++){for(var i,a=n[o],l=a.anchor&&h(a.anchor.line-t,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-t;s==a.end&&(i=h(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",h(c),h(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}r.push({anchor:l||i,head:i})}e.setSelections(r,0)})},u[f["Shift-"+p+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",h(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){a(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),a=e.findMarks(o,i),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<n.length;s++)n[s]==a[l]&&n.splice(s--,1);break}l==a.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},u[f["Shift-"+p+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},u[f["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},f["Alt-Q"]="wrapLines";var S=p+"K ";f[S+p+"Backspace"]="delLineLeft",u[f.Backspace="smartBackspace"]=function(t){if(t.somethingSelected())return e.Pass;var n=t.getCursor(),r=t.getRange({line:n.line,ch:0},n),o=e.countColumn(r,null,t.getOption("tabSize")),i=t.getOption("indentUnit");if(r&&!/\S/.test(r)&&o%i==0){var a=new h(n.line,e.findColumn(r,o-i,i));return a.ch==n.ch?e.Pass:t.replaceRange("",a,n,"+delete")}return e.Pass},u[f[S+p+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[S+p+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},u[f[S+p+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},u[f[S+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[S+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[S+p+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},u[f[S+p+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},u[f[S+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[S+p+"G"]="clearBookmarks",u[f[S+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(h(r.head.line-1,r.head.ch))}})},u[f["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(h(r.head.line+1,r.head.ch))}})},u[f[p+"F3"]="findUnder"]=function(e){c(e,!0)},u[f["Shift-"+p+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},u[f["Alt-F3"]="findAllUnder"]=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}},f["Shift-"+p+"["]="fold",f["Shift-"+p+"]"]="unfold",f[S+p+"0"]=f[S+p+"j"]="unfoldAll",f[p+"I"]="findIncremental",f["Shift-"+p+"I"]="findIncrementalReverse",f[p+"H"]="replace",f.F3="findNext",f["Shift-F3"]="findPrev",e.normalizeKeyMap(f)})},{"../addon/edit/matchbrackets":51,"../addon/search/searchcursor":57,"../lib/codemirror":59}],59:[function(require,module,exports){!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?zi(n):{},zi(Jo,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new Sl(i,n.mode,null,n.lineSeparator)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!Wo&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ai,keySeq:null,specialChars:null};var a=this;bo&&11>wo&&setTimeout(function(){a.display.input.reset(!0)},20),Ut(this),$i(),wt(this),this.curOp.forceUpdate=!0,qn(this,i),n.autofocus&&!Wo||a.hasFocus()?setTimeout(Fi(vr,this),20):mr(this);for(var c in el)el.hasOwnProperty(c)&&el[c](this,n[c],tl);C(this),n.finishInit&&n.finishInit(this);for(var h=0;h<ol.length;++h)ol[h](this);Ct(this),xo&&n.lineWrapping&&"optimizelegibility"==getComputedStyle(l.lineDiv).textRendering&&(l.lineDiv.style.textRendering="auto")}function t(e,t,r){var n=this;this.input=r,n.scrollbarFiller=Ui("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=Ui("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Ui("div",null,"CodeMirror-code"),n.selectionDiv=Ui("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Ui("div",null,"CodeMirror-cursors"),n.measure=Ui("div",null,"CodeMirror-measure"),n.lineMeasure=Ui("div",null,"CodeMirror-measure"),n.lineSpace=Ui("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Ui("div",[Ui("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Ui("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=Ui("div",null,null,"position: absolute; height: "+Pl+"px; width: 1px;"),n.gutters=Ui("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Ui("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Ui("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),bo&&8>wo&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),xo||vo&&Wo||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Et(e)}function i(e){e.options.lineWrapping?(Zl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ql(e.display.wrapper,"CodeMirror-wrap"),f(e)),l(e),Et(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(Cn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function l(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&ei(e,t)})}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),st(e)}function a(e){u(e),Et(e),setTimeout(function(){x(e)},20)}function u(e){var t=e.display.gutters,r=e.options.gutters;Vi(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(Ui("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function h(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=gn(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=vn(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,n=i.to.line,r+=n.text.length-i.to.ch}return r}function f(e){var t=e.display,r=e.doc;t.maxLine=Zn(r,r.first),t.maxLineLength=h(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=h(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Hi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ke(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Xe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=Ui("div",[Ui("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ui("div",[Ui("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Wl(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Wl(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>wo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&ql(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Wl(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?ir(t,e):nr(t,e)},t),t.display.scrollbars.addClass&&Zl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ve(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ri(t,n),l=ri(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=ri(t,ni(Zn(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=ri(t,ni(Zn(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&r[l].gutter&&(r[l].gutter.style.left=o);var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function C(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=S(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(Ui("div",[Ui("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",c(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function T(e,t,r){var n=e.display;this.viewport=t,this.visible=w(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ye(e),this.force=r,this.dims=H(e),this.events=[]}function k(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Xe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xe(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return zt(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Gt(e))return!1;C(e)&&(zt(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Io&&(o=wn(e.doc,o),l=xn(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Bt(e,o,l),r.viewOffset=ni(Zn(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Gt(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=ji();return a>4&&(r.lineDiv.style.display="none"),P(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&ji()!=u&&u.offsetHeight&&u.focus(),Vi(r.cursorDiv),Vi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Re(e,400)),r.updateLineNumbers=null,!0}function N(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ye(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Ke(e.display)-_e(e),r.top)}),t.visible=w(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);n=!1){O(e);var i=p(e);Pe(e),A(e,i),y(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function W(e,t){var r=new T(e,t);if(M(e,r)){O(e),N(e,r);var n=p(e);Pe(e),A(e,n),y(e,n),r.finish()}}function A(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight+e.display.barHeight+Xe(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,o=t.view[n];if(!o.hidden){if(bo&&8>wo){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=yt(t)),(a>.001||-.001>a)&&(ei(o.line,i),D(o.line),o.rest))for(var u=0;u<o.rest.length;u++)D(o.rest[u])}}}function D(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function H(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:L(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function P(e,t,r){function n(t){var r=t.nextSibling;return xo&&Ao&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var i=e.display,o=e.options.lineNumbers,l=i.lineDiv,s=l.firstChild,a=i.view,u=i.viewFrom,c=0;c<a.length;c++){var h=a[c];if(h.hidden);else if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=n(s);var f=o&&null!=t&&u>=t&&h.lineNumber;h.changes&&(Hi(h.changes,"gutter")>-1&&(f=!1),E(e,h,u,r)),f&&(Vi(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=h.node.nextSibling}else{var d=V(e,h,u,r);l.insertBefore(d,s)}u+=h.size}for(;s;)s=n(s)}function E(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?G(e,t,r,n):"class"==o?B(t):"widget"==o&&U(e,t,n)}t.changes=null}function I(e){return e.node==e.text&&(e.node=Ui("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),bo&&8>wo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=I(e);e.background=r.insertBefore(Ui("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Fn(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=I(t);t.gutterBackground=Ui("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),l=t.gutter=Ui("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),i.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(Ui("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var a=e.options.gutters[s],u=o.hasOwnProperty(a)&&o[a];u&&l.appendChild(Ui("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[a]+"px; width: "+n.gutterWidth[a]+"px"))}}}function U(e,t,r){t.alignable&&(t.alignable=null);for(var n,i=t.node.firstChild;i;i=n){var n=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}K(e,t,r)}function V(e,t,r,n){var i=F(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),B(t),G(e,t,r,n),K(e,t,n),t.node}function K(e,t,r){if(j(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)j(e,t.rest[n],t,r,!1)}function j(e,t,r,n,i){if(t.widgets)for(var o=I(r),l=0,s=t.widgets;l<s.length;++l){var a=s[l],u=Ui("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),X(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Li(a,"redraw")}}function X(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Y(e){return zo(e.line,e.ch)}function _(e,t){return Fo(e,t)<0?t:e}function $(e,t){return Fo(e,t)<0?e:t}function q(e){e.state.focused||(e.display.input.focus(),vr(e))}function Z(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=o.splitLines(t),a=null;if(l&&n.ranges.length>1)if(Ro&&Ro.join("\n")==t){if(n.ranges.length%Ro.length==0){a=[];for(var u=0;u<Ro.length;u++)a.push(o.splitLines(Ro[u]))}}else s.length==n.ranges.length&&(a=Pi(s,function(e){return[e]}));for(var u=n.ranges.length-1;u>=0;u--){var c=n.ranges[u],h=c.from(),f=c.to();c.empty()&&(r&&r>0?h=zo(h.line,h.ch-r):e.state.overwrite&&!l&&(f=zo(f.line,Math.min(Zn(o,f.line).text.length,f.ch+Di(s).length))));var d=e.curOp.updateInput,p={from:h,to:f,text:a?a[u%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Tr(e.doc,p),Li(e,"inputRead",e,p)}t&&!l&&J(e,t),zr(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Wt(t,function(){Z(t,r,0,null,"paste")}),!0):void 0}function J(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=Rr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Rr(e,i.head.line,"smart"));l&&Li(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:zo(i,0),head:zo(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function re(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ai,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ne(){var e=Ui("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Ui("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return xo?e.style.width="1000px":e.setAttribute("wrap","off"),No&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ai,this.gracePeriod=!1}function oe(e,t){var r=Je(e,t.line);if(!r||r.hidden)return null;var n=Zn(e.doc,t.line),i=qe(r,n,t.line),o=ii(n),l="left";if(o){var s=uo(o,t.ch);l=s%2?"right":"left"}var a=rt(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function le(e,t){return t&&(e.bad=!0),e}function se(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return le(e.clipPos(zo(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return ae(o,t,r)}}function ae(e,t,r){function n(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=0>i?u.map:c[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var a=ti(0>i?e.line:e.rest[i]),h=o[l]+n;
return(0>n||s!=t)&&(h=o[l+(n?1:0)]),zo(a,h)}}}var i=e.text.firstChild,o=!1;if(!t||!Yl(i,t))return le(zo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?Di(e.rest):e.line;return le(zo(ti(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,h=n(s,a,r);if(h)return le(h,o);for(var f=a.nextSibling,d=s?s.nodeValue.length-r:0;f;f=f.nextSibling){if(h=n(f,f.firstChild,0))return le(zo(h.line,h.ch-d),o);d+=f.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(h=n(p,p.firstChild,-1))return le(zo(h.line,h.ch+d),o);d+=f.textContent.length}}function ue(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var c,h=t.getAttribute("cm-marker");if(h){var f=e.findMarks(zo(n,0),zo(i+1,0),o(+h));return void(f.length&&(c=f[0].find())&&(s+=Qn(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(a=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;a&&(s+=u,a=!1),s+=p}}for(var s="",a=!1,u=e.doc.lineSeparator();l(t),t!=r;)t=t.nextSibling;return s}function ce(e,t){this.ranges=e,this.primIndex=t}function he(e,t){this.anchor=e,this.head=t}function fe(e,t){var r=e[t];e.sort(function(e,t){return Fo(e.from(),t.from())}),t=Hi(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(Fo(o.to(),i.from())>=0){var l=$(o.from(),i.from()),s=_(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new he(a?s:l,a?l:s))}}return new ce(e,t)}function de(e,t){return new ce([new he(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.line<e.first)return zo(e.first,0);var r=e.first+e.size-1;return t.line>r?zo(r,Zn(e,r).text.length):ve(t,Zn(e,t.line).text.length)}function ve(e,t){var r=e.ch;return null==r||r>t?zo(e.line,t):0>r?zo(e.line,0):e}function me(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ge(e,t[n]);return r}function be(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=Fo(r,i)<0;o!=Fo(n,i)<0?(i=r,r=n):o!=Fo(r,n)<0&&(r=n)}return new he(i,r)}return new he(n||r,r)}function we(e,t,r,n){ke(e,new ce([be(e,e.sel.primary(),t,r)],0),n)}function xe(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=be(e,e.sel.ranges[i],t[i],null);var o=fe(n,e.sel.primIndex);ke(e,o,r)}function Ce(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ke(e,fe(i,e.sel.primIndex),n)}function Se(e,t,r,n){ke(e,de(t,r),n)}function Le(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new he(ge(e,t[r].anchor),ge(e,t[r].head))},origin:r&&r.origin};return Dl(e,"beforeSelectionChange",e,n),e.cm&&Dl(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?fe(n.ranges,n.ranges.length-1):t}function Te(e,t,r){var n=e.history.done,i=Di(n);i&&i.ranges?(n[n.length-1]=t,Me(e,t,r)):ke(e,t,r)}function ke(e,t,r){Me(e,t,r),hi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Me(e,t,r){(Ni(e,"beforeSelectionChange")||e.cm&&Ni(e.cm,"beforeSelectionChange"))&&(t=Le(e,t,r));var n=r&&r.bias||(Fo(t.primary().head,e.sel.primary().head)<0?-1:1);Ne(e,Ae(e,t,n,!0)),r&&r.scroll===!1||!e.cm||zr(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mi(e.cm)),Li(e,"cursorActivity",e))}function We(e){Ne(e,Ae(e,e.sel,null,!1),Il)}function Ae(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=De(e,l.anchor,s&&s.anchor,r,n),u=De(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new he(a,u))}return i?fe(i,t.primIndex):t}function Oe(e,t,r,n,i){var o=Zn(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(Dl(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u,c=a.find(0>n?1:-1);if((0>n?a.inclusiveRight:a.inclusiveLeft)&&(c=He(e,c,-n,o)),c&&c.line==t.line&&(u=Fo(c,r))&&(0>n?0>u:u>0))return Oe(e,c,t,n,i)}var h=a.find(0>n?-1:1);return(0>n?a.inclusiveLeft:a.inclusiveRight)&&(h=He(e,h,n,o)),h?Oe(e,h,t,n,i):null}}return t}function De(e,t,r,n,i){var o=n||1,l=Oe(e,t,r,o,i)||!i&&Oe(e,t,r,o,!0)||Oe(e,t,r,-o,i)||!i&&Oe(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,zo(e.first,0))}function He(e,t,r,n){return 0>r&&0==t.ch?t.line>e.first?ge(e,zo(t.line-1)):null:r>0&&t.ch==(n||Zn(e,t.line)).text.length?t.line<e.first+e.size-1?zo(t.line+1,0):null:new zo(t.line,t.ch+r)}function Pe(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ee(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t!==!1||l!=r.sel.primIndex){var s=r.sel.ranges[l],a=s.empty();(a||e.options.showCursorWhenSelecting)&&Ie(e,s.head,i),a||ze(e,s,o)}return n}function Ie(e,t,r){var n=dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(Ui("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(Ui("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function ze(e,t,r){function n(e,t,r,n){0>t&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Ui("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ft(e,zo(t,r),"div",h,n)}var s,a,h=Zn(l,t),f=h.text.length;return eo(ii(h),r||0,null==i?f:i,function(e,t,l){var h,d,p,g=o(e,"left");if(e==t)h=g,d=p=g.left;else{if(h=o(t-1,"right"),"rtl"==l){var v=g;g=h,h=v}d=g.left,p=h.right}null==r&&0==e&&(d=u),h.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottom<h.top&&n(d,g.bottom,null,h.top)),null==i&&t==f&&(p=c),(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g),(!a||h.bottom>a.bottom||h.bottom==a.bottom&&h.right>a.right)&&(a=h),u+1>d&&(d=u),n(d,h.top,p-d,h.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=je(e.display),u=a.left,c=Math.max(o.sizerWidth,Ye(e)-o.sizer.offsetLeft)-a.right,h=t.from(),f=t.to();if(h.line==f.line)i(h.line,h.ch,f.ch);else{var d=Zn(l,h.line),p=Zn(l,f.line),g=yn(d)==yn(p),v=i(h.line,h.ch,g?d.text.length+1:null).end,m=i(f.line,g?0:null,f.ch).start;g&&(v.top<m.top-2?(n(v.right,v.top,null,v.bottom),n(u,m.top,m.left,m.bottom)):n(v.right,v.top,m.left-v.right,v.bottom)),v.bottom<m.top&&n(u,v.bottom,null,m.top)}r.appendChild(s)}function Fe(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Fi(Be,e))}function Be(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=sl(t.mode,Ue(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength,a=Pn(e,o,s?sl(t.mode,n):n,!0);o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!h&&f<l.length;++f)h=l[f]!=o.styles[f];h&&i.push(t.frontier),o.stateAfter=s?n:sl(t.mode,n)}else o.text.length<=e.options.maxHighlightLength&&In(e,o.text,n),o.stateAfter=t.frontier%5==0?sl(t.mode,n):null;return++t.frontier,+new Date>r?(Re(e,e.options.workDelay),!0):void 0}),i.length&&Wt(e,function(){for(var t=0;t<i.length;t++)It(e,i[t],"text")})}}function Ge(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=Zn(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Rl(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Ue(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ge(e,t,r),l=o>n.first&&Zn(n,o-1).stateAfter;return l=l?sl(n.mode,l):al(n.mode),n.iter(o,t,function(r){In(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=s?sl(n.mode,l):null,++o}),r&&(n.frontier=o),l}function Ve(e){return e.lineSpace.offsetTop}function Ke(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function je(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ki(e.measure,Ui("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Xe(e){return Pl-e.display.nativeBarWidth}function Ye(e){return e.display.scroller.clientWidth-Xe(e)-e.display.barWidth}function _e(e){return e.display.scroller.clientHeight-Xe(e)-e.display.barHeight}function $e(e,t,r){var n=e.options.lineWrapping,i=n&&Ye(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qe(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var n=0;n<e.rest.length;n++)if(ti(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ze(e,t){t=yn(t);var r=ti(t),n=e.display.externalMeasured=new Ht(e.doc,t,r);n.lineN=r;var i=n.built=Fn(e,n);return n.text=i.pre,Ki(e.display.lineMeasure,i.pre),n}function Qe(e,t,r,n){return tt(e,et(e,t),r,n)}function Je(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ft(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function et(e,t){var r=ti(t),n=Je(e,r);n&&!n.text?n=null:n&&n.changes&&(E(e,n,r,H(e)),e.curOp.forceUpdate=!0),n||(n=Ze(e,t));var i=qe(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($e(e,t.view,t.rect),t.hasHeights=!0),o=nt(e,t,r,n),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function rt(e,t,r){for(var n,i,o,l,s=0;s<e.length;s+=3){var a=e[s],u=e[s+1];if(a>t?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)n=e[(s+=3)+2],l="right";break}}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:u}}function nt(e,t,r,n){var i,o=rt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;4>c;c++){for(;s&&Gi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&Gi(t.line.text.charAt(o.coverStart+a));)++a;if(bo&&9>wo&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var h=Vl(l,s,a).getClientRects();i=h.length?h["right"==n?h.length-1:0]:Vo}else i=Vl(l,s,a).getBoundingClientRect()||Vo;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}bo&&11>wo&&(i=it(e.display.measure,i))}else{s>0&&(u=n="right");var h;i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(bo&&9>wo&&!s&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+bt(e.display),top:f.top,bottom:f.bottom}:Vo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;c<v.length-1&&!(g<v[c]);c++);var m=c?v[c-1]:0,y=v[c],b={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:m,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=d,b.rbottom=p),b}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ji(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function lt(e){e.display.externalMeasure=null,Vi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function st(e){lt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function at(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ut(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ct(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Tn(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=ni(t);if("local"==n?l+=Ve(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:ut());var a=s.left+("window"==n?0:at());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function ht(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=at(),i-=ut();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function ft(e,t,r,n,i){return n||(n=Zn(e.doc,t.line)),ct(e,n,Qe(e,n,t.ch,i),r)}function dt(e,t,r,n,i,o){function l(t,l){var s=tt(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,ct(e,n,s,r)}function s(e,t){var r=a[t],n=r.level%2;return e==to(r)&&t&&r.level<a[t-1].level?(r=a[--t],e=ro(r)-(r.level%2?0:1),n=!0):e==ro(r)&&t<a.length-1&&r.level<a[t+1].level&&(r=a[++t],e=to(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?l(e-1):l(e,n)}n=n||Zn(e.doc,t.line),i||(i=et(e,n));var a=ii(n),u=t.ch;if(!a)return l(u);var c=uo(a,u),h=s(u,c);return null!=os&&(h.other=s(u,os)),h}function pt(e,t){var r=0,t=ge(e.doc,t);e.options.lineWrapping||(r=bt(e.display)*t.ch);var n=Zn(e.doc,t.line),i=ni(n)+Ve(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function gt(e,t,r,n){var i=zo(e,t);return i.xRel=n,r&&(i.outside=!0),i}function vt(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return gt(n.first,0,!0,-1);var i=ri(n,r),o=n.first+n.size-1;if(i>o)return gt(n.first+n.size-1,Zn(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Zn(n,i);;){var s=mt(e,l,i,t,r),a=vn(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=ti(l=u.to.line)}}function mt(e,t,r,n,i){function o(n){var i=dt(e,zo(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:l<i.top?i.left+a:(s=!1,i.left)}var l=i-ni(t),s=!1,a=2*e.display.wrapper.clientWidth,u=et(e,t),c=ii(t),h=t.text.length,f=no(t),d=io(t),p=o(f),g=s,v=o(d),m=s;if(n>v)return gt(r,d,m,1);for(;;){if(c?d==f||d==ho(t,f,1):1>=d-f){for(var y=p>n||v-n>=n-p?f:d,b=n-(y==f?p:v);Gi(t.text.charAt(y));)++y;var w=gt(r,y,y==f?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(h/2),C=f+x;if(c){C=f;for(var S=0;x>S;++S)C=ho(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),h=x):(f=C,p=L,g=s,h-=x)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Bo){Bo=Ui("pre");for(var t=0;49>t;++t)Bo.appendChild(document.createTextNode("x")),Bo.appendChild(Ui("br"));Bo.appendChild(document.createTextNode("x"))}Ki(e.measure,Bo);var r=Bo.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Vi(e.measure),r||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ui("span","xxxxxxxxxx"),r=Ui("pre",[t]);Ki(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++jo},Ko?Ko.ops.push(e.curOp):e.curOp.ownsGroup=Ko={ops:[e.curOp],delayedCallbacks:[]}}function xt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Ct(e){var t=e.curOp,r=t.ownsGroup;if(r)try{xt(r)}finally{Ko=null;for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;St(r)}}function St(e){for(var t=e.ops,r=0;r<t.length;r++)Lt(t[r]);for(var r=0;r<t.length;r++)Tt(t[r]);for(var r=0;r<t.length;r++)kt(t[r]);for(var r=0;r<t.length;r++)Mt(t[r]);for(var r=0;r<t.length;r++)Nt(t[r])}function Lt(e){var t=e.cm,r=t.display;k(t),e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function kt(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Xe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ye(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ir(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&A(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Fe(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),!e.focus||e.focus!=ji()||document.hasFocus&&!document.hasFocus()||q(e.cm)}function Nt(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&N(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,x(t)),e.scrollToPos){var i=Hr(t,ge(n,e.scrollToPos.from),ge(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Dr(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Dl(o[s],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Dl(l[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Dl(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wt(e,t){if(e.curOp)return t();wt(e);try{return t()}finally{Ct(e)}}function At(e,t){return function(){if(e.curOp)return t.apply(e,arguments);wt(e);try{return t.apply(e,arguments)}finally{Ct(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);wt(this);try{return e.apply(this,arguments)}finally{Ct(this)}}}function Dt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);wt(t);try{return e.apply(this,arguments)}finally{Ct(t)}}}function Ht(e,t,r){this.line=t,this.rest=bn(t),this.size=this.rest?ti(Di(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Cn(e,t)}function Pt(e,t,r){for(var n,i=[],o=t;r>o;o=n){var l=new Ht(e.doc,Zn(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Et(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Io&&wn(e.doc,t)<i.viewTo&&zt(e);else if(r<=i.viewFrom)Io&&xn(e.doc,r+n)>i.viewFrom?zt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zt(e);else if(t<=i.viewFrom){var o=Rt(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):zt(e)}else if(r>=i.viewTo){var o=Rt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):zt(e)}else{var l=Rt(e,t,t,-1),s=Rt(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Pt(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):zt(e)}var a=i.externalMeasured;a&&(r<a.lineN?a.lineN+=n:t<a.lineN+a.size&&(i.externalMeasured=null))}function It(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Ft(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Hi(l,r)&&l.push(r)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ft(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,0>t)return n}function Rt(e,t,r,n){var i,o=Ft(e,t),l=e.display.view;if(!Io||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;wn(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Bt(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Pt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ft(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Pt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Ft(e,r)))),n.viewTo=r}function Gt(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Ut(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;Wl(i.scroller,"mousedown",At(e,Yt)),bo&&11>wo?Wl(i.scroller,"dblclick",At(e,function(t){if(!ki(e,t)){var r=Xt(e,t);if(r&&!Qt(e,t)&&!jt(e.display,t)){kl(t);var n=e.findWordAt(r);we(e.doc,n.anchor,n.head)}}})):Wl(i.scroller,"dblclick",function(t){ki(e,t)||kl(t)}),Po||Wl(i.scroller,"contextmenu",function(t){yr(e,t)});var o,l={end:0};Wl(i.scroller,"touchstart",function(t){if(!ki(e,t)&&!r(t)){clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Wl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Wl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!jt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new he(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new he(zo(s.line,0),ge(e.doc,zo(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),kl(r)}t()}),Wl(i.scroller,"touchcancel",t),Wl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(nr(e,i.scroller.scrollTop),ir(e,i.scroller.scrollLeft,!0),Dl(e,"scroll",e))}),Wl(i.scroller,"mousewheel",function(t){or(e,t)}),Wl(i.scroller,"DOMMouseScroll",function(t){or(e,t)}),Wl(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){ki(e,t)||Nl(t)},over:function(t){ki(e,t)||(tr(e,t),Nl(t))},start:function(t){er(e,t)},drop:At(e,Jt),leave:function(){rr(e)}};var s=i.input.getField();Wl(s,"keyup",function(t){dr.call(e,t)}),Wl(s,"keydown",At(e,hr)),Wl(s,"keypress",At(e,pr)),Wl(s,"focus",Fi(vr,e)),Wl(s,"blur",Fi(mr,e))}function Vt(t,r,n){var i=n&&n!=e.Init;if(!r!=!i){var o=t.display.dragFunctions,l=r?Wl:Ol;l(t.display.scroller,"dragstart",o.start),l(t.display.scroller,"dragenter",o.enter),l(t.display.scroller,"dragover",o.over),l(t.display.scroller,"dragleave",o.leave),l(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function jt(e,t){for(var r=xi(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Xt(e,t,r,n){var i=e.display;if(!r&&"true"==xi(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=vt(e,o,l);if(n&&1==u.xRel&&(a=Zn(e.doc,u.line).text).length==u.ch){var c=Rl(a,a.length,e.options.tabSize)-a.length;u=zo(u.line,Math.max(0,Math.round((o-je(e.display).left)/bt(e.display))-c))}return u}function Yt(e){var t=this,r=t.display;if(!(ki(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.shift=e.shiftKey,jt(r,e))return void(xo||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Qt(t,e)){var n=Xt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):n?_t(t,e,n):xi(e)==r.scroller&&kl(e);break;case 2:xo&&(t.state.lastMiddleDown=+new Date),n&&we(t.doc,n),setTimeout(function(){r.input.focus()},20),kl(e);break;case 3:Po?yr(t,e):gr(t)}}}}function _t(e,t,r){bo?setTimeout(Fi(q,e),0):e.curOp.focus=ji();var n,i=+new Date;Uo&&Uo.time>i-400&&0==Fo(Uo.pos,r)?n="triple":Go&&Go.time>i-400&&0==Fo(Go.pos,r)?(n="double",Uo={time:i,pos:r}):(n="single",Go={time:i,pos:r});var o,l=e.doc.sel,s=Ao?t.metaKey:t.ctrlKey;e.options.dragDrop&&Jl&&!e.isReadOnly()&&"single"==n&&(o=l.contains(r))>-1&&(Fo((o=l.ranges[o]).from(),r)<0||r.xRel>0)&&(Fo(o.to(),r)>0||r.xRel<0)?$t(e,t,r,s):qt(e,t,r,n,s)}function $t(e,t,r,n){var i=e.display,o=+new Date,l=At(e,function(s){xo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ol(document,"mouseup",l),Ol(i.scroller,"drop",l),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(kl(s),!n&&+new Date-200<o&&we(e.doc,r),xo||bo&&9==wo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});xo&&(i.scroller.draggable=!0),e.state.draggingText=l,i.scroller.dragDrop&&i.scroller.dragDrop(),Wl(document,"mouseup",l),Wl(i.scroller,"drop",l)}function qt(e,t,r,n,i){function o(t){if(0!=Fo(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Rl(Zn(u,r.line).text,r.ch,o),s=Rl(Zn(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=Zn(u,p).text,y=Bl(m,a,o);a==d?i.push(new he(zo(p,y),zo(p,y))):m.length>y&&i.push(new he(zo(p,y),zo(p,Bl(m,d,o))))}i.length||i.push(new he(r,r)),ke(u,fe(f.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new he(zo(t.line,0),ge(u,zo(t.line+1,0)));Fo(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=_(b.to(),C.head))}var i=f.ranges.slice(0);i[h]=new he(ge(u,w),x),ke(u,fe(i,h),zl)}}function l(t){var r=++y,i=Xt(e,t,!0,"rect"==n);if(i)if(0!=Fo(i,v)){e.curOp.focus=ji(),o(i);var s=w(a,u);(i.line>=s.to||i.line<s.from)&&setTimeout(At(e,function(){y==r&&l(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(At(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,kl(t),a.input.focus(),Ol(document,"mousemove",b),Ol(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;kl(t);var c,h,f=u.sel,d=f.ranges;if(i&&!t.shiftKey?(h=u.sel.contains(r),c=h>-1?d[h]:new he(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),t.altKey)n="rect",i||(c=new he(r,r)),r=Xt(e,t,!0,!0),h=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?be(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new he(zo(r.line,0),ge(u,zo(r.line+1,0)));c=e.display.shift||u.extend?be(u,c,g.anchor,g.head):g}else c=be(u,c,r);i?-1==h?(h=d.length,ke(u,fe(d.concat([c]),h),{scroll:!1,origin:"*mouse"})):d.length>1&&d[h].empty()&&"single"==n&&!t.shiftKey?(ke(u,fe(d.slice(0,h).concat(d.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=u.sel):Ce(u,h,c,zl):(h=0,ke(u,new ce([c],0),zl),f=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=At(e,function(e){Ci(e)?l(e):s(e)}),x=At(e,s);e.state.selectingText=x,Wl(document,"mousemove",b),Wl(document,"mouseup",x)}function Zt(e,t,r,n){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&kl(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ni(e,r))return wi(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){var c=ri(e.doc,o),h=e.options.gutters[a];return Dl(e,r,e,c,h,t),wi(t)}}}function Qt(e,t){return Zt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(rr(t),!ki(t,e)&&!jt(t.display,e)){kl(e),bo&&(Xo=+new Date);var r=Xt(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=Hi(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=At(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=ge(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tr(t.doc,a),Te(t.doc,de(r,Qo(a)))}}),s.readAsText(e)}},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Ao?e.altKey:e.ctrlKey))var u=t.listSelections();if(Me(t.doc,de(r,r)),u)for(var a=0;a<u.length;++a)Or(t.doc,"",u[a].anchor,u[a].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function er(e,t){if(bo&&(!e.state.draggingText||+new Date-Xo<100))return void Nl(t);if(!ki(e,t)&&!jt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!To)){var r=Ui("img",null,null,"position: fixed; left: 0; top: 0;");
r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Lo&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Lo&&r.parentNode.removeChild(r)}}function tr(e,t){var r=Xt(e,t);if(r){var n=document.createDocumentFragment();Ie(e,r,n),e.display.dragCursor||(e.display.dragCursor=Ui("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ki(e.display.dragCursor,n)}}function rr(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,vo||W(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),vo&&W(e),Re(e,100))}function ir(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function or(e,t){var r=$o(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&Ao&&xo)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;h<c.length;h++)if(c[h].node==u){e.display.currentWheelTarget=u;break e}if(n&&!vo&&!Lo&&null!=_o)return i&&a&&nr(e,Math.max(0,Math.min(l.scrollTop+i*_o,l.scrollHeight-l.clientHeight))),ir(e,Math.max(0,Math.min(l.scrollLeft+n*_o,l.scrollWidth-l.clientWidth))),(!i||i&&a)&&kl(t),void(o.wheelStartX=null);if(i&&null!=_o){var f=i*_o,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;0>f?d=Math.max(0,d+f-50):p=Math.min(e.doc.height,p+f+50),W(e,{top:d,bottom:p})}20>Yo&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(_o=(_o*Yo+r)/(Yo+1),++Yo)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function lr(e,t,r){if("string"==typeof t&&(t=ul[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=El}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function sr(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=hl(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&hl(t,e.options.extraKeys,r,e)||hl(t,e.options.keyMap,r,e)}function ar(e,t,r,n){var i=e.state.keySeq;if(i){if(fl(t))return"handled";qo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=sr(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Li(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(kl(r),Fe(e)),i&&!o&&/\'$/.test(t)?(kl(r),!0):!!o}function ur(e,t){var r=dl(t,!0);return r?t.shiftKey&&!e.state.keySeq?ar(e,"Shift-"+r,t,function(t){return lr(e,t,!0)})||ar(e,r,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?lr(e,t):void 0}):ar(e,r,t,function(t){return lr(e,t)}):!1}function cr(e,t,r){return ar(e,"'"+r+"'",t,function(t){return lr(e,t,!0)})}function hr(e){var t=this;if(t.curOp.focus=ji(),!ki(t,e)){bo&&11>wo&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ur(t,e);Lo&&(Zo=n?r:null,!n&&88==r&&!rs&&(Ao?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fr(t)}}function fr(e){function t(e){18!=e.keyCode&&e.altKey||(ql(r,"CodeMirror-crosshair"),Ol(document,"keyup",t),Ol(document,"mouseover",t))}var r=e.display.lineDiv;Zl(r,"CodeMirror-crosshair"),Wl(document,"keyup",t),Wl(document,"mouseover",t)}function dr(e){16==e.keyCode&&(this.doc.sel.shift=!1),ki(this,e)}function pr(e){var t=this;if(!(jt(t.display,e)||ki(t,e)||e.ctrlKey&&!e.altKey||Ao&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Lo&&r==Zo)return Zo=null,void kl(e);if(!Lo||e.which&&!(e.which<10)||!ur(t,e)){var i=String.fromCharCode(null==n?r:n);cr(t,e,i)||t.display.input.onKeyPress(e)}}}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,mr(e))},100)}function vr(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Dl(e,"focus",e),e.state.focused=!0,Zl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),xo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fe(e))}function mr(e){e.state.delayingBlurEvent||(e.state.focused&&(Dl(e,"blur",e),e.state.focused=!1,ql(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function yr(e,t){jt(e.display,t)||br(e,t)||ki(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function br(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wr(e,t){if(Fo(e,t.from)<0)return e;if(Fo(e,t.to)<=0)return Qo(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Qo(t).ch-t.to.ch),zo(r,n)}function xr(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new he(wr(i.anchor,t),wr(i.head,t)))}return fe(r,e.sel.primIndex)}function Cr(e,t,r){return e.line==t.line?zo(r.line,e.ch-t.ch+r.ch):zo(r.line+(e.line-t.line),e.ch)}function Sr(e,t,r){for(var n=[],i=zo(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Cr(s.from,i,o),u=Cr(Qo(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],h=Fo(c.head,c.anchor)<0;n[l]=new he(h?u:a,h?a:u)}else n[l]=new he(a,a)}return new ce(n,e.sel.primIndex)}function Lr(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=ge(e,t)),r&&(this.to=ge(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),Dl(e,"beforeChange",e,n),e.cm&&Dl(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Tr(e,t,r){if(e.cm){if(!e.cm.curOp)return At(e.cm,Tr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"))||(t=Lr(e,t,!0))){var n=Eo&&!r&&an(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)kr(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else kr(e,t)}}function kr(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Fo(t.from,t.to)){var r=xr(e,t);ui(e,t,r,e.cm?e.cm.curOp.id:NaN),Wr(e,t,r,on(e,t));var n=[];$n(e,function(e,r){r||-1!=Hi(n,e.history)||(bi(e.history,t),n.push(e.history)),Wr(e,t,null,on(e,t))})}}function Mr(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;n=l.pop(),n.ranges;){if(fi(n,s),r&&!n.equals(e.sel))return void ke(e,n,{clearRedo:!1});o=n}var u=[];fi(o,s),s.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"),a=n.changes.length-1;a>=0;--a){var h=n.changes[a];if(h.origin=t,c&&!Lr(e,h,!1))return void(l.length=0);u.push(li(e,h));var f=a?xr(e,h):Di(l);Wr(e,h,f,sn(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Qo(h)});var d=[];$n(e,function(e,t){t||-1!=Hi(d,e.history)||(bi(e.history,h),d.push(e.history)),Wr(e,h,null,sn(e,h))})}}}}function Nr(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Pi(e.sel.ranges,function(e){return new he(zo(e.anchor.line+t,e.anchor.ch),zo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Et(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)It(e.cm,n,"gutter")}}function Wr(e,t,r,n){if(e.cm&&!e.cm.curOp)return At(e.cm,Wr)(e,t,r,n);if(t.to.line<e.first)return void Nr(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Nr(e,i),t={from:zo(e.first,0),to:zo(t.to.line+i,t.to.ch),text:[Di(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:zo(o,Zn(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qn(e,t.from,t.to),r||(r=xr(e,t)),e.cm?Ar(e.cm,t,n):Xn(e,t,n),Me(e,r,Il)}}function Ar(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=ti(yn(Zn(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&Mi(e),Xn(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=h(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),Re(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Et(e):l.line!=s.line||1!=t.text.length||jn(e.doc,t)?Et(e,l.line,s.line+1,c):It(e,l.line,"text");var f=Ni(e,"changes"),d=Ni(e,"change");if(d||f){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&Li(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function Or(e,t,r,n,i){if(n||(n=r),Fo(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Tr(e,{from:r,to:n,text:t,origin:i})}function Dr(e,t){if(!ki(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=Ui("div","",null,"position: absolute; top: "+(t.top-r.viewOffset-Ve(e.display))+"px; height: "+(t.bottom-t.top+Xe(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Hr(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=dt(e,t),s=r&&r!=t?dt(e,r):l,a=Er(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(nr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(ir(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function Pr(e,t,r,n,i){var o=Er(e,t,r,n,i);null!=o.scrollTop&&nr(e,o.scrollTop),null!=o.scrollLeft&&ir(e,o.scrollLeft)}function Er(e,t,r,n,i){var o=e.display,l=yt(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=_e(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Ke(o),h=l>r,f=i>c-l;if(s>r)u.scrollTop=h?0:r;else if(i>s+a){var d=Math.min(r,(f?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ye(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Ir(e,t,r){null==t&&null==r||Fr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function zr(e){Fr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?zo(t.line,t.ch-1):t,n=zo(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Fr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=pt(e,t.from),n=pt(e,t.to),i=Er(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Rr(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ue(e,t):r="prev");var l=e.options.tabSize,s=Zn(o,t),a=Rl(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==El||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Rl(Zn(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)f+=l,h+=" ";if(u>f&&(h+=Oi(u-f)),h!=c)return Or(o,h,zo(t,0),zo(t,c.length),"+input"),s.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<c.length){var f=zo(t,c.length);Ce(o,d,new he(f,f));break}}}function Br(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Zn(e,pe(e,t)):i=ti(t),null==i?null:(n(o,i)&&e.cm&&It(e.cm,i,r),o)}function Gr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&Fo(o.from,Di(n).to)<=0;){var l=n.pop();if(Fo(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Wt(e,function(){for(var t=n.length-1;t>=0;t--)Or(e.doc,"",n[t].from,n[t].to,"+delete");zr(e)})}function Ur(e,t,r,n,i){function o(){var t=s+r;return t<e.first||t>=e.first+e.size?!1:(s=t,c=Zn(e,t))}function l(e){var t=(i?ho:fo)(c,a,r,!0);if(null==t){if(e||!o())return!1;a=i?(0>r?io:no)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Zn(e,s);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,f="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>r)||l(!p);p=!1){var g=c.text.charAt(a)||"\n",v=Ri(g,d)?"w":f&&"\n"==g?"n":!f||/\s/.test(g)?null:"p";if(!f||p||v||(v="s"),h&&h!=v){0>r&&(r=1,l());break}if(v&&(h=v),r>0&&!l(!p))break}var m=De(e,zo(s,a),t,u,!0);return Fo(t,m)||(m.hitSide=!0),m}function Vr(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*yt(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=vt(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Kr(t,r,n,i){e.defaults[t]=r,n&&(el[t]=i?function(e,t,r){r!=tl&&n(e,t,r)}:n)}function jr(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Xr(e){return"string"==typeof e?cl[e]:e}function Yr(e,t,r,n,i){if(n&&n.shared)return _r(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return At(e.cm,Yr)(e,t,r,n,i);var o=new vl(e,i),l=Fo(t,r);if(n&&zi(n,o,!1),l>0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ui("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mn(e,t.line,t,r,o)||t.line!=r.line&&mn(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Io=!0}o.addToHistory&&ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&yn(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&ei(e,0),tn(e,new Qr(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Cn(e,t)&&ei(t,0)}),o.clearOnEnter&&Wl(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++gl,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Et(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)It(u,c,"text");o.atomic&&We(u.doc),Li(u,"markerAdded",u,o)}return o}function _r(e,t,r,n,i){n=zi(n),n.shared=!1;var o=[Yr(e,t,r,n,i)],l=o[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Yr(e,ge(e,t),ge(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=Di(o)}),new ml(o,l)}function $r(e){return e.findMarks(zo(e.first,0),e.clipPos(zo(e.lastLine())),function(e){return e.parent})}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(Fo(o,l)){var s=Yr(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Zr(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];$n(r.primary.doc,function(e){n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==Hi(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function Qr(e,t,r){this.marker=e,this.from=t,this.to=r}function Jr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function en(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function rn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Qr(l,o.from,a?null:o.to))}}return n}function nn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Qr(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}function on(e,t){if(t.full)return null;var r=me(e,t.from.line)&&Zn(e,t.from.line).markedSpans,n=me(e,t.to.line)&&Zn(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==Fo(t.from,t.to),s=rn(r,i,l),a=nn(n,o,l),u=1==t.text.length,c=Di(t.text).length+(u?i:0);if(s)for(var h=0;h<s.length;++h){var f=s[h];if(null==f.to){var d=Jr(a,f.marker);d?u&&(f.to=null==d.to?null:d.to+c):f.to=i}}if(a)for(var h=0;h<a.length;++h){var f=a[h];if(null!=f.to&&(f.to+=c),null==f.from){var d=Jr(s,f.marker);d||(f.from=c,u&&(s||(s=[])).push(f))}else f.from+=c,u&&(s||(s=[])).push(f)}s&&(s=ln(s)),a&&a!=s&&(a=ln(a));var p=[s];if(!u){var g,v=t.text.length-2;if(v>0&&s)for(var h=0;h<s.length;++h)null==s[h].to&&(g||(g=[])).push(new Qr(s[h].marker,null,null));for(var h=0;v>h;++h)p.push(g);p.push(a)}return p}function ln(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function sn(e,t){var r=gi(e,t),n=on(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function an(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=Hi(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(Fo(u.to,s.from)<0||Fo(u.from,s.to)>0)){var c=[a,1],h=Fo(u.from,s.from),f=Fo(u.to,s.to);(0>h||!l.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(f>0||!l.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function un(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function cn(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function hn(e){return e.inclusiveLeft?-1:0}function fn(e){return e.inclusiveRight?1:0}function dn(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=Fo(n.from,i.from)||hn(e)-hn(t);if(o)return-o;var l=Fo(n.to,i.to)||fn(e)-fn(t);return l?l:t.id-e.id}function pn(e,t){var r,n=Io&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||dn(r,i.marker)<0)&&(r=i.marker);return r}function gn(e){return pn(e,!0)}function vn(e){return pn(e,!1)}function mn(e,t,r,n,i){var o=Zn(e,t),l=Io&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=Fo(u.from,r)||hn(a.marker)-hn(i),h=Fo(u.to,n)||fn(a.marker)-fn(i);if(!(c>=0&&0>=h||0>=c&&h>=0)&&(0>=c&&(Fo(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Fo(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yn(e){for(var t;t=gn(e);)e=t.find(-1,!0).line;return e}function bn(e){for(var t,r;t=vn(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function wn(e,t){var r=Zn(e,t),n=yn(r);return r==n?t:ti(n)}function xn(e,t){if(t>e.lastLine())return t;var r,n=Zn(e,t);if(!Cn(e,n))return t;for(;r=vn(n);)n=r.find(1,!0).line;return ti(n)+1}function Cn(e,t){var r=Io&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Sn(e,t,n))return!0}}function Sn(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Sn(e,n.line,Jr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Sn(e,t,i))return!0}function Ln(e,t,r){ni(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ir(e,null,r)}function Tn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Yl(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Ki(t.display.measure,Ui("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t,r,n){var i=new yl(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Br(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Cn(e,t)){var n=ni(t)<e.scrollTop;ei(t,t.height+Tn(i)),n&&Ir(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Mn(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),un(e),cn(e,r);var i=n?n(e):1;i!=e.height&&ei(e,i)}function Nn(e){e.parent=null,un(e)}function Wn(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function An(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var n=e.innerMode(t,r);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function On(t,r,n,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function Dn(e,t,r,n){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?sl(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=ge(l,t);var a,u=Zn(l,t.line),c=Ue(e,t.line,r),h=new pl(u.text,e.options.tabSize);for(n&&(a=[]);(n||h.pos<t.ch)&&!h.eol();)h.start=h.pos,o=On(s,h,c),n&&a.push(i(!0));return n?a:i()}function Hn(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,h=new pl(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&Wn(An(r,n),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,l&&In(e,t,n,h.pos),h.pos=t.length,a=null):a=Wn(On(r,h,n,f),o),f){var d=f[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<h.start;)u=Math.min(h.start,u+5e4),i(u,c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e4);i(p,c),u=p}}function Pn(e,t,r,n){var i=[e.state.modeGen],o={};Hn(e,t.text,e.doc.mode,r,function(e,t){i.push(e,t)},o,n);for(var l=0;l<e.state.overlays.length;++l){var s=e.state.overlays[l],a=1,u=0;Hn(e,t.text,s.mode,!0,function(e,t){for(var r=a;e>u;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function En(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ue(e,ti(t)),i=Pn(e,t,t.text.length>e.options.maxHighlightLength?sl(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function In(e,t,r,n){var i=e.doc.mode,o=new pl(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&An(i,r);!o.eol();)On(i,o,r),o.start=o.pos}function zn(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?xl:wl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Fn(e,t){var r=Ui("span",null,null,xo?"padding-right: .1px":null),n={pre:Ui("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(bo||xo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Bn,Qi(e.display.measure)&&(o=ii(l))&&(n.addToken=Un(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&ti(l);Kn(l,n,En(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Yi(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Yi(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return xo&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Dl(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Yi(n.pre.className,n.textClass||"")),n}function Rn(e){var t=Ui("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,r,n,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Gn):t,a=e.cm.state.specialChars,u=!1;if(a.test(t))for(var c=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var f=a.exec(t),d=f?f.index-h:t.length-h;if(d){var p=document.createTextNode(s.slice(h,h+d));bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!f)break;if(h+=d+1," "==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g,p=c.appendChild(Ui("span",Oi(v),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=v}else if("\r"==f[0]||"\n"==f[0]){var p=c.appendChild(Ui("span","\r"==f[0]?"␍":"","cm-invalidchar"));p.setAttribute("cm-text",f[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(f[0]);p.setAttribute("cm-text",f[0]),bo&&9>wo?c.appendChild(Ui("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bo&&9>wo&&(u=!0),e.pos+=t.length}if(r||n||i||u||l){var m=r||"";n&&(m+=n),i&&(m+=i);var y=Ui("span",[c],m,l);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function Gn(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}function Un(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=0;h<t.length;h++){var f=t[h];if(f.to>u&&f.from<=u)break}if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function Vn(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Kn(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=h=s="",f=null,m=1/0;for(var y,b=[],w=0;w<n.length;++w){var x=n[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?b.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(y||(y=[])).push(C.endStyle,x.to),C.title&&!h&&(h=C.title),C.collapsed&&(!f||dn(f.marker,C)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(y)for(var w=0;w<y.length;w+=2)y[w+1]==m&&(u+=" "+y[w]);if(!f||f.from==p)for(var w=0;w<b.length;++w)Vn(t,0,b[w]);if(f&&(f.from||0)==p){if(Vn(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var S=Math.min(d,m);;){if(v){var L=p+v.length;if(!f){var T=L>S?v.slice(0,S-p):v;t.addToken(t,T,l?l+a:a,c,p+T.length==m?u:"",h,s)}if(L>=S){v=v.slice(S-p),p=S;break}p=L,c=""}v=i.slice(o,o=r[g++]),l=zn(r[g++],t.cm.options)}}else for(var g=1;g<r.length;g+=2)t.addToken(t,i.slice(o,o=r[g]),zn(r[g+1],t.cm.options))}function jn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Di(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Xn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){Mn(e,r,i,n),Li(e,"change",e,t)}function l(e,t){for(var r=e,o=[];t>r;++r)o.push(new bl(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Zn(e,s.line),h=Zn(e,a.line),f=Di(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(jn(e,t)){var g=l(0,u.length-1);o(h,h.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new bl(f+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(h,f+h.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Li(e,"change",e,t)}function Yn(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function _n(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}function $n(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),n(s.doc,e,a))}}}n(e,null,!0)}function qn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,l(e),r(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,Et(e)}function Zn(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function Qn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Jn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function ei(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function ti(e){if(null==e.parent)return null;for(var t=e.parent,r=Hi(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ri(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(o>t){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;n<e.lines.length;++n){var l=e.lines[n],s=l.height;if(s>t)break;t-=s}return r+n}function ni(e){e=yn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var n=0;n<o.children.length;++n){
var l=o.children[n];if(l==r)break;t+=l.height}return t}function ii(e){var t=e.order;return null==t&&(t=e.order=ls(e.text)),t}function oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function li(e,t){var r={from:Y(t.from),to:Qo(t),text:Qn(e,t.from,t.to)};return di(e,r,t.from.line,t.to.line+1),$n(e,function(e){di(e,r,t.from.line,t.to.line+1)},!0),r}function si(e){for(;e.length;){var t=Di(e);if(!t.ranges)break;e.pop()}}function ai(e,t){return t?(si(e.done),Di(e.done)):e.done.length&&!Di(e.done).ranges?Di(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Di(e.done)):void 0}function ui(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==n))){var s=Di(o.changes);0==Fo(t.from,t.to)&&0==Fo(t.from,s.to)?s.to=Qo(t):o.changes.push(li(e,t))}else{var a=Di(i.done);for(a&&a.ranges||fi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Dl(e,"historyAdded")}function ci(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function hi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ci(e,o,Di(i.done),t))?i.done[i.done.length-1]=t:fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&si(i.undone)}function fi(e,t){var r=Di(t);r&&r.ranges&&r.equals(e)||t.push(e)}function di(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function gi(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(pi(r[n]));return i}function vi(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?ce.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];i.push({changes:s});for(var a=0;a<l.length;++a){var u,c=l[a];if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&Hi(t,Number(u[1]))>-1&&(Di(s)[h]=c[h],delete c[h])}}}return i}function mi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function yi(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)mi(o.ranges[s].anchor,t,r,n),mi(o.ranges[s].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var a=o.changes[s];if(r<a.from.line)a.from=zo(a.from.line+n,a.from.ch),a.to=zo(a.to.line+n,a.to.ch);else if(t<=a.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function bi(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;yi(e.done,r,n,i),yi(e.undone,r,n,i)}function wi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xi(e){return e.target||e.srcElement}function Ci(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Ao&&e.ctrlKey&&1==t&&(t=3),t}function Si(e,t,r){var n=e._handlers&&e._handlers[t];return r?n&&n.length>0?n.slice():Al:n||Al}function Li(e,t){function r(e){return function(){e.apply(null,o)}}var n=Si(e,t,!1);if(n.length){var i,o=Array.prototype.slice.call(arguments,2);Ko?i=Ko.delayedCallbacks:Hl?i=Hl:(i=Hl=[],setTimeout(Ti,0));for(var l=0;l<n.length;++l)i.push(r(n[l]))}}function Ti(){var e=Hl;Hl=null;for(var t=0;t<e.length;++t)e[t]()}function ki(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Dl(e,r||t.type,e,t),wi(t)||t.codemirrorIgnore}function Mi(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==Hi(r,t[n])&&r.push(t[n])}function Ni(e,t){return Si(e,t).length>0}function Wi(e){e.prototype.on=function(e,t){Wl(this,e,t)},e.prototype.off=function(e,t){Ol(this,e,t)}}function Ai(){this.id=null}function Oi(e){for(;Gl.length<=e;)Gl.push(Di(Gl)+" ");return Gl[e]}function Di(e){return e[e.length-1]}function Hi(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function Pi(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Ei(){}function Ii(e,t){var r;return Object.create?r=Object.create(e):(Ei.prototype=e,r=new Ei),t&&zi(t,r),r}function zi(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Fi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ri(e,t){return t?t.source.indexOf("\\w")>-1&&jl(e)?!0:t.test(e):jl(e)}function Bi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Gi(e){return e.charCodeAt(0)>=768&&Xl.test(e)}function Ui(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Vi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ki(e,t){return Vi(e).appendChild(t)}function ji(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Xi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Yi(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Xi(r[n]).test(t)&&(t+=" "+r[n]);return t}function _i(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function $i(){Ql||(qi(),Ql=!0)}function qi(){var e;Wl(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,_i(Kt)},100))}),Wl(window,"blur",function(){_i(mr)})}function Zi(e){if(null==_l){var t=Ui("span","");Ki(e,Ui("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(_l=t.offsetWidth<=1&&t.offsetHeight>2&&!(bo&&8>wo))}var r=_l?Ui("span",""):Ui("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Qi(e){if(null!=$l)return $l;var t=Ki(e,document.createTextNode("AخA")),r=Vl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Vl(t,1,2).getBoundingClientRect();return $l=n.right-r.right<3}function Ji(e){if(null!=ns)return ns;var t=Ki(e,Ui("span","x")),r=t.getBoundingClientRect(),n=Vl(t,0,1).getBoundingClientRect();return ns=Math.abs(r.left-n.left)>1}function eo(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function to(e){return e.level%2?e.to:e.from}function ro(e){return e.level%2?e.from:e.to}function no(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?ro(Di(t)):e.text.length}function oo(e,t){var r=Zn(e.doc,t),n=yn(r);n!=r&&(t=ti(n));var i=ii(n),o=i?i[0].level%2?io(n):no(n):0;return zo(t,o)}function lo(e,t){for(var r,n=Zn(e.doc,t);r=vn(n);)n=r.find(1,!0).line,t=null;var i=ii(n),o=i?i[0].level%2?no(n):io(n):n.text.length;return zo(null==t?ti(n):t,o)}function so(e,t){var r=oo(e,t.line),n=Zn(e.doc,r.line),i=ii(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return zo(r.line,l?0:o)}return r}function ao(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function uo(e,t){os=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return ao(e,i.level,e[r].level)?(i.from!=i.to&&(os=r),n):(i.from!=i.to&&(os=n),r);r=n}}return r}function co(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Gi(e.text.charAt(t)));return t}function ho(e,t,r,n){var i=ii(e);if(!i)return fo(e,t,r,n);for(var o=uo(i,t),l=i[o],s=co(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s<l.to)return s;if(s==l.from||s==l.to)return uo(i,s)==o?s:(l=i[o+=r],r>0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?co(e,l.to,-1,n):co(e,l.from,1,n)}}function fo(e,t,r,n){var i=t+r;if(n)for(;i>0&&Gi(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,go=navigator.platform,vo=/gecko\/\d/i.test(po),mo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),bo=mo||yo,wo=bo&&(mo?document.documentMode||6:yo[1]),xo=/WebKit\//.test(po),Co=xo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Lo=/Opera\//.test(po),To=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Wo=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Ao=No||/Mac/.test(go),Oo=/win/i.test(go),Do=Lo&&po.match(/Version\/(\d*\.\d*)/);Do&&(Do=Number(Do[1])),Do&&Do>=15&&(Lo=!1,xo=!0);var Ho=Ao&&(Co||Lo&&(null==Do||12.11>Do)),Po=vo||bo&&wo>=9,Eo=!1,Io=!1;g.prototype=zi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Ao&&!ko?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ai,this.disableVert=new Ai},enableZeroWidthBar:function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=zi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={native:g,null:v},T.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Dl.apply(null,this.events[e])};var zo=e.Pos=function(e,t){return this instanceof zo?(this.line=e,void(this.ch=t)):new zo(e,t)},Fo=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Ro=null;re.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=Ro.join("\n"),Ul(o));else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type?n.setSelections(t.ranges,null,Il):(r.prevInput="",o.value=t.text.join("\n"),Ul(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}}var r=this,n=this.cm,i=this.wrapper=ne(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),No&&(o.style.width="0px"),Wl(o,"input",function(){bo&&wo>=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),Wl(o,"paste",function(e){ki(n,e)||Q(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),Wl(o,"cut",t),Wl(o,"copy",t),Wl(e.scroller,"paste",function(t){jt(e,t)||ki(n,t)||(n.state.pasteIncoming=!0,r.focus())}),Wl(e.lineSpace,"selectstart",function(t){jt(e,t)||kl(t)}),Wl(o,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Wl(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Ee(e);if(e.options.moveInputWithCursor){var i=dt(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Ki(r.cursorDiv,e.cursors),Ki(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rs&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Ul(this.textarea),bo&&wo>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",bo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Wo||ji()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||ts(t)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(bo&&wo>=9&&this.hasSelection===n||Ao&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,n.length);l>o&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var s=this;return Wt(e,function(){Z(e,n.slice(o),r.length-o,null,s.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=n,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&wo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=""+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=h,l.style.cssText=c,bo&&9>wo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!bo||bo&&9>wo)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&""==n.prevInput?At(i,ul.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Xt(i,e),a=o.scroller.scrollTop;if(s&&!Lo){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&At(i,ke)(i.doc,de(s),Il);var c=l.style.cssText,h=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();if(l.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",xo)var d=window.scrollY;if(o.input.focus(),xo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bo&&wo>=9&&t(),Po){Nl(e);var p=function(){Ol(window,"mouseup",p),setTimeout(r,20)};Wl(window,"mouseup",p)}else setTimeout(r,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ei,needsContentAttribute:!1},re.prototype),ie.prototype=zi({init:function(e){function t(e){if(!ki(n,e)){if(n.somethingSelected())Ro=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ee(n);Ro=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Il),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ro.join("\n"));else{var r=ne(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Ro.join("\n");var o=document.activeElement;Ul(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}}var r=this,n=r.cm,i=r.div=e.lineDiv;te(i),Wl(i,"paste",function(e){ki(n,e)||Q(e,n)}),Wl(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=de(zo(i.head.line,l),zo(i.head.line,l+t.length)))}}),Wl(i,"compositionupdate",function(e){r.composing.data=e.data}),Wl(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),Wl(i,"touchstart",function(){r.forceCompositionEnd()}),Wl(i,"input",function(){r.composing||!n.isReadOnly()&&r.pollContent()||Wt(r.cm,function(){Et(n)})}),Wl(i,"copy",t),Wl(i,"cut",t)},prepareSelection:function(){var e=Ee(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=se(this.cm,e.anchorNode,e.anchorOffset),n=se(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Fo($(r,n),t.from())||0!=Fo(_(r,n),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Vl(i.node,i.offset,o.offset,o.node)}catch(h){}c&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ki(this.cm.display.cursorDiv,e.cursors),Ki(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Yl(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Wt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=se(t,e.anchorNode,e.anchorOffset),n=se(t,e.focusNode,e.focusOffset);r&&n&&Wt(t,function(){ke(t.doc,de(r,n),Il),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Ft(e,n.line)))var l=ti(t.view[0].line),s=t.view[0].node;else var l=ti(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Ft(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.lineDiv.lastChild;else var u=ti(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var h=e.doc.splitLines(ue(e,s,c,l,u)),f=Qn(e.doc,zo(l,0),zo(u,Zn(e.doc,u).text.length));h.length>1&&f.length>1;)if(Di(h)==Di(f))h.pop(),f.pop(),u--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),l++}for(var d=0,p=0,g=h[0],v=f[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=Di(h),b=Di(f),w=Math.min(y.length-(1==h.length?d:0),b.length-(1==f.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;h[h.length-1]=y.slice(0,y.length-p),h[0]=h[0].slice(d);var x=zo(l,d),C=zo(u,f.length?Di(f).length-p:0);return h.length>1||h[0]||Fo(x,C)?(Or(e.doc,h,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?At(this.cm,Et)(this.cm):e.data&&e.data!=e.startData&&At(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||At(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ei,resetPosition:Ei,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:re,contenteditable:ie},ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=Fo(r.anchor,n.anchor)||0!=Fo(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new he(Y(this.ranges[t].anchor),Y(this.ranges[t].head));return new ce(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Fo(t,n.from())>=0&&Fo(e,n.to())<=0)return r}return-1}},he.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return _(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Bo,Go,Uo,Vo={left:0,right:0,top:0,bottom:0},Ko=null,jo=0,Xo=0,Yo=0,_o=null;bo?_o=-.53:vo?_o=15:So?_o=-.7:To&&(_o=-1/3);var $o=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=$o(e);return t.x*=_o,t.y*=_o,t};var qo=new Ai,Zo=null,Qo=e.changeEnd=function(e){return e.text?zo(e.from.line+e.text.length-1,Di(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,el.hasOwnProperty(e)&&At(this,el[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Ot(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,Et(this)}),removeOverlay:Ot(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void Et(this)}}),indentLine:Ot(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),me(this.doc,e)&&Rr(this,e,t,r)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Rr(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&zr(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Rr(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&Ce(this.doc,n,new he(o,u[n].to()),Il)}}}),getTokenAt:function(e,t){return Dn(this,e,t)},getLineTokens:function(e,t){return Dn(this,zo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,r=En(this,Zn(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("cm-overlay "):-1;return 0>s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!ll.hasOwnProperty(t))return r;var n=ll[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var l=n[i[t][o]];l&&r.push(l)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var o=0;o<n._global.length;o++){var s=n._global[o];s.pred(i,this)&&-1==Hi(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=pe(r,null==e?r.first+r.size-1:e),Ue(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?ge(this.doc,e):e?n.from():n.to(),dt(this,r,t||"page")},charCoords:function(e,t){return ft(this,ge(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ht(this,e,t||"page"),vt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ht(this,{top:e,left:0},t||"page").top,ri(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=Zn(this.doc,e)}else r=e;return ct(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ni(r):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,r){return Br(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Bi(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,It(t,n,"gutter"),Bi(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!me(this.doc,e))return null;var t=e;if(e=Zn(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=dt(this,ge(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&Pr(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ot(hr),triggerOnKeyPress:Ot(pr),triggerOnKeyUp:dr,execCommand:function(e){return ul.hasOwnProperty(e)?ul[e].call(null,this):void 0},triggerElectric:Ot(function(e){J(this,e)}),findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=ge(this.doc,e);t>o&&(l=Ur(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ot(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Ur(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Fl)}),deleteH:Ot(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Gr(this,function(r){var i=Ur(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=ge(this.doc,e);t>l;++l){var a=dt(this,s,"div");if(null==o?o=a.left:a.left=o,s=Vr(this,a,i,r),s.hitSide)break}return s},moveV:Ot(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=dt(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Vr(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Ir(r,null,ft(r,a,"div").top-s.top),a},Fl),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,r=Zn(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var l=r.charAt(n),s=Ri(l,o)?function(e){return Ri(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ri(e)};n>0&&s(r.charAt(n-1));)--n;for(;i<r.length&&s(r.charAt(i));)++i}return new he(zo(e.line,n),zo(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Zl(this.display.cursorDiv,"CodeMirror-overwrite"):ql(this.display.cursorDiv,"CodeMirror-overwrite"),Dl(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ji()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit);
},scrollTo:Ot(function(e,t){null==e&&null==t||Fr(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Xe(this)-this.display.barHeight,width:e.scrollWidth-Xe(this)-this.display.barWidth,clientHeight:_e(this),clientWidth:Ye(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:zo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Fr(this),this.curOp.scrollToPos=e;else{var r=Er(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:Ot(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&<(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){It(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,Dl(n,"refresh",this)}),operation:function(e){return Wt(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;Et(this),this.curOp.forceUpdate=!0,st(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-yt(this.display))>.5)&&l(this),Dl(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,qn(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Li(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Wi(e);var Jo=e.defaults={},el=e.optionHandlers={},tl=e.Init={toString:function(){return"CodeMirror.Init"}};Kr("value","",function(e,t){e.setValue(t)},!0),Kr("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Kr("indentUnit",2,r,!0),Kr("indentWithTabs",!1),Kr("smartIndent",!0),Kr("tabSize",4,function(e){n(e),st(e),Et(e)},!0),Kr("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(zo(n,o))}n++});for(var i=r.length-1;i>=0;i--)Or(e.doc,t,r[i],zo(r[i].line,r[i].ch+t.length))}}),Kr("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,r,n){t.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),n!=e.Init&&t.refresh()}),Kr("specialCharPlaceholder",Rn,function(e){e.refresh()},!0),Kr("electricChars",!0),Kr("inputStyle",Wo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Kr("rtlMoveVisually",!Oo),Kr("wholeLineUpdateBefore",!0),Kr("theme","default",function(e){s(e),a(e)},!0),Kr("keyMap","default",function(t,r,n){var i=Xr(r),o=n!=e.Init&&Xr(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Kr("extraKeys",null),Kr("lineWrapping",!1,i,!0),Kr("gutters",[],function(e){d(e.options),a(e)},!0),Kr("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Kr("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Kr("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Kr("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Kr("firstLineNumber",1,a,!0),Kr("lineNumberFormatter",function(e){return e},a,!0),Kr("showCursorWhenSelecting",!1,Pe,!0),Kr("resetSelectionOnContextMenu",!0),Kr("lineWiseCopyCut",!0),Kr("readOnly",!1,function(e,t){"nocursor"==t?(mr(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Kr("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Kr("dragDrop",!0,Vt),Kr("allowDropFileTypes",null),Kr("cursorBlinkRate",530),Kr("cursorScrollMargin",0),Kr("cursorHeight",1,Pe,!0),Kr("singleCursorHeightPerLine",!0,Pe,!0),Kr("workTime",100),Kr("workDelay",100),Kr("flattenSpans",!0,n,!0),Kr("addModeClass",!1,n,!0),Kr("pollInterval",100),Kr("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Kr("historyEventDelay",1250),Kr("viewportMargin",10,function(e){e.refresh()},!0),Kr("maxHighlightLength",1e4,n,!0),Kr("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Kr("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Kr("autofocus",null);var rl=e.modes={},nl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),rl[t]=r},e.defineMIME=function(e,t){nl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&nl.hasOwnProperty(t))t=nl[t];else if(t&&"string"==typeof t.name&&nl.hasOwnProperty(t.name)){var r=nl[t.name];"string"==typeof r&&(r={name:r}),t=Ii(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=rl[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(il.hasOwnProperty(r.name)){var o=il[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var il=e.modeExtensions={};e.extendMode=function(e,t){var r=il.hasOwnProperty(e)?il[e]:il[e]={};zi(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){Sl.prototype[e]=t},e.defineOption=Kr;var ol=[];e.defineInitHook=function(e){ol.push(e)};var ll=e.helpers={};e.registerHelper=function(t,r,n){ll.hasOwnProperty(t)||(ll[t]=e[t]={_global:[]}),ll[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),ll[t]._global.push({pred:n,val:i})};var sl=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},al=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var ul=e.commands={selectAll:function(e){e.setSelection(zo(e.firstLine(),0),zo(e.lastLine()),Il)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Il)},killLine:function(e){Gr(e,function(t){if(t.empty()){var r=Zn(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:zo(t.head.line+1,0)}:{from:t.head,to:zo(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Gr(e,function(t){return{from:zo(t.from().line,0),to:ge(e.doc,zo(t.to().line+1,0))}})},delLineLeft:function(e){Gr(e,function(e){return{from:zo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){Gr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(zo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(zo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return so(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Fl)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Fl)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?so(e,t.head):n},Fl)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=Rl(e.getLine(o.line),o.ch,n);t.push(new Array(n-l%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Wt(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n].head,o=Zn(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new zo(i.line,i.ch-1)),i.ch>0)i=new zo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),zo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Zn(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),zo(i.line-1,l.length-1),zo(i.line,1),"+transpose")}r.push(new he(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Wt(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange(e.doc.lineSeparator(),n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0)}zr(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},cl=e.keyMap={};cl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},cl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cl.default=Ao?cl.macDefault:cl.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Pi(r.split(" "),jr),o=0;o<i.length;o++){var l,s;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e};var hl=e.lookupKey=function(e,t,r,n){t=Xr(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return hl(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=hl(e,t.fallthrough[o],r,n);if(l)return l}}},fl=e.isModifierKey=function(e){var t="string"==typeof e?e:is[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},dl=e.keyName=function(e,t){if(Lo&&34==e.keyCode&&e.char)return!1;var r=is[e.keyCode],n=r;return null==n||e.altGraphKey?!1:(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(Ho?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(Ho?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};e.fromTextArea=function(t,r){function n(){t.value=u.getValue()}if(r=r?zi(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var i=ji();r.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Wl(t.form,"submit",n),!r.leaveSubmitMethodAlone)){var o=t.form,l=o.submit;try{var s=o.submit=function(){n(),o.submit=l,o.submit(),o.submit=s}}catch(a){}}r.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ol(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=l))}},t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u};var pl=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};pl.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else var r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Rl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Rl(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Rl(this.string,null,this.tabSize)-(this.lineStart?Rl(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var gl=0,vl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};Wi(vl),vl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ni(this,"clear")){var r=this.find();r&&Li(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Jr(l.markedSpans,this);e&&!this.collapsed?It(e,ti(l),"text"):e&&(null!=s.to&&(i=ti(l)),null!=s.from&&(n=ti(l))),l.markedSpans=en(l.markedSpans,s),null==s.from&&this.collapsed&&!Cn(this.doc,l)&&e&&ei(l,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var a=yn(this.lines[o]),u=h(a);u>e.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Et(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&We(e.doc)),e&&Li(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},vl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=Jr(o.markedSpans,this);if(null!=l.from&&(r=zo(t?o:ti(o),l.from),-1==e))return r;if(null!=l.to&&(n=zo(t?o:ti(o),l.to),1==e))return n}return r&&{from:r,to:n}},vl.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&Wt(r,function(){var n=e.line,i=ti(e.line),o=Je(r,i);if(o&&(ot(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Cn(t.doc,n)&&null!=t.height){var l=t.height;t.height=null;var s=Tn(t)-l;s&&ei(n,n.height+s)}})},vl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Hi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vl.prototype.detachLine=function(e){if(this.lines.splice(Hi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var gl=0,ml=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Wi(ml),ml.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Li(this,"clear")}},ml.prototype.find=function(e,t){return this.primary.find(e,t)};var yl=e.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Wi(yl),yl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=ti(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Tn(this);ei(r,Math.max(0,r.height-o)),e&&Wt(e,function(){Ln(e,r,-o),It(e,n,"widget")})}},yl.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=Tn(this)-e;n&&(ei(r,r.height+n),t&&Wt(t,function(){t.curOp.forceUpdate=!0,Ln(t,r,n)}))};var bl=e.Line=function(e,t,r){this.text=e,cn(this,t),this.height=r?r(this):1};Wi(bl),bl.prototype.lineNo=function(){return ti(this)};var wl={},xl={};Yn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;n>r;++r){var i=this.lines[r];this.height-=i.height,Nn(i),Li(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;n>e;++e)if(r(this.lines[e]))return!0}},_n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(i>e){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Yn))){var s=[];this.collapse(s),this.children=[new Yn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Yn(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new _n(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Hi(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new _n(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>e){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var Cl=0,Sl=e.Doc=function(e,t,r,n){if(!(this instanceof Sl))return new Sl(e,t,r,n);null==r&&(r=0),_n.call(this,[new Yn([new bl("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=zo(r,0);this.sel=de(i),this.history=new oi(null),this.id=++Cl,this.modeOption=t,this.lineSep=n,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Xn(this,{from:i,to:i,text:e}),ke(this,de(i),Il)};Sl.prototype=Ii(_n.prototype,{constructor:Sl,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Jn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Dt(function(e){var t=zo(this.first,0),r=this.first+this.size-1;Tr(this,{from:t,to:zo(r,Zn(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),ke(this,de(t))}),replaceRange:function(e,t,r,n){t=ge(this,t),r=r?ge(this,r):t,Or(this,e,t,r,n)},getRange:function(e,t,r){var n=Qn(this,ge(this,e),ge(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return me(this,e)?Zn(this,e):void 0},getLineNumber:function(e){return ti(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Zn(this,e)),yn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ge(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Dt(function(e,t,r){Se(this,ge(this,"number"==typeof e?zo(e,t||0):e),null,r)}),setSelection:Dt(function(e,t,r){Se(this,ge(this,e),ge(this,t||e),r)}),extendSelection:Dt(function(e,t,r){we(this,ge(this,e),t&&ge(this,t),r)}),extendSelections:Dt(function(e,t){xe(this,ye(this,e),t)}),extendSelectionsBy:Dt(function(e,t){var r=Pi(this.sel.ranges,e);xe(this,ye(this,r),t)}),setSelections:Dt(function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new he(ge(this,e[n].anchor),ge(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ke(this,fe(i,t),r)}}),addSelection:Dt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new he(ge(this,e),ge(this,t||e))),ke(this,fe(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Qn(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Qn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:Dt(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&Sr(this,n,t),o=n.length-1;o>=0;o--)Tr(this,n[o]);s?Te(this,s):this.cm&&zr(this.cm)}),undo:Dt(function(){Mr(this,"undo")}),redo:Dt(function(){Mr(this,"redo")}),undoSelection:Dt(function(){Mr(this,"undo",!0)}),redoSelection:Dt(function(){Mr(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vi(this.history.done),undone:vi(this.history.undone)}},setHistory:function(e){var t=this.history=new oi(this.history.maxGeneration);t.done=vi(e.done.slice(0),null,!0),t.undone=vi(e.undone.slice(0),null,!0)},addLineClass:Dt(function(e,t,r){return Br(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Xi(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:Dt(function(e,t,r){return Br(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(Xi(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:Dt(function(e,t,r){return kn(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Yr(this,ge(this,e),ge(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ge(this,e),Yr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ge(this,e);var t=[],r=Zn(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ge(this,e),t=ge(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];i==e.line&&e.ch>a.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(n){var i=n.text.length+1;return i>e?(t=e,!0):(e-=i,void++r)}),ge(this,zo(r,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new Sl(Jn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Sl(Jn(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],qr(n,$r(this)),n},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),Zr($r(this));break}}if(t.history==this.history){var i=[t.id];$n(t,function(e){i.push(e.id)},!0),t.history=new oi(null),t.history.done=vi(this.history.done,i),t.history.undone=vi(this.history.undone,i)}},iterLinkedDocs:function(e){$n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):es(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Sl.prototype.eachLine=Sl.prototype.iter;var Ll="iter insert remove copy getEditor constructor".split(" ");for(var Tl in Sl.prototype)Sl.prototype.hasOwnProperty(Tl)&&Hi(Ll,Tl)<0&&(e.prototype[Tl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sl.prototype[Tl]));Wi(Sl);var kl=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Ml=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Nl=e.e_stop=function(e){kl(e),Ml(e)},Wl=e.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={}),i=n[t]||(n[t]=[]);i.push(r)}},Al=[],Ol=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else for(var n=Si(e,t,!1),i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}},Dl=e.signal=function(e,t){var r=Si(e,t,!0);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},Hl=null,Pl=30,El=e.Pass={toString:function(){return"CodeMirror.Pass"}},Il={scroll:!1},zl={origin:"*mouse"},Fl={origin:"+move"};Ai.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Rl=e.countColumn=function(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,l=i||0;;){var s=e.indexOf(" ",o);if(0>s||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Bl=e.findColumn=function(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}},Gl=[""],Ul=function(e){e.select()};No?Ul=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(Ul=function(e){try{e.select()}catch(t){}});var Vl,Kl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jl=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Kl.test(e));
},Xl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Vl=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Yl=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};bo&&11>wo&&(ji=function(){try{return document.activeElement}catch(e){return document.body}});var _l,$l,ql=e.rmClass=function(e,t){var r=e.className,n=Xi(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Zl=e.addClass=function(e,t){var r=e.className;Xi(t).test(r)||(e.className+=(r?" ":"")+t)},Ql=!1,Jl=function(){if(bo&&9>wo)return!1;var e=Ui("div");return"draggable"in e||"dragDrop"in e}(),es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},ts=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rs=function(){var e=Ui("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ns=null,is=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var os,ls=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,h=[],f=0;c>f;++f)h.push(n=e(r.charCodeAt(f)));for(var f=0,d=u;c>f;++f){var n=h[f];"m"==n?h[f]=d:d=n}for(var f=0,p=u;c>f;++f){var n=h[f];"1"==n&&"r"==p?h[f]="n":l.test(n)&&(p=n,"r"==n&&(h[f]="R"))}for(var f=1,d=h[0];c-1>f;++f){var n=h[f];"+"==n&&"1"==d&&"1"==h[f+1]?h[f]="1":","!=n||d!=h[f+1]||"1"!=d&&"n"!=d||(h[f]=d),d=n}for(var f=0;c>f;++f){var n=h[f];if(","==n)h[f]="N";else if("%"==n){for(var g=f+1;c>g&&"%"==h[g];++g);for(var v=f&&"!"==h[f-1]||c>g&&"1"==h[g]?"1":"N",m=f;g>m;++m)h[m]=v;f=g-1}}for(var f=0,p=u;c>f;++f){var n=h[f];"L"==p&&"1"==n?h[f]="L":l.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(h[f])){for(var g=f+1;c>g&&o.test(h[g]);++g);for(var y="L"==(f?h[f-1]:u),b="L"==(c>g?h[g]:u),v=y||b?"L":"R",m=f;g>m;++m)h[m]=v;f=g-1}for(var w,x=[],f=0;c>f;)if(s.test(h[f])){var C=f;for(++f;c>f&&s.test(h[f]);++f);x.push(new t(0,C,f))}else{var S=f,L=x.length;for(++f;c>f&&"L"!=h[f];++f);for(var m=S;f>m;)if(a.test(h[m])){m>S&&x.splice(L,0,new t(1,S,m));var T=m;for(++m;f>m&&a.test(h[m]);++m);x.splice(L,0,new t(2,T,m)),S=m}else++m;f>S&&x.splice(L,0,new t(1,S,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==Di(x).level&&(w=r.match(/\s+$/))&&(Di(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),2==x[0].level&&x.unshift(new t(1,x[0].to,x[0].to)),x[0].level!=Di(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.12.0",e})},{}],60:[function(require,module,exports){!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function a(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return he=e,we=r,t}function o(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=c(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(r.tokenize=u,u(e,r)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,r,1)?(a(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Ae),i("operator","operator",e.current()));if("`"==n)return r.tokenize=l,l(e,r);if("#"==n)return e.skipToEnd(),i("error","error");if(Ae.test(n))return e.eatWhile(Ae),i("operator","operator",e.current());if(Ie.test(n)){e.eatWhile(Ie);var o=e.current(),s=ze.propertyIsEnumerable(o)&&ze[o];return s&&"."!=r.lastType?i(s.type,s.style,o):i("variable","variable",o)}}function c(e){return function(t,r){var n,a=!1;if(Me&&"@"==t.peek()&&t.match(Te))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function u(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function s(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=$e.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(Ie.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,a){var i=e.cc;for(Ce.state=e,Ce.stream=a,Ce.marked=null,Ce.cc=i,Ce.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():Ve?j:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return Ce.marked?Ce.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)Ce.cc.push(arguments[e])}function v(){return m.apply(null,arguments),!0}function y(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=Ce.state;if(Ce.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function k(){Ce.state.context={prev:Ce.state.context,vars:Ce.state.localVars},Ce.state.localVars=We}function b(){Ce.state.localVars=Ce.state.context.vars,Ce.state.context=Ce.state.context.prev}function x(e,t){var r=function(){var r=Ce.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,Ce.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function h(){var e=Ce.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?v():";"==e?m():v(t)}return t}function g(e,t){return"var"==e?v(x("vardef",t.length),Q,w(";"),h):"keyword a"==e?v(x("form"),j,g,h):"keyword b"==e?v(x("form"),g,h):"{"==e?v(x("}"),G,h):";"==e?v():"if"==e?("else"==Ce.state.lexical.info&&Ce.state.cc[Ce.state.cc.length-1]==h&&Ce.state.cc.pop()(),v(x("form"),j,g,h,_)):"function"==e?v(ie):"for"==e?v(x("form"),ee,g,h):"variable"==e?v(x("stat"),S):"switch"==e?v(x("form"),j,x("}","switch"),w("{"),G,h,h):"case"==e?v(j,w(":")):"default"==e?v(w(":")):"catch"==e?v(x("form"),k,w("("),oe,w(")"),g,h,b):"class"==e?v(x("form"),ce,h):"export"==e?v(x("stat"),fe,h):"import"==e?v(x("stat"),de,h):"module"==e?v(x("form"),R,x("}"),w("{"),G,h,h):m(x("stat"),j,w(";"),h)}function j(e){return V(e,!1)}function M(e){return V(e,!0)}function V(e,t){if(Ce.state.fatArrowAt==Ce.stream.start){var r=t?C:q;if("("==e)return v(k,x(")"),D(R,")"),h,w("=>"),r,b);if("variable"==e)return m(k,R,w("=>"),r,b)}var n=t?A:z;return qe.hasOwnProperty(e)?v(n):"function"==e?v(ie,n):"keyword c"==e?v(t?I:E):"("==e?v(x(")"),E,be,w(")"),h,n):"operator"==e||"spread"==e?v(t?M:j):"["==e?v(x("]"),ye,h,n):"{"==e?F(B,"}",null,n):"quasi"==e?m(T,n):"new"==e?v(W(t)):v()}function E(e){return e.match(/[;\}\)\],]/)?m():m(j)}function I(e){return e.match(/[;\}\)\],]/)?m():m(M)}function z(e,t){return","==e?v(j):A(e,t,!1)}function A(e,t,r){var n=0==r?z:A,a=0==r?j:M;return"=>"==e?v(k,r?C:q,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(j,w(":"),a):v(a):"quasi"==e?m(T,n):";"!=e?"("==e?F(M,")","call",n):"."==e?v(N,n):"["==e?v(x("]"),E,w("]"),h,n):void 0:void 0}function T(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?v(T):v(j,$)}function $(e){return"}"==e?(Ce.marked="string-2",Ce.state.tokenize=l,v(T)):void 0}function q(e){return s(Ce.stream,Ce.state),m("{"==e?g:j)}function C(e){return s(Ce.stream,Ce.state),m("{"==e?g:M)}function W(e){return function(t){return"."==t?v(e?P:O):m(e?M:j)}}function O(e,t){return"target"==t?(Ce.marked="keyword",v(z)):void 0}function P(e,t){return"target"==t?(Ce.marked="keyword",v(A)):void 0}function S(e){return":"==e?v(h,g):m(z,w(";"),h)}function N(e){return"variable"==e?(Ce.marked="property",v()):void 0}function B(e,t){return"variable"==e||"keyword"==Ce.style?(Ce.marked="property",v("get"==t||"set"==t?H:U)):"number"==e||"string"==e?(Ce.marked=Me?"property":Ce.style+" property",v(U)):"jsonld-keyword"==e?v(U):"modifier"==e?v(B):"["==e?v(j,w("]"),U):"spread"==e?v(j):void 0}function H(e){return"variable"!=e?m(U):(Ce.marked="property",v(ie))}function U(e){return":"==e?v(M):"("==e?m(ie):void 0}function D(e,t){function r(n){if(","==n){var a=Ce.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(w(t))}return function(n){return n==t?v():m(e,r)}}function F(e,t,r){for(var n=3;n<arguments.length;n++)Ce.cc.push(arguments[n]);return v(x(t,r),D(e,t),h)}function G(e){return"}"==e?v():m(g,G)}function J(e){return Ee&&":"==e?v(L):void 0}function K(e,t){return"="==t?v(M):void 0}function L(e){return"variable"==e?(Ce.marked="variable-3",v()):void 0}function Q(){return m(R,J,Y,Z)}function R(e,t){return"modifier"==e?v(R):"variable"==e?(y(t),v()):"spread"==e?v(R):"["==e?F(R,"]"):"{"==e?F(X,"}"):void 0}function X(e,t){return"variable"!=e||Ce.stream.match(/^\s*:/,!1)?("variable"==e&&(Ce.marked="property"),"spread"==e?v(R):"}"==e?m():v(w(":"),R,Y)):(y(t),v(Y))}function Y(e,t){return"="==t?v(M):void 0}function Z(e){return","==e?v(Q):void 0}function _(e,t){return"keyword b"==e&&"else"==t?v(x("form","else"),g,h):void 0}function ee(e){return"("==e?v(x(")"),te,w(")"),h):void 0}function te(e){return"var"==e?v(Q,w(";"),ne):";"==e?v(ne):"variable"==e?v(re):m(j,w(";"),ne)}function re(e,t){return"in"==t||"of"==t?(Ce.marked="keyword",v(j)):v(z,ne)}function ne(e,t){return";"==e?v(ae):"in"==t||"of"==t?(Ce.marked="keyword",v(j)):m(j,w(";"),ae)}function ae(e){")"!=e&&v(j)}function ie(e,t){return"*"==t?(Ce.marked="keyword",v(ie)):"variable"==e?(y(t),v(ie)):"("==e?v(k,x(")"),D(oe,")"),h,g,b):void 0}function oe(e){return"spread"==e?v(oe):m(R,J,K)}function ce(e,t){return"variable"==e?(y(t),v(ue)):void 0}function ue(e,t){return"extends"==t?v(j,ue):"{"==e?v(x("}"),le,h):void 0}function le(e,t){return"variable"==e||"keyword"==Ce.style?"static"==t?(Ce.marked="keyword",v(le)):(Ce.marked="property","get"==t||"set"==t?v(se,ie,le):v(ie,le)):"*"==t?(Ce.marked="keyword",v(le)):";"==e?v(le):"}"==e?v():void 0}function se(e){return"variable"!=e?m():(Ce.marked="property",v())}function fe(e,t){return"*"==t?(Ce.marked="keyword",v(ve,w(";"))):"default"==t?(Ce.marked="keyword",v(j,w(";"))):m(g)}function de(e){return"string"==e?v():m(pe,ve)}function pe(e,t){return"{"==e?F(pe,"}"):("variable"==e&&y(t),"*"==t&&(Ce.marked="keyword"),v(me))}function me(e,t){return"as"==t?(Ce.marked="keyword",v(pe)):void 0}function ve(e,t){return"from"==t?(Ce.marked="keyword",v(j)):void 0}function ye(e){return"]"==e?v():m(M,ke)}function ke(e){return"for"==e?m(be,w("]")):","==e?v(D(I,"]")):m(D(M,"]"))}function be(e){return"for"==e?v(ee,be):"if"==e?v(j,be):void 0}function xe(e,t){return"operator"==e.lastType||","==e.lastType||Ae.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var he,we,ge=r.indentUnit,je=n.statementIndent,Me=n.jsonld,Ve=n.json||Me,Ee=n.typescript,Ie=n.wordCharacters||/[\w$\xa1-\uffff]/,ze=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n};if(Ee){var c={type:"variable",style:"variable-3"},u={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:a,string:c,number:c,boolean:c,any:c};for(var l in u)o[l]=u[l]}return o}(),Ae=/[+\-*&%=<>!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$e="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ce={state:null,column:null,marked:null,cc:null},We={name:"this",next:{name:"arguments"}};return h.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new f((e||0)-ge,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),s(e,t)),t.tokenize!=u&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==he?r:(t.lastType="operator"!=he||"++"!=we&&"--"!=we?he:"incdec",p(t,r,he,we,e))},indent:function(t,r){if(t.tokenize==u)return e.Pass;if(t.tokenize!=o)return 0;var a=r&&r.charAt(0),i=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var l=t.cc[c];if(l==h)i=i.prev;else if(l!=_)break}"stat"==i.type&&"}"==a&&(i=i.prev),je&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var s=i.type,f=a==s;return"vardef"==s?i.indented+("operator"==t.lastType||","==t.lastType?i.info+1:0):"form"==s&&"{"==a?i.indented:"form"==s?i.indented+ge:"stat"==s?i.indented+(xe(t,r)?je||ge:0):"switch"!=i.info||f||0==n.doubleIndentSwitch?i.align?i.column+(f?0:1):i.indented+(f?0:ge):i.indented+(/^(?:case|default)\b/.test(r)?ge:2*ge)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ve?null:"/*",blockCommentEnd:Ve?null:"*/",lineComment:Ve?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ve?"json":"javascript",jsonldMode:Me,jsonMode:Ve,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":59}],61:[function(require,module,exports){require("../../modules/es6.string.iterator"),require("../../modules/es6.array.from"),module.exports=require("../../modules/$.core").Array.from},{"../../modules/$.core":81,"../../modules/es6.array.from":129,"../../modules/es6.string.iterator":139}],62:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.get-iterator")},{"../modules/core.get-iterator":127,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],63:[function(require,module,exports){require("../modules/web.dom.iterable"),require("../modules/es6.string.iterator"),module.exports=require("../modules/core.is-iterable")},{"../modules/core.is-iterable":128,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],64:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.map"),require("../modules/es7.map.to-json"),module.exports=require("../modules/$.core").Map},{"../modules/$.core":81,"../modules/es6.map":131,"../modules/es6.object.to-string":136,"../modules/es6.string.iterator":139,"../modules/es7.map.to-json":140,"../modules/web.dom.iterable":142}],65:[function(require,module,exports){require("../../modules/es6.object.assign"),module.exports=require("../../modules/$.core").Object.assign},{"../../modules/$.core":81,"../../modules/es6.object.assign":132}],66:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r){return $.create(e,r)}},{"../../modules/$":103}],67:[function(require,module,exports){var $=require("../../modules/$");module.exports=function(e,r,u){return $.setDesc(e,r,u)}},{"../../modules/$":103}],68:[function(require,module,exports){var $=require("../../modules/$");require("../../modules/es6.object.get-own-property-descriptor"),module.exports=function(e,r){return $.getDesc(e,r)}},{"../../modules/$":103,"../../modules/es6.object.get-own-property-descriptor":133}],69:[function(require,module,exports){require("../../modules/es6.object.keys"),module.exports=require("../../modules/$.core").Object.keys},{"../../modules/$.core":81,"../../modules/es6.object.keys":134}],70:[function(require,module,exports){require("../../modules/es6.object.set-prototype-of"),module.exports=require("../../modules/$.core").Object.setPrototypeOf},{"../../modules/$.core":81,"../../modules/es6.object.set-prototype-of":135}],71:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.promise"),module.exports=require("../modules/$.core").Promise},{"../modules/$.core":81,"../modules/es6.object.to-string":136,"../modules/es6.promise":137,"../modules/es6.string.iterator":139,"../modules/web.dom.iterable":142}],72:[function(require,module,exports){require("../modules/es6.object.to-string"),require("../modules/es6.string.iterator"),require("../modules/web.dom.iterable"),require("../modules/es6.set"),require("../modules/es7.set.to-json"),module.exports=require("../modules/$.core").Set},{"../modules/$.core":81,"../modules/es6.object.to-string":136,"../modules/es6.set":138,"../modules/es6.string.iterator":139,"../modules/es7.set.to-json":141,"../modules/web.dom.iterable":142}],73:[function(require,module,exports){module.exports=function(o){if("function"!=typeof o)throw TypeError(o+" is not a function!");return o}},{}],74:[function(require,module,exports){module.exports=function(){}},{}],75:[function(require,module,exports){var isObject=require("./$.is-object");module.exports=function(e){if(!isObject(e))throw TypeError(e+" is not an object!");return e}},{"./$.is-object":96}],76:[function(require,module,exports){var cof=require("./$.cof"),TAG=require("./$.wks")("toStringTag"),ARG="Arguments"==cof(function(){return arguments}());module.exports=function(e){var n,r,t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=(n=Object(e))[TAG])?r:ARG?cof(n):"Object"==(t=cof(n))&&"function"==typeof n.callee?"Arguments":t}},{"./$.cof":77,"./$.wks":125}],77:[function(require,module,exports){var toString={}.toString;module.exports=function(t){return toString.call(t).slice(8,-1)}},{}],78:[function(require,module,exports){"use strict";var $=require("./$"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),ctx=require("./$.ctx"),strictNew=require("./$.strict-new"),defined=require("./$.defined"),forOf=require("./$.for-of"),$iterDefine=require("./$.iter-define"),step=require("./$.iter-step"),ID=require("./$.uid")("id"),$has=require("./$.has"),isObject=require("./$.is-object"),setSpecies=require("./$.set-species"),DESCRIPTORS=require("./$.descriptors"),isExtensible=Object.isExtensible||isObject,SIZE=DESCRIPTORS?"_s":"size",id=0,fastKey=function(e,t){if(!isObject(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!$has(e,ID)){if(!isExtensible(e))return"F";if(!t)return"E";hide(e,ID,++id)}return"O"+e[ID]},getEntry=function(e,t){var r,i=fastKey(t);if("F"!==i)return e._i[i];for(r=e._f;r;r=r.n)if(r.k==t)return r};module.exports={getConstructor:function(e,t,r,i){var n=e(function(e,s){strictNew(e,n,t),e._i=$.create(null),e._f=void 0,e._l=void 0,e[SIZE]=0,void 0!=s&&forOf(s,r,e[i],e)});return redefineAll(n.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[SIZE]=0},delete:function(e){var t=this,r=getEntry(t,e);if(r){var i=r.n,n=r.p;delete t._i[r.i],r.r=!0,n&&(n.n=i),i&&(i.p=n),t._f==r&&(t._f=i),t._l==r&&(t._l=n),t[SIZE]--}return!!r},forEach:function(e){for(var t,r=ctx(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!getEntry(this,e)}}),DESCRIPTORS&&$.setDesc(n.prototype,"size",{get:function(){return defined(this[SIZE])}}),n},def:function(e,t,r){var i,n,s=getEntry(e,t);return s?s.v=r:(e._l=s={i:n=fastKey(t,!0),k:t,v:r,p:i=e._l,n:void 0,r:!1},e._f||(e._f=s),i&&(i.n=s),e[SIZE]++,"F"!==n&&(e._i[n]=s)),e},getEntry:getEntry,setStrong:function(e,t,r){$iterDefine(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?step(0,r.k):"values"==t?step(0,r.v):step(0,[r.k,r.v]):(e._t=void 0,step(1))},r?"entries":"values",!r,!0),setSpecies(t)}}},{"./$":103,"./$.ctx":82,"./$.defined":83,"./$.descriptors":84,"./$.for-of":88,"./$.has":90,"./$.hide":91,"./$.is-object":96,"./$.iter-define":99,"./$.iter-step":101,"./$.redefine-all":109,"./$.set-species":113,"./$.strict-new":117,"./$.uid":124}],79:[function(require,module,exports){var forOf=require("./$.for-of"),classof=require("./$.classof");module.exports=function(r){return function(){if(classof(this)!=r)throw TypeError(r+"#toJSON isn't generic");var o=[];return forOf(this,!1,o.push,o),o}}},{"./$.classof":76,"./$.for-of":88}],80:[function(require,module,exports){"use strict";var $=require("./$"),global=require("./$.global"),$export=require("./$.export"),fails=require("./$.fails"),hide=require("./$.hide"),redefineAll=require("./$.redefine-all"),forOf=require("./$.for-of"),strictNew=require("./$.strict-new"),isObject=require("./$.is-object"),setToStringTag=require("./$.set-to-string-tag"),DESCRIPTORS=require("./$.descriptors");module.exports=function(e,r,t,i,o,s){var n=global[e],c=n,u=o?"set":"add",a=c&&c.prototype,f={};return DESCRIPTORS&&"function"==typeof c&&(s||a.forEach&&!fails(function(){(new c).entries().next()}))?(c=r(function(r,t){strictNew(r,c,e),r._c=new n,void 0!=t&&forOf(t,o,r[u],r)}),$.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","),function(e){var r="add"==e||"set"==e;e in a&&(!s||"clear"!=e)&&hide(c.prototype,e,function(t,i){if(!r&&s&&!isObject(t))return"get"==e?void 0:!1;var o=this._c[e](0===t?0:t,i);return r?this:o})}),"size"in a&&$.setDesc(c.prototype,"size",{get:function(){return this._c.size}})):(c=i.getConstructor(r,e,o,u),redefineAll(c.prototype,t)),setToStringTag(c,e),f[e]=c,$export($export.G+$export.W+$export.F,f),s||i.setStrong(c,e,o),c}},{"./$":103,"./$.descriptors":84,"./$.export":86,"./$.fails":87,"./$.for-of":88,"./$.global":89,"./$.hide":91,"./$.is-object":96,"./$.redefine-all":109,"./$.set-to-string-tag":114,"./$.strict-new":117}],81:[function(require,module,exports){var core=module.exports={version:"1.2.6"};"number"==typeof __e&&(__e=core)},{}],82:[function(require,module,exports){var aFunction=require("./$.a-function");module.exports=function(n,r,t){if(aFunction(n),void 0===r)return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,u){return n.call(r,t,u)};case 3:return function(t,u,e){return n.call(r,t,u,e)}}return function(){return n.apply(r,arguments)}}},{"./$.a-function":73}],83:[function(require,module,exports){module.exports=function(o){if(void 0==o)throw TypeError("Can't call method on "+o);return o}},{}],84:[function(require,module,exports){module.exports=!require("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":87}],85:[function(require,module,exports){var isObject=require("./$.is-object"),document=require("./$.global").document,is=isObject(document)&&isObject(document.createElement);module.exports=function(e){return is?document.createElement(e):{}}},{"./$.global":89,"./$.is-object":96}],86:[function(require,module,exports){var global=require("./$.global"),core=require("./$.core"),ctx=require("./$.ctx"),PROTOTYPE="prototype",$export=function(o,r,e){var t,n,p,x=o&$export.F,c=o&$export.G,$=o&$export.S,l=o&$export.P,i=o&$export.B,P=o&$export.W,u=c?core:core[r]||(core[r]={}),O=c?global:$?global[r]:(global[r]||{})[PROTOTYPE];c&&(e=r);for(t in e)n=!x&&O&&t in O,n&&t in u||(p=n?O[t]:e[t],u[t]=c&&"function"!=typeof O[t]?e[t]:i&&n?ctx(p,global):P&&O[t]==p?function(o){var r=function(r){return this instanceof o?new o(r):o(r)};return r[PROTOTYPE]=o[PROTOTYPE],r}(p):l&&"function"==typeof p?ctx(Function.call,p):p,l&&((u[PROTOTYPE]||(u[PROTOTYPE]={}))[t]=p))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,module.exports=$export},{"./$.core":81,"./$.ctx":82,"./$.global":89}],87:[function(require,module,exports){module.exports=function(r){try{return!!r()}catch(t){return!0}}},{}],88:[function(require,module,exports){var ctx=require("./$.ctx"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),anObject=require("./$.an-object"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");module.exports=function(e,r,t,i){var o,a,n,l=getIterFn(e),c=ctx(t,i,r?2:1),u=0;if("function"!=typeof l)throw TypeError(e+" is not iterable!");if(isArrayIter(l))for(o=toLength(e.length);o>u;u++)r?c(anObject(a=e[u])[0],a[1]):c(e[u]);else for(n=l.call(e);!(a=n.next()).done;)call(n,c,a.value,r)}},{"./$.an-object":75,"./$.ctx":82,"./$.is-array-iter":95,"./$.iter-call":97,"./$.to-length":122,"./core.get-iterator-method":126}],89:[function(require,module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},{}],90:[function(require,module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(r,e){return hasOwnProperty.call(r,e)}},{}],91:[function(require,module,exports){var $=require("./$"),createDesc=require("./$.property-desc");module.exports=require("./$.descriptors")?function(e,r,t){return $.setDesc(e,r,createDesc(1,t))}:function(e,r,t){return e[r]=t,e}},{"./$":103,"./$.descriptors":84,"./$.property-desc":108}],92:[function(require,module,exports){module.exports=require("./$.global").document&&document.documentElement},{"./$.global":89}],93:[function(require,module,exports){module.exports=function(e,r,l){var a=void 0===l;switch(r.length){case 0:return a?e():e.call(l);case 1:return a?e(r[0]):e.call(l,r[0]);case 2:return a?e(r[0],r[1]):e.call(l,r[0],r[1]);case 3:return a?e(r[0],r[1],r[2]):e.call(l,r[0],r[1],r[2]);case 4:return a?e(r[0],r[1],r[2],r[3]):e.call(l,r[0],r[1],r[2],r[3])}return e.apply(l,r)}},{}],94:[function(require,module,exports){var cof=require("./$.cof");module.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==cof(e)?e.split(""):Object(e)}},{"./$.cof":77}],95:[function(require,module,exports){var Iterators=require("./$.iterators"),ITERATOR=require("./$.wks")("iterator"),ArrayProto=Array.prototype;
module.exports=function(r){return void 0!==r&&(Iterators.Array===r||ArrayProto[ITERATOR]===r)}},{"./$.iterators":102,"./$.wks":125}],96:[function(require,module,exports){module.exports=function(o){return"object"==typeof o?null!==o:"function"==typeof o}},{}],97:[function(require,module,exports){var anObject=require("./$.an-object");module.exports=function(r,t,e,a){try{return a?t(anObject(e)[0],e[1]):t(e)}catch(c){var n=r.return;throw void 0!==n&&anObject(n.call(r)),c}}},{"./$.an-object":75}],98:[function(require,module,exports){"use strict";var $=require("./$"),descriptor=require("./$.property-desc"),setToStringTag=require("./$.set-to-string-tag"),IteratorPrototype={};require("./$.hide")(IteratorPrototype,require("./$.wks")("iterator"),function(){return this}),module.exports=function(r,t,e){r.prototype=$.create(IteratorPrototype,{next:descriptor(1,e)}),setToStringTag(r,t+" Iterator")}},{"./$":103,"./$.hide":91,"./$.property-desc":108,"./$.set-to-string-tag":114,"./$.wks":125}],99:[function(require,module,exports){"use strict";var LIBRARY=require("./$.library"),$export=require("./$.export"),redefine=require("./$.redefine"),hide=require("./$.hide"),has=require("./$.has"),Iterators=require("./$.iterators"),$iterCreate=require("./$.iter-create"),setToStringTag=require("./$.set-to-string-tag"),getProto=require("./$").getProto,ITERATOR=require("./$.wks")("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this};module.exports=function(e,r,t,i,n,s,u){$iterCreate(t,r,i);var o,a,T=function(e){if(!BUGGY&&e in E)return E[e];switch(e){case KEYS:return function(){return new t(this,e)};case VALUES:return function(){return new t(this,e)}}return function(){return new t(this,e)}},R=r+" Iterator",h=n==VALUES,A=!1,E=e.prototype,$=E[ITERATOR]||E[FF_ITERATOR]||n&&E[n],f=$||T(n);if($){var I=getProto(f.call(new e));setToStringTag(I,R,!0),!LIBRARY&&has(E,FF_ITERATOR)&&hide(I,ITERATOR,returnThis),h&&$.name!==VALUES&&(A=!0,f=function(){return $.call(this)})}if(LIBRARY&&!u||!BUGGY&&!A&&E[ITERATOR]||hide(E,ITERATOR,f),Iterators[r]=f,Iterators[R]=returnThis,n)if(o={values:h?f:T(VALUES),keys:s?f:T(KEYS),entries:h?T("entries"):f},u)for(a in o)a in E||redefine(E,a,o[a]);else $export($export.P+$export.F*(BUGGY||A),r,o);return o}},{"./$":103,"./$.export":86,"./$.has":90,"./$.hide":91,"./$.iter-create":98,"./$.iterators":102,"./$.library":104,"./$.redefine":110,"./$.set-to-string-tag":114,"./$.wks":125}],100:[function(require,module,exports){var ITERATOR=require("./$.wks")("iterator"),SAFE_CLOSING=!1;try{var riter=[7][ITERATOR]();riter.return=function(){SAFE_CLOSING=!0},Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(r,t){if(!t&&!SAFE_CLOSING)return!1;var n=!1;try{var e=[7],i=e[ITERATOR]();i.next=function(){n=!0},e[ITERATOR]=function(){return i},r(e)}catch(u){}return n}},{"./$.wks":125}],101:[function(require,module,exports){module.exports=function(e,n){return{value:n,done:!!e}}},{}],102:[function(require,module,exports){module.exports={}},{}],103:[function(require,module,exports){var $Object=Object;module.exports={create:$Object.create,getProto:$Object.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:$Object.getOwnPropertyDescriptor,setDesc:$Object.defineProperty,setDescs:$Object.defineProperties,getKeys:$Object.keys,getNames:$Object.getOwnPropertyNames,getSymbols:$Object.getOwnPropertySymbols,each:[].forEach}},{}],104:[function(require,module,exports){module.exports=!0},{}],105:[function(require,module,exports){var head,last,notify,global=require("./$.global"),macrotask=require("./$.task").set,Observer=global.MutationObserver||global.WebKitMutationObserver,process=global.process,Promise=global.Promise,isNode="process"==require("./$.cof")(process),flush=function(){var e,o,s;for(isNode&&(e=process.domain)&&(process.domain=null,e.exit());head;)o=head.domain,s=head.fn,o&&o.enter(),s(),o&&o.exit(),head=head.next;last=void 0,e&&e.enter()};if(isNode)notify=function(){process.nextTick(flush)};else if(Observer){var toggle=1,node=document.createTextNode("");new Observer(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=-toggle}}else notify=Promise&&Promise.resolve?function(){Promise.resolve().then(flush)}:function(){macrotask.call(global,flush)};module.exports=function(e){var o={fn:e,next:void 0,domain:isNode&&process.domain};last&&(last.next=o),head||(head=o,notify()),last=o}},{"./$.cof":77,"./$.global":89,"./$.task":119}],106:[function(require,module,exports){var $=require("./$"),toObject=require("./$.to-object"),IObject=require("./$.iobject");module.exports=require("./$.fails")(function(){var e=Object.assign,t={},r={},o=Symbol(),c="abcdefghijklmnopqrst";return t[o]=7,c.split("").forEach(function(e){r[e]=e}),7!=e({},t)[o]||Object.keys(e({},r)).join("")!=c})?function(e,t){for(var r=toObject(e),o=arguments,c=o.length,n=1,i=$.getKeys,b=$.getSymbols,s=$.isEnum;c>n;)for(var a,j=IObject(o[n++]),u=b?i(j).concat(b(j)):i(j),l=u.length,f=0;l>f;)s.call(j,a=u[f++])&&(r[a]=j[a]);return r}:Object.assign},{"./$":103,"./$.fails":87,"./$.iobject":94,"./$.to-object":123}],107:[function(require,module,exports){var $export=require("./$.export"),core=require("./$.core"),fails=require("./$.fails");module.exports=function(e,r){var o=(core.Object||{})[e]||Object[e],t={};t[e]=r(o),$export($export.S+$export.F*fails(function(){o(1)}),"Object",t)}},{"./$.core":81,"./$.export":86,"./$.fails":87}],108:[function(require,module,exports){module.exports=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}}},{}],109:[function(require,module,exports){var redefine=require("./$.redefine");module.exports=function(e,r){for(var n in r)redefine(e,n,r[n]);return e}},{"./$.redefine":110}],110:[function(require,module,exports){module.exports=require("./$.hide")},{"./$.hide":91}],111:[function(require,module,exports){module.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},{}],112:[function(require,module,exports){var getDesc=require("./$").getDesc,isObject=require("./$.is-object"),anObject=require("./$.an-object"),check=function(e,t){if(anObject(e),!isObject(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,c){try{c=require("./$.ctx")(Function.call,getDesc(Object.prototype,"__proto__").set,2),c(e,[]),t=!(e instanceof Array)}catch(r){t=!0}return function(e,r){return check(e,r),t?e.__proto__=r:c(e,r),e}}({},!1):void 0),check:check}},{"./$":103,"./$.an-object":75,"./$.ctx":82,"./$.is-object":96}],113:[function(require,module,exports){"use strict";var core=require("./$.core"),$=require("./$"),DESCRIPTORS=require("./$.descriptors"),SPECIES=require("./$.wks")("species");module.exports=function(e){var r=core[e];DESCRIPTORS&&r&&!r[SPECIES]&&$.setDesc(r,SPECIES,{configurable:!0,get:function(){return this}})}},{"./$":103,"./$.core":81,"./$.descriptors":84,"./$.wks":125}],114:[function(require,module,exports){var def=require("./$").setDesc,has=require("./$.has"),TAG=require("./$.wks")("toStringTag");module.exports=function(e,r,a){e&&!has(e=a?e:e.prototype,TAG)&&def(e,TAG,{configurable:!0,value:r})}},{"./$":103,"./$.has":90,"./$.wks":125}],115:[function(require,module,exports){var global=require("./$.global"),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(o){return store[o]||(store[o]={})}},{"./$.global":89}],116:[function(require,module,exports){var anObject=require("./$.an-object"),aFunction=require("./$.a-function"),SPECIES=require("./$.wks")("species");module.exports=function(e,n){var r,t=anObject(e).constructor;return void 0===t||void 0==(r=anObject(t)[SPECIES])?n:aFunction(r)}},{"./$.a-function":73,"./$.an-object":75,"./$.wks":125}],117:[function(require,module,exports){module.exports=function(e,r,o){if(!(e instanceof r))throw TypeError(o+": use the 'new' operator!");return e}},{}],118:[function(require,module,exports){var toInteger=require("./$.to-integer"),defined=require("./$.defined");module.exports=function(e){return function(r,t){var n,i,d=String(defined(r)),o=toInteger(t),u=d.length;return 0>o||o>=u?e?"":void 0:(n=d.charCodeAt(o),55296>n||n>56319||o+1===u||(i=d.charCodeAt(o+1))<56320||i>57343?e?d.charAt(o):n:e?d.slice(o,o+2):(n-55296<<10)+(i-56320)+65536)}}},{"./$.defined":83,"./$.to-integer":120}],119:[function(require,module,exports){var defer,channel,port,ctx=require("./$.ctx"),invoke=require("./$.invoke"),html=require("./$.html"),cel=require("./$.dom-create"),global=require("./$.global"),process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",run=function(){var e=+this;if(queue.hasOwnProperty(e)){var n=queue[e];delete queue[e],n()}},listner=function(e){run.call(e.data)};setTask&&clearTask||(setTask=function(e){for(var n=[],t=1;arguments.length>t;)n.push(arguments[t++]);return queue[++counter]=function(){invoke("function"==typeof e?e:Function(e),n)},defer(counter),counter},clearTask=function(e){delete queue[e]},"process"==require("./$.cof")(process)?defer=function(e){process.nextTick(ctx(run,e,1))}:MessageChannel?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listner,defer=ctx(port.postMessage,port,1)):global.addEventListener&&"function"==typeof postMessage&&!global.importScripts?(defer=function(e){global.postMessage(e+"","*")},global.addEventListener("message",listner,!1)):defer=ONREADYSTATECHANGE in cel("script")?function(e){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run.call(e)}}:function(e){setTimeout(ctx(run,e,1),0)}),module.exports={set:setTask,clear:clearTask}},{"./$.cof":77,"./$.ctx":82,"./$.dom-create":85,"./$.global":89,"./$.html":92,"./$.invoke":93}],120:[function(require,module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)}},{}],121:[function(require,module,exports){var IObject=require("./$.iobject"),defined=require("./$.defined");module.exports=function(e){return IObject(defined(e))}},{"./$.defined":83,"./$.iobject":94}],122:[function(require,module,exports){var toInteger=require("./$.to-integer"),min=Math.min;module.exports=function(e){return e>0?min(toInteger(e),9007199254740991):0}},{"./$.to-integer":120}],123:[function(require,module,exports){var defined=require("./$.defined");module.exports=function(e){return Object(defined(e))}},{"./$.defined":83}],124:[function(require,module,exports){var id=0,px=Math.random();module.exports=function(o){return"Symbol(".concat(void 0===o?"":o,")_",(++id+px).toString(36))}},{}],125:[function(require,module,exports){var store=require("./$.shared")("wks"),uid=require("./$.uid"),Symbol=require("./$.global").Symbol;module.exports=function(r){return store[r]||(store[r]=Symbol&&Symbol[r]||(Symbol||uid)("Symbol."+r))}},{"./$.global":89,"./$.shared":115,"./$.uid":124}],126:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").getIteratorMethod=function(r){return void 0!=r?r[ITERATOR]||r["@@iterator"]||Iterators[classof(r)]:void 0}},{"./$.classof":76,"./$.core":81,"./$.iterators":102,"./$.wks":125}],127:[function(require,module,exports){var anObject=require("./$.an-object"),get=require("./core.get-iterator-method");module.exports=require("./$.core").getIterator=function(e){var r=get(e);if("function"!=typeof r)throw TypeError(e+" is not iterable!");return anObject(r.call(e))}},{"./$.an-object":75,"./$.core":81,"./core.get-iterator-method":126}],128:[function(require,module,exports){var classof=require("./$.classof"),ITERATOR=require("./$.wks")("iterator"),Iterators=require("./$.iterators");module.exports=require("./$.core").isIterable=function(r){var e=Object(r);return void 0!==e[ITERATOR]||"@@iterator"in e||Iterators.hasOwnProperty(classof(e))}},{"./$.classof":76,"./$.core":81,"./$.iterators":102,"./$.wks":125}],129:[function(require,module,exports){"use strict";var ctx=require("./$.ctx"),$export=require("./$.export"),toObject=require("./$.to-object"),call=require("./$.iter-call"),isArrayIter=require("./$.is-array-iter"),toLength=require("./$.to-length"),getIterFn=require("./core.get-iterator-method");$export($export.S+$export.F*!require("./$.iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var r,t,o,i,n=toObject(e),a="function"==typeof this?this:Array,c=arguments,l=c.length,u=l>1?c[1]:void 0,$=void 0!==u,f=0,g=getIterFn(n);if($&&(u=ctx(u,l>2?c[2]:void 0,2)),void 0==g||a==Array&&isArrayIter(g))for(r=toLength(n.length),t=new a(r);r>f;f++)t[f]=$?u(n[f],f):n[f];else for(i=g.call(n),t=new a;!(o=i.next()).done;f++)t[f]=$?call(i,u,[o.value,f],!0):o.value;return t.length=f,t}})},{"./$.ctx":82,"./$.export":86,"./$.is-array-iter":95,"./$.iter-call":97,"./$.iter-detect":100,"./$.to-length":122,"./$.to-object":123,"./core.get-iterator-method":126}],130:[function(require,module,exports){"use strict";var addToUnscopables=require("./$.add-to-unscopables"),step=require("./$.iter-step"),Iterators=require("./$.iterators"),toIObject=require("./$.to-iobject");module.exports=require("./$.iter-define")(Array,"Array",function(e,t){this._t=toIObject(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,s=this._i++;return!e||s>=e.length?(this._t=void 0,step(1)):"keys"==t?step(0,s):"values"==t?step(0,e[s]):step(0,[s,e[s]])},"values"),Iterators.Arguments=Iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries")},{"./$.add-to-unscopables":74,"./$.iter-define":99,"./$.iter-step":101,"./$.iterators":102,"./$.to-iobject":121}],131:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var n=strong.getEntry(this,t);return n&&n.v},set:function(t,n){return strong.def(this,0===t?0:t,n)}},strong,!0)},{"./$.collection":80,"./$.collection-strong":78}],132:[function(require,module,exports){var $export=require("./$.export");$export($export.S+$export.F,"Object",{assign:require("./$.object-assign")})},{"./$.export":86,"./$.object-assign":106}],133:[function(require,module,exports){var toIObject=require("./$.to-iobject");require("./$.object-sap")("getOwnPropertyDescriptor",function(t){return function(e,r){return t(toIObject(e),r)}})},{"./$.object-sap":107,"./$.to-iobject":121}],134:[function(require,module,exports){var toObject=require("./$.to-object");require("./$.object-sap")("keys",function(e){return function(t){return e(toObject(t))}})},{"./$.object-sap":107,"./$.to-object":123}],135:[function(require,module,exports){var $export=require("./$.export");$export($export.S,"Object",{setPrototypeOf:require("./$.set-proto").set})},{"./$.export":86,"./$.set-proto":112}],136:[function(require,module,exports){},{}],137:[function(require,module,exports){"use strict";var Wrapper,$=require("./$"),LIBRARY=require("./$.library"),global=require("./$.global"),ctx=require("./$.ctx"),classof=require("./$.classof"),$export=require("./$.export"),isObject=require("./$.is-object"),anObject=require("./$.an-object"),aFunction=require("./$.a-function"),strictNew=require("./$.strict-new"),forOf=require("./$.for-of"),setProto=require("./$.set-proto").set,same=require("./$.same-value"),SPECIES=require("./$.wks")("species"),speciesConstructor=require("./$.species-constructor"),asap=require("./$.microtask"),PROMISE="Promise",process=global.process,isNode="process"==classof(process),P=global[PROMISE],testResolve=function(e){var r=new P(function(){});return e&&(r.constructor=Object),P.resolve(r)===r},USE_NATIVE=function(){function e(r){var t=new P(r);return setProto(t,e.prototype),t}var r=!1;try{if(r=P&&P.resolve&&testResolve(),setProto(e,P),e.prototype=$.create(P.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(r=!1),r&&require("./$.descriptors")){var t=!1;P.resolve($.setDesc({},"then",{get:function(){t=!0}})),r=t}}catch(o){r=!1}return r}(),sameConstructor=function(e,r){return LIBRARY&&e===P&&r===Wrapper?!0:same(e,r)},getConstructor=function(e){var r=anObject(e)[SPECIES];return void 0!=r?r:e},isThenable=function(e){var r;return isObject(e)&&"function"==typeof(r=e.then)?r:!1},PromiseCapability=function(e){var r,t;this.promise=new e(function(e,o){if(void 0!==r||void 0!==t)throw TypeError("Bad Promise constructor");r=e,t=o}),this.resolve=aFunction(r),this.reject=aFunction(t)},perform=function(e){try{e()}catch(r){return{error:r}}},notify=function(e,r){if(!e.n){e.n=!0;var t=e.c;asap(function(){for(var o=e.v,n=1==e.s,i=0,s=function(r){var t,i,s=n?r.ok:r.fail,c=r.resolve,a=r.reject;try{s?(n||(e.h=!0),t=s===!0?o:s(o),t===r.promise?a(TypeError("Promise-chain cycle")):(i=isThenable(t))?i.call(t,c,a):c(t)):a(o)}catch(u){a(u)}};t.length>i;)s(t[i++]);t.length=0,e.n=!1,r&&setTimeout(function(){var r,t,n=e.p;isUnhandled(n)&&(isNode?process.emit("unhandledRejection",o,n):(r=global.onunhandledrejection)?r({promise:n,reason:o}):(t=global.console)&&t.error&&t.error("Unhandled promise rejection",o)),e.a=void 0},1)})}},isUnhandled=function(e){var r,t=e._d,o=t.a||t.c,n=0;if(t.h)return!1;for(;o.length>n;)if(r=o[n++],r.fail||!isUnhandled(r.promise))return!1;return!0},$reject=function(e){var r=this;r.d||(r.d=!0,r=r.r||r,r.v=e,r.s=2,r.a=r.c.slice(),notify(r,!0))},$resolve=function(e){var r,t=this;if(!t.d){t.d=!0,t=t.r||t;try{if(t.p===e)throw TypeError("Promise can't be resolved itself");(r=isThenable(e))?asap(function(){var o={r:t,d:!1};try{r.call(e,ctx($resolve,o,1),ctx($reject,o,1))}catch(n){$reject.call(o,n)}}):(t.v=e,t.s=1,notify(t,!1))}catch(o){$reject.call({r:t,d:!1},o)}}};USE_NATIVE||(P=function(e){aFunction(e);var r=this._d={p:strictNew(this,P,PROMISE),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{e(ctx($resolve,r,1),ctx($reject,r,1))}catch(t){$reject.call(r,t)}},require("./$.redefine-all")(P.prototype,{then:function(e,r){var t=new PromiseCapability(speciesConstructor(this,P)),o=t.promise,n=this._d;return t.ok="function"==typeof e?e:!0,t.fail="function"==typeof r&&r,n.c.push(t),n.a&&n.a.push(t),n.s&¬ify(n,!1),o},catch:function(e){return this.then(void 0,e)}})),$export($export.G+$export.W+$export.F*!USE_NATIVE,{Promise:P}),require("./$.set-to-string-tag")(P,PROMISE),require("./$.set-species")(PROMISE),Wrapper=require("./$.core")[PROMISE],$export($export.S+$export.F*!USE_NATIVE,PROMISE,{reject:function(e){var r=new PromiseCapability(this),t=r.reject;return t(e),r.promise}}),$export($export.S+$export.F*(!USE_NATIVE||testResolve(!0)),PROMISE,{resolve:function(e){if(e instanceof P&&sameConstructor(e.constructor,this))return e;var r=new PromiseCapability(this),t=r.resolve;return t(e),r.promise}}),$export($export.S+$export.F*!(USE_NATIVE&&require("./$.iter-detect")(function(e){P.all(e).catch(function(){})})),PROMISE,{all:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.resolve,n=t.reject,i=[],s=perform(function(){forOf(e,!1,i.push,i);var t=i.length,s=Array(t);t?$.each.call(i,function(e,i){var c=!1;r.resolve(e).then(function(e){c||(c=!0,s[i]=e,--t||o(s))},n)}):o(s)});return s&&n(s.error),t.promise},race:function(e){var r=getConstructor(this),t=new PromiseCapability(r),o=t.reject,n=perform(function(){forOf(e,!1,function(e){r.resolve(e).then(t.resolve,o)})});return n&&o(n.error),t.promise}})},{"./$":103,"./$.a-function":73,"./$.an-object":75,"./$.classof":76,"./$.core":81,"./$.ctx":82,"./$.descriptors":84,"./$.export":86,"./$.for-of":88,"./$.global":89,"./$.is-object":96,"./$.iter-detect":100,"./$.library":104,"./$.microtask":105,"./$.redefine-all":109,"./$.same-value":111,"./$.set-proto":112,"./$.set-species":113,"./$.set-to-string-tag":114,"./$.species-constructor":116,"./$.strict-new":117,"./$.wks":125}],138:[function(require,module,exports){"use strict";var strong=require("./$.collection-strong");require("./$.collection")("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return strong.def(this,t=0===t?0:t,t)}},strong)},{"./$.collection":80,"./$.collection-strong":78}],139:[function(require,module,exports){"use strict";var $at=require("./$.string-at")(!0);require("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,e=this._i;return e>=i.length?{value:void 0,done:!0}:(t=$at(i,e),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":99,"./$.string-at":118}],140:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Map",{toJSON:require("./$.collection-to-json")("Map")})},{"./$.collection-to-json":79,"./$.export":86}],141:[function(require,module,exports){var $export=require("./$.export");$export($export.P,"Set",{toJSON:require("./$.collection-to-json")("Set")})},{"./$.collection-to-json":79,"./$.export":86}],142:[function(require,module,exports){require("./es6.array.iterator");var Iterators=require("./$.iterators");Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array},{"./$.iterators":102,"./es6.array.iterator":130}],143:[function(require,module,exports){"use strict";var _get=require("babel-runtime/helpers/get").default,_inherits=require("babel-runtime/helpers/inherits").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _language=require("../language"),GraphQLError=function(e){function r(e,t,i,n,o){_classCallCheck(this,r),_get(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,e),this.message=e,Object.defineProperty(this,"stack",{value:i||e}),Object.defineProperty(this,"nodes",{value:t}),Object.defineProperty(this,"source",{get:function(){if(n)return n;if(t&&t.length>0){var e=t[0];return e&&e.loc&&e.loc.source}}}),Object.defineProperty(this,"positions",{get:function(){if(o)return o;if(t){var e=t.map(function(e){return e.loc&&e.loc.start});if(e.some(function(e){return e}))return e}}}),Object.defineProperty(this,"locations",{get:function(){var e=this;return this.positions&&this.source?this.positions.map(function(r){return(0,_language.getLocation)(e.source,r)}):void 0}})}return _inherits(r,e),r}(Error);exports.GraphQLError=GraphQLError},{"../language":158,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/get":33,"babel-runtime/helpers/inherits":34}],144:[function(require,module,exports){"use strict";function formatError(e){return(0,_jsutilsInvariant2.default)(e,"Received null or undefined error."),{message:e.message,locations:e.locations}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatError=formatError;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant)},{"../jsutils/invariant":154,"babel-runtime/helpers/interop-require-default":35}],145:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _GraphQLError=require("./GraphQLError");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _GraphQLError.GraphQLError}});var _syntaxError=require("./syntaxError");Object.defineProperty(exports,"syntaxError",{enumerable:!0,get:function(){return _syntaxError.syntaxError}});var _locatedError=require("./locatedError");Object.defineProperty(exports,"locatedError",{enumerable:!0,get:function(){return _locatedError.locatedError}});var _formatError=require("./formatError");Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _formatError.formatError}})},{"./GraphQLError":143,"./formatError":144,"./locatedError":146,"./syntaxError":147}],146:[function(require,module,exports){"use strict";function locatedError(r,e){var o=r?r.message||String(r):"An unknown error occurred.",a=r?r.stack:null,t=new _GraphQLError.GraphQLError(o,e,a);return t.originalError=r,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.locatedError=locatedError;var _GraphQLError=require("./GraphQLError")},{"./GraphQLError":143}],147:[function(require,module,exports){"use strict";function syntaxError(r,n,o){var t=(0,_languageLocation.getLocation)(r,n),a=new _GraphQLError.GraphQLError("Syntax Error "+r.name+" ("+t.line+":"+t.column+") "+o+"\n\n"+highlightSourceAtLocation(r,t),void 0,void 0,r,[n]);return a}function highlightSourceAtLocation(r,n){var o=n.line,t=(o-1).toString(),a=o.toString(),e=(o+1).toString(),i=e.length,l=r.body.split(/\r\n|[\n\r]/g);return(o>=2?lpad(i,t)+": "+l[o-2]+"\n":"")+lpad(i,a)+": "+l[o-1]+"\n"+Array(2+i+n.column).join(" ")+"^\n"+(o<l.length?lpad(i,e)+": "+l[o]+"\n":"")}function lpad(r,n){return Array(r-n.length+1).join(" ")+n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.syntaxError=syntaxError;var _languageLocation=require("../language/location"),_GraphQLError=require("./GraphQLError")},{"../language/location":161,"./GraphQLError":143}],148:[function(require,module,exports){"use strict";function execute(e,r,t,n,i){(0,_jsutilsInvariant2.default)(e,"Must provide schema"),(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.");var a=buildExecutionContext(e,r,t,n,i);return new _Promise(function(e){e(executeOperation(a,a.operation,t))}).catch(function(e){return a.errors.push(e),null}).then(function(e){return a.errors.length?{data:e,errors:a.errors}:{data:e}})}function buildExecutionContext(e,r,t,n,i){var a=[],o=void 0,u=_Object$create(null);if(r.definitions.forEach(function(e){switch(e.kind){case _language.Kind.OPERATION_DEFINITION:if(!i&&o)throw new _error.GraphQLError("Must provide operation name if query contains multiple operations.");(!i||e.name&&e.name.value===i)&&(o=e);break;case _language.Kind.FRAGMENT_DEFINITION:u[e.name.value]=e;break;default:throw new _error.GraphQLError("GraphQL cannot execute a request containing a "+e.kind+".",e)}}),!o)throw i?new _error.GraphQLError("Must provide an operation."):new _error.GraphQLError('Unknown operation named "'+i+'".');var l=(0,_values.getVariableValues)(e,o.variableDefinitions||[],n||{}),s={schema:e,fragments:u,rootValue:t,operation:o,variableValues:l,errors:a};return s}function executeOperation(e,r,t){var n=getOperationRootType(e.schema,r),i=collectFields(e,n,r.selectionSet,_Object$create(null),_Object$create(null));return"mutation"===r.operation?executeFieldsSerially(e,n,t,i):executeFields(e,n,t,i)}function getOperationRootType(e,r){switch(r.operation){case"query":return e.getQueryType();case"mutation":var t=e.getMutationType();if(!t)throw new _error.GraphQLError("Schema is not configured for mutations",[r]);return t;case"subscription":var n=e.getSubscriptionType();if(!n)throw new _error.GraphQLError("Schema is not configured for subscriptions",[r]);return n;default:throw new _error.GraphQLError("Can only execute queries, mutations and subscriptions",[r])}}function executeFieldsSerially(e,r,t,n){return _Object$keys(n).reduce(function(i,a){return i.then(function(i){var o=n[a],u=resolveField(e,r,t,o);return void 0===u?i:isThenable(u)?u.then(function(e){return i[a]=e,i}):(i[a]=u,i)})},_Promise.resolve({}))}function executeFields(e,r,t,n){var i=!1,a=_Object$keys(n).reduce(function(a,o){var u=n[o],l=resolveField(e,r,t,u);return void 0===l?a:(a[o]=l,isThenable(l)&&(i=!0),a)},_Object$create(null));return i?promiseForObject(a):a}function collectFields(e,r,t,n,i){for(var a=0;a<t.selections.length;a++){var o=t.selections[a];switch(o.kind){case _language.Kind.FIELD:if(!shouldIncludeNode(e,o.directives))continue;var u=getFieldEntryKey(o);n[u]||(n[u]=[]),n[u].push(o);break;case _language.Kind.INLINE_FRAGMENT:if(!shouldIncludeNode(e,o.directives)||!doesFragmentConditionMatch(e,o,r))continue;collectFields(e,r,o.selectionSet,n,i);break;case _language.Kind.FRAGMENT_SPREAD:var l=o.name.value;if(i[l]||!shouldIncludeNode(e,o.directives))continue;i[l]=!0;var s=e.fragments[l];if(!s||!shouldIncludeNode(e,s.directives)||!doesFragmentConditionMatch(e,s,r))continue;collectFields(e,r,s.selectionSet,n,i)}}return n}function shouldIncludeNode(e,r){var t=r&&(0,_jsutilsFind2.default)(r,function(e){return e.name.value===_typeDirectives.GraphQLSkipDirective.name});if(t){var n=(0,_values.getArgumentValues)(_typeDirectives.GraphQLSkipDirective.args,t.arguments,e.variableValues),i=n.if;return!i}var a=r&&(0,_jsutilsFind2.default)(r,function(e){return e.name.value===_typeDirectives.GraphQLIncludeDirective.name});if(a){var o=(0,_values.getArgumentValues)(_typeDirectives.GraphQLIncludeDirective.args,a.arguments,e.variableValues),u=o.if;return Boolean(u)}return!0}function doesFragmentConditionMatch(e,r,t){var n=r.typeCondition;if(!n)return!0;var i=(0,_utilitiesTypeFromAST.typeFromAST)(e.schema,n);return i===t?!0:(0,_typeDefinition.isAbstractType)(i)?i.isPossibleType(t):!1}function promiseForObject(e){var r=_Object$keys(e),t=r.map(function(r){return e[r]});return _Promise.all(t).then(function(e){return e.reduce(function(e,t,n){return e[r[n]]=t,e},_Object$create(null))})}function getFieldEntryKey(e){return e.alias?e.alias.value:e.name.value}function resolveField(e,r,t,n){var i=n[0],a=i.name.value,o=getFieldDef(e.schema,r,a);if(o){var u=o.type,l=o.resolve||defaultResolveFn,s=(0,_values.getArgumentValues)(o.args,i.arguments,e.variableValues),c={fieldName:a,fieldASTs:n,returnType:u,parentType:r,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues},p=resolveOrError(l,t,s,c);return completeValueCatchingError(e,u,n,c,p)}}function resolveOrError(e,r,t,n){try{return e(r,t,n)}catch(i){return i instanceof Error?i:new Error(i)}}function completeValueCatchingError(e,r,t,n,i){if(r instanceof _typeDefinition.GraphQLNonNull)return completeValue(e,r,t,n,i);try{var a=completeValue(e,r,t,n,i);return isThenable(a)?a.then(void 0,function(r){return e.errors.push(r),_Promise.resolve(null)}):a}catch(o){return e.errors.push(o),null}}function completeValue(e,r,t,n,i){if(isThenable(i))return i.then(function(i){return completeValue(e,r,t,n,i)},function(e){return _Promise.reject((0,_error.locatedError)(e,t))});if(i instanceof Error)throw(0,_error.locatedError)(i,t);if(r instanceof _typeDefinition.GraphQLNonNull){var a=completeValue(e,r.ofType,t,n,i);if(null===a)throw new _error.GraphQLError("Cannot return null for non-nullable "+("field "+n.parentType+"."+n.fieldName+"."),t);return a}if((0,_jsutilsIsNullish2.default)(i))return null;if(r instanceof _typeDefinition.GraphQLList){var o=function(){(0,_jsutilsInvariant2.default)(Array.isArray(i),"User Error: expected iterable, but did not find one "+("for field "+n.parentType+"."+n.fieldName+"."));var a=r.ofType,o=!1,u=i.map(function(r){var i=completeValueCatchingError(e,a,t,n,r);return!o&&isThenable(i)&&(o=!0),i});return{v:o?_Promise.all(u):u}}();if("object"==typeof o)return o.v}if(r instanceof _typeDefinition.GraphQLScalarType||r instanceof _typeDefinition.GraphQLEnumType){(0,_jsutilsInvariant2.default)(r.serialize,"Missing serialize method on type");var u=r.serialize(i);return(0,_jsutilsIsNullish2.default)(u)?null:u}var l=void 0;if(r instanceof _typeDefinition.GraphQLObjectType)l=r;else if((0,_typeDefinition.isAbstractType)(r)){var s=r;if(l=s.getObjectType(i,n),l&&!s.isPossibleType(l))throw new _error.GraphQLError('Runtime Object type "'+l+'" is not a possible type '+('for "'+s+'".'),t)}if(!l)return null;if(l.isTypeOf&&!l.isTypeOf(i,n))throw new _error.GraphQLError('Expected value of type "'+l+'" but got: '+i+".",t);for(var c=_Object$create(null),p=_Object$create(null),f=0;f<t.length;f++){var d=t[f].selectionSet;d&&(c=collectFields(e,l,d,c,p))}return executeFields(e,l,i,c)}function defaultResolveFn(e,r,t){var n=t.fieldName;if("number"!=typeof e&&"string"!=typeof e&&e){
var i=e[n];return"function"==typeof i?i.call(e):i}}function isThenable(e){return"object"==typeof e&&null!==e&&"function"==typeof e.then}function getFieldDef(e,r,t){return t===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===r?_typeIntrospection.SchemaMetaFieldDef:t===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===r?_typeIntrospection.TypeMetaFieldDef:t===_typeIntrospection.TypeNameMetaFieldDef.name?_typeIntrospection.TypeNameMetaFieldDef:r.getFields()[t]}var _Promise=require("babel-runtime/core-js/promise").default,_Object$create=require("babel-runtime/core-js/object/create").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.execute=execute;var _error=require("../error"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesTypeFromAST=require("../utilities/typeFromAST"),_language=require("../language"),_values=require("./values"),_typeDefinition=require("../type/definition"),_typeSchema=require("../type/schema"),_typeIntrospection=require("../type/introspection"),_typeDirectives=require("../type/directives")},{"../error":145,"../jsutils/find":153,"../jsutils/invariant":154,"../jsutils/isNullish":155,"../language":158,"../type/definition":166,"../type/directives":167,"../type/introspection":169,"../type/schema":171,"../utilities/typeFromAST":185,"./values":150,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/keys":26,"babel-runtime/core-js/promise":28,"babel-runtime/helpers/interop-require-default":35}],149:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _execute=require("./execute");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execute.execute}})},{"./execute":148}],150:[function(require,module,exports){"use strict";function getVariableValues(e,i,r){return i.reduce(function(i,t){var u=t.variable.name.value;return i[u]=getVariableValue(e,t,r[u]),i},{})}function getArgumentValues(e,i,r){if(!e||!i)return{};var t=(0,_jsutilsKeyMap2.default)(i,function(e){return e.name.value});return e.reduce(function(e,i){var u=i.name,a=t[u]?t[u].value:null,l=(0,_utilitiesValueFromAST.valueFromAST)(a,i.type,r);return(0,_jsutilsIsNullish2.default)(l)&&(l=i.defaultValue),(0,_jsutilsIsNullish2.default)(l)||(e[u]=l),e},{})}function getVariableValue(e,i,r){var t=(0,_utilitiesTypeFromAST.typeFromAST)(e,i.type),u=i.variable;if(!t||!(0,_typeDefinition.isInputType)(t))throw new _error.GraphQLError('Variable "$'+u.name.value+'" expected value of type '+('"'+(0,_languagePrinter.print)(i.type)+'" which cannot be used as an input type.'),[i]);var a=t,l=(0,_utilitiesIsValidJSValue.isValidJSValue)(r,a);if(!l.length){if((0,_jsutilsIsNullish2.default)(r)){var n=i.defaultValue;if(n)return(0,_utilitiesValueFromAST.valueFromAST)(n,a)}return coerceValue(a,r)}if((0,_jsutilsIsNullish2.default)(r))throw new _error.GraphQLError('Variable "$'+u.name.value+'" of required type '+('"'+(0,_languagePrinter.print)(i.type)+'" was not provided.'),[i]);var s=l?"\n"+l.join("\n"):"";throw new _error.GraphQLError('Variable "$'+u.name.value+'" got invalid value '+(JSON.stringify(r)+"."+s),[i])}function coerceValue(e,i){for(var r=!0;r;){var t=e,u=i;a=l=n=s=void 0,r=!1;var a=u;if(t instanceof _typeDefinition.GraphQLNonNull)e=t.ofType,i=a,r=!0;else{if((0,_jsutilsIsNullish2.default)(a))return null;if(t instanceof _typeDefinition.GraphQLList){var l=function(){var e=t.ofType;return Array.isArray(a)?{v:a.map(function(i){return coerceValue(e,i)})}:{v:[coerceValue(e,a)]}}();if("object"==typeof l)return l.v}if(t instanceof _typeDefinition.GraphQLInputObjectType){var n=function(){if("object"!=typeof a||null===a)return{v:null};var e=t.getFields();return{v:_Object$keys(e).reduce(function(i,r){var t=e[r],u=coerceValue(t.type,a[r]);return(0,_jsutilsIsNullish2.default)(u)&&(u=t.defaultValue),(0,_jsutilsIsNullish2.default)(u)||(i[r]=u),i},{})}}();if("object"==typeof n)return n.v}(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLScalarType||t instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var s=t.parseValue(a);if(!(0,_jsutilsIsNullish2.default)(s))return s}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.getVariableValues=getVariableValues,exports.getArgumentValues=getArgumentValues;var _error=require("../error"),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_utilitiesTypeFromAST=require("../utilities/typeFromAST"),_utilitiesValueFromAST=require("../utilities/valueFromAST"),_utilitiesIsValidJSValue=require("../utilities/isValidJSValue"),_languagePrinter=require("../language/printer"),_typeDefinition=require("../type/definition")},{"../error":145,"../jsutils/invariant":154,"../jsutils/isNullish":155,"../jsutils/keyMap":156,"../language/printer":163,"../type/definition":166,"../utilities/isValidJSValue":181,"../utilities/typeFromAST":185,"../utilities/valueFromAST":186,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],151:[function(require,module,exports){"use strict";function graphql(e,r,a,u,t){return new _Promise(function(i){var n=new _languageSource.Source(r||"","GraphQL request"),o=(0,_languageParser.parse)(n),l=(0,_validationValidate.validate)(e,o);i(l.length>0?{errors:l}:(0,_executionExecute.execute)(e,o,a,u,t))}).catch(function(e){return{errors:[e]}})}var _Promise=require("babel-runtime/core-js/promise").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.graphql=graphql;var _languageSource=require("./language/source"),_languageParser=require("./language/parser"),_validationValidate=require("./validation/validate"),_executionExecute=require("./execution/execute")},{"./execution/execute":148,"./language/parser":162,"./language/source":164,"./validation/validate":213,"babel-runtime/core-js/promise":28}],152:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _graphql=require("./graphql");Object.defineProperty(exports,"graphql",{enumerable:!0,get:function(){return _graphql.graphql}});var _type=require("./type");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _type.GraphQLSchema}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _type.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _type.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _type.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _type.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _type.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _type.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _type.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _type.GraphQLNonNull}}),Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _type.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _type.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _type.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _type.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _type.GraphQLID}}),Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _type.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _type.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _type.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _type.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _type.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _type.isAbstractType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _type.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _type.getNamedType}});var _language=require("./language");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _language.Source}}),Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _language.getLocation}}),Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _language.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _language.parseValue}}),Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _language.print}}),Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _language.visit}}),Object.defineProperty(exports,"Kind",{enumerable:!0,get:function(){return _language.Kind}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _language.BREAK}});var _execution=require("./execution");Object.defineProperty(exports,"execute",{enumerable:!0,get:function(){return _execution.execute}});var _validation=require("./validation");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validation.validate}}),Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _validation.specifiedRules}});var _error=require("./error");Object.defineProperty(exports,"GraphQLError",{enumerable:!0,get:function(){return _error.GraphQLError}}),Object.defineProperty(exports,"formatError",{enumerable:!0,get:function(){return _error.formatError}});var _utilities=require("./utilities");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _utilities.introspectionQuery}}),Object.defineProperty(exports,"getOperationAST",{enumerable:!0,get:function(){return _utilities.getOperationAST}}),Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _utilities.buildClientSchema}}),Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _utilities.buildASTSchema}}),Object.defineProperty(exports,"extendSchema",{enumerable:!0,get:function(){return _utilities.extendSchema}}),Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _utilities.printSchema}}),Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _utilities.typeFromAST}}),Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _utilities.valueFromAST}}),Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _utilities.astFromValue}}),Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _utilities.TypeInfo}}),Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _utilities.isValidJSValue}}),Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _utilities.isValidLiteralValue}}),Object.defineProperty(exports,"concatAST",{enumerable:!0,get:function(){return _utilities.concatAST}}),Object.defineProperty(exports,"isEqualType",{enumerable:!0,get:function(){return _utilities.isEqualType}}),Object.defineProperty(exports,"isTypeSubTypeOf",{enumerable:!0,get:function(){return _utilities.isTypeSubTypeOf}}),Object.defineProperty(exports,"doTypesOverlap",{enumerable:!0,get:function(){return _utilities.doTypesOverlap}})},{"./error":145,"./execution":149,"./graphql":151,"./language":158,"./type":168,"./utilities":179,"./validation":187}],153:[function(require,module,exports){"use strict";function find(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=find,module.exports=exports.default},{}],154:[function(require,module,exports){"use strict";function invariant(e,t){if(!e)throw new Error(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=invariant,module.exports=exports.default},{}],155:[function(require,module,exports){"use strict";function isNullish(e){return null===e||void 0===e||e!==e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isNullish,module.exports=exports.default},{}],156:[function(require,module,exports){"use strict";function keyMap(e,t){return e.reduce(function(e,r){return e[t(r)]=r,e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyMap,module.exports=exports.default},{}],157:[function(require,module,exports){"use strict";function keyValMap(e,t,r){return e.reduce(function(e,u){return e[t(u)]=r(u),e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=keyValMap,module.exports=exports.default},{}],158:[function(require,module,exports){"use strict";var _interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0});var _kinds=require("./kinds"),Kind=_interopRequireWildcard(_kinds),_location=require("./location");Object.defineProperty(exports,"getLocation",{enumerable:!0,get:function(){return _location.getLocation}}),exports.Kind=Kind;var _lexer=require("./lexer");Object.defineProperty(exports,"lex",{enumerable:!0,get:function(){return _lexer.lex}});var _parser=require("./parser");Object.defineProperty(exports,"parse",{enumerable:!0,get:function(){return _parser.parse}}),Object.defineProperty(exports,"parseValue",{enumerable:!0,get:function(){return _parser.parseValue}});var _printer=require("./printer");Object.defineProperty(exports,"print",{enumerable:!0,get:function(){return _printer.print}});var _source=require("./source");Object.defineProperty(exports,"Source",{enumerable:!0,get:function(){return _source.Source}});var _visitor=require("./visitor");Object.defineProperty(exports,"visit",{enumerable:!0,get:function(){return _visitor.visit}}),Object.defineProperty(exports,"BREAK",{enumerable:!0,get:function(){return _visitor.BREAK}})},{"./kinds":159,"./lexer":160,"./location":161,"./parser":162,"./printer":163,"./source":164,"./visitor":165,"babel-runtime/helpers/interop-require-wildcard":36}],159:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var NAME="Name";exports.NAME=NAME;var DOCUMENT="Document";exports.DOCUMENT=DOCUMENT;var OPERATION_DEFINITION="OperationDefinition";exports.OPERATION_DEFINITION=OPERATION_DEFINITION;var VARIABLE_DEFINITION="VariableDefinition";exports.VARIABLE_DEFINITION=VARIABLE_DEFINITION;var VARIABLE="Variable";exports.VARIABLE=VARIABLE;var SELECTION_SET="SelectionSet";exports.SELECTION_SET=SELECTION_SET;var FIELD="Field";exports.FIELD=FIELD;var ARGUMENT="Argument";exports.ARGUMENT=ARGUMENT;var FRAGMENT_SPREAD="FragmentSpread";exports.FRAGMENT_SPREAD=FRAGMENT_SPREAD;var INLINE_FRAGMENT="InlineFragment";exports.INLINE_FRAGMENT=INLINE_FRAGMENT;var FRAGMENT_DEFINITION="FragmentDefinition";exports.FRAGMENT_DEFINITION=FRAGMENT_DEFINITION;var INT="IntValue";exports.INT=INT;var FLOAT="FloatValue";exports.FLOAT=FLOAT;var STRING="StringValue";exports.STRING=STRING;var BOOLEAN="BooleanValue";exports.BOOLEAN=BOOLEAN;var ENUM="EnumValue";exports.ENUM=ENUM;var LIST="ListValue";exports.LIST=LIST;var OBJECT="ObjectValue";exports.OBJECT=OBJECT;var OBJECT_FIELD="ObjectField";exports.OBJECT_FIELD=OBJECT_FIELD;var DIRECTIVE="Directive";exports.DIRECTIVE=DIRECTIVE;var NAMED_TYPE="NamedType";exports.NAMED_TYPE=NAMED_TYPE;var LIST_TYPE="ListType";exports.LIST_TYPE=LIST_TYPE;var NON_NULL_TYPE="NonNullType";exports.NON_NULL_TYPE=NON_NULL_TYPE;var OBJECT_TYPE_DEFINITION="ObjectTypeDefinition";exports.OBJECT_TYPE_DEFINITION=OBJECT_TYPE_DEFINITION;var FIELD_DEFINITION="FieldDefinition";exports.FIELD_DEFINITION=FIELD_DEFINITION;var INPUT_VALUE_DEFINITION="InputValueDefinition";exports.INPUT_VALUE_DEFINITION=INPUT_VALUE_DEFINITION;var INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition";exports.INTERFACE_TYPE_DEFINITION=INTERFACE_TYPE_DEFINITION;var UNION_TYPE_DEFINITION="UnionTypeDefinition";exports.UNION_TYPE_DEFINITION=UNION_TYPE_DEFINITION;var SCALAR_TYPE_DEFINITION="ScalarTypeDefinition";exports.SCALAR_TYPE_DEFINITION=SCALAR_TYPE_DEFINITION;var ENUM_TYPE_DEFINITION="EnumTypeDefinition";exports.ENUM_TYPE_DEFINITION=ENUM_TYPE_DEFINITION;var ENUM_VALUE_DEFINITION="EnumValueDefinition";exports.ENUM_VALUE_DEFINITION=ENUM_VALUE_DEFINITION;var INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition";exports.INPUT_OBJECT_TYPE_DEFINITION=INPUT_OBJECT_TYPE_DEFINITION;var TYPE_EXTENSION_DEFINITION="TypeExtensionDefinition";exports.TYPE_EXTENSION_DEFINITION=TYPE_EXTENSION_DEFINITION},{}],160:[function(require,module,exports){"use strict";function lex(e){var r=0;return function(n){var a=readToken(e,void 0===n?r:n);return r=a.end,a}}function getTokenDesc(e){return e.value?getTokenKindDesc(e.kind)+' "'+e.value+'"':getTokenKindDesc(e.kind)}function getTokenKindDesc(e){return tokenDescription[e]}function makeToken(e,r,n,a){return{kind:e,start:r,end:n,value:a}}function printCharCode(e){return isNaN(e)?"<EOF>":127>e?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function readToken(e,r){var n=e.body,a=n.length,o=positionAfterWhitespace(n,r);if(o>=a)return makeToken(TokenKind.EOF,o,o);var c=charCodeAt.call(n,o);if(32>c&&9!==c&&10!==c&&13!==c)throw(0,_error.syntaxError)(e,o,"Invalid character "+printCharCode(c)+".");switch(c){case 33:return makeToken(TokenKind.BANG,o,o+1);case 36:return makeToken(TokenKind.DOLLAR,o,o+1);case 40:return makeToken(TokenKind.PAREN_L,o,o+1);case 41:return makeToken(TokenKind.PAREN_R,o,o+1);case 46:if(46===charCodeAt.call(n,o+1)&&46===charCodeAt.call(n,o+2))return makeToken(TokenKind.SPREAD,o,o+3);break;case 58:return makeToken(TokenKind.COLON,o,o+1);case 61:return makeToken(TokenKind.EQUALS,o,o+1);case 64:return makeToken(TokenKind.AT,o,o+1);case 91:return makeToken(TokenKind.BRACKET_L,o,o+1);case 93:return makeToken(TokenKind.BRACKET_R,o,o+1);case 123:return makeToken(TokenKind.BRACE_L,o,o+1);case 124:return makeToken(TokenKind.PIPE,o,o+1);case 125:return makeToken(TokenKind.BRACE_R,o,o+1);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return readName(e,o);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(e,o,c);case 34:return readString(e,o)}throw(0,_error.syntaxError)(e,o,"Unexpected character "+printCharCode(c)+".")}function positionAfterWhitespace(e,r){for(var n=e.length,a=r;n>a;){var o=charCodeAt.call(e,a);if(65279===o||9===o||32===o||10===o||13===o||44===o)++a;else{if(35!==o)break;for(++a;n>a&&null!==(o=charCodeAt.call(e,a))&&(o>31||9===o)&&10!==o&&13!==o;)++a}}return a}function readNumber(e,r,n){var a=e.body,o=n,c=r,t=!1;if(45===o&&(o=charCodeAt.call(a,++c)),48===o){if(o=charCodeAt.call(a,++c),o>=48&&57>=o)throw(0,_error.syntaxError)(e,c,"Invalid number, unexpected digit after 0: "+printCharCode(o)+".")}else c=readDigits(e,c,o),o=charCodeAt.call(a,c);return 46===o&&(t=!0,o=charCodeAt.call(a,++c),c=readDigits(e,c,o),o=charCodeAt.call(a,c)),69!==o&&101!==o||(t=!0,o=charCodeAt.call(a,++c),43!==o&&45!==o||(o=charCodeAt.call(a,++c)),c=readDigits(e,c,o)),makeToken(t?TokenKind.FLOAT:TokenKind.INT,r,c,slice.call(a,r,c))}function readDigits(e,r,n){var a=e.body,o=r,c=n;if(c>=48&&57>=c){do c=charCodeAt.call(a,++o);while(c>=48&&57>=c);return o}throw(0,_error.syntaxError)(e,o,"Invalid number, expected digit but got: "+printCharCode(c)+".")}function readString(e,r){for(var n=e.body,a=r+1,o=a,c=0,t="";a<n.length&&null!==(c=charCodeAt.call(n,a))&&10!==c&&13!==c&&34!==c;){if(32>c&&9!==c)throw(0,_error.syntaxError)(e,a,"Invalid character within String: "+printCharCode(c)+".");if(++a,92===c){switch(t+=slice.call(n,o,a-1),c=charCodeAt.call(n,a)){case 34:t+='"';break;case 47:t+="/";break;case 92:t+="\\";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+=" ";break;case 117:var i=uniCharCode(charCodeAt.call(n,a+1),charCodeAt.call(n,a+2),charCodeAt.call(n,a+3),charCodeAt.call(n,a+4));if(0>i)throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: "+("\\u"+n.slice(a+1,a+5)+"."));t+=String.fromCharCode(i),a+=4;break;default:throw(0,_error.syntaxError)(e,a,"Invalid character escape sequence: \\"+String.fromCharCode(c)+".")}++a,o=a}}if(34!==c)throw(0,_error.syntaxError)(e,a,"Unterminated string.");return t+=slice.call(n,o,a),makeToken(TokenKind.STRING,r,a+1,t)}function uniCharCode(e,r,n,a){return char2hex(e)<<12|char2hex(r)<<8|char2hex(n)<<4|char2hex(a)}function char2hex(e){return e>=48&&57>=e?e-48:e>=65&&70>=e?e-55:e>=97&&102>=e?e-87:-1}function readName(e,r){for(var n=e.body,a=n.length,o=r+1,c=0;o!==a&&null!==(c=charCodeAt.call(n,o))&&(95===c||c>=48&&57>=c||c>=65&&90>=c||c>=97&&122>=c);)++o;return makeToken(TokenKind.NAME,r,o,slice.call(n,r,o))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lex=lex,exports.getTokenDesc=getTokenDesc,exports.getTokenKindDesc=getTokenKindDesc;var _error=require("../error"),TokenKind={EOF:1,BANG:2,DOLLAR:3,PAREN_L:4,PAREN_R:5,SPREAD:6,COLON:7,EQUALS:8,AT:9,BRACKET_L:10,BRACKET_R:11,BRACE_L:12,PIPE:13,BRACE_R:14,NAME:15,INT:16,FLOAT:17,STRING:18};exports.TokenKind=TokenKind;var tokenDescription={};tokenDescription[TokenKind.EOF]="EOF",tokenDescription[TokenKind.BANG]="!",tokenDescription[TokenKind.DOLLAR]="$",tokenDescription[TokenKind.PAREN_L]="(",tokenDescription[TokenKind.PAREN_R]=")",tokenDescription[TokenKind.SPREAD]="...",tokenDescription[TokenKind.COLON]=":",tokenDescription[TokenKind.EQUALS]="=",tokenDescription[TokenKind.AT]="@",tokenDescription[TokenKind.BRACKET_L]="[",tokenDescription[TokenKind.BRACKET_R]="]",tokenDescription[TokenKind.BRACE_L]="{",tokenDescription[TokenKind.PIPE]="|",tokenDescription[TokenKind.BRACE_R]="}",tokenDescription[TokenKind.NAME]="Name",tokenDescription[TokenKind.INT]="Int",tokenDescription[TokenKind.FLOAT]="Float",tokenDescription[TokenKind.STRING]="String";var charCodeAt=String.prototype.charCodeAt,slice=String.prototype.slice},{"../error":145}],161:[function(require,module,exports){"use strict";function getLocation(e,o){for(var t=/\r\n|[\n\r]/g,n=1,r=o+1,i=void 0;(i=t.exec(e.body))&&i.index<o;)n+=1,r=o+1-(i.index+i[0].length);return{line:n,column:r}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLocation=getLocation},{}],162:[function(require,module,exports){"use strict";function parse(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseDocument(t)}function parseValue(e,n){var r=e instanceof _source.Source?e:new _source.Source(e),t=makeParser(r,n||{});return parseValueLiteral(t,!1)}function parseName(e){var n=expect(e,_lexer.TokenKind.NAME);return{kind:_kinds.NAME,value:n.value,loc:loc(e,n.start)}}function parseDocument(e){var n=e.token.start,r=[];do r.push(parseDefinition(e));while(!skip(e,_lexer.TokenKind.EOF));return{kind:_kinds.DOCUMENT,definitions:r,loc:loc(e,n)}}function parseDefinition(e){if(peek(e,_lexer.TokenKind.BRACE_L))return parseOperationDefinition(e);if(peek(e,_lexer.TokenKind.NAME))switch(e.token.value){case"query":case"mutation":case"subscription":return parseOperationDefinition(e);case"fragment":return parseFragmentDefinition(e);case"type":case"interface":case"union":case"scalar":case"enum":case"input":return parseTypeDefinition(e);case"extend":return parseTypeExtensionDefinition(e)}throw unexpected(e)}function parseOperationDefinition(e){var n=e.token.start;if(peek(e,_lexer.TokenKind.BRACE_L))return{kind:_kinds.OPERATION_DEFINITION,operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:parseSelectionSet(e),loc:loc(e,n)};var r=expect(e,_lexer.TokenKind.NAME),t="mutation"===r.value?"mutation":"subscription"===r.value?"subscription":"query"===r.value?"query":function(){throw unexpected(e,r)}(),a=void 0;return peek(e,_lexer.TokenKind.NAME)&&(a=parseName(e)),{kind:_kinds.OPERATION_DEFINITION,operation:t,name:a,variableDefinitions:parseVariableDefinitions(e),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseVariableDefinitions(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseVariableDefinition,_lexer.TokenKind.PAREN_R):[]}function parseVariableDefinition(e){var n=e.token.start;return{kind:_kinds.VARIABLE_DEFINITION,variable:parseVariable(e),type:(expect(e,_lexer.TokenKind.COLON),parseType(e)),defaultValue:skip(e,_lexer.TokenKind.EQUALS)?parseValueLiteral(e,!0):null,loc:loc(e,n)}}function parseVariable(e){var n=e.token.start;return expect(e,_lexer.TokenKind.DOLLAR),{kind:_kinds.VARIABLE,name:parseName(e),loc:loc(e,n)}}function parseSelectionSet(e){var n=e.token.start;return{kind:_kinds.SELECTION_SET,selections:many(e,_lexer.TokenKind.BRACE_L,parseSelection,_lexer.TokenKind.BRACE_R),loc:loc(e,n)}}function parseSelection(e){return peek(e,_lexer.TokenKind.SPREAD)?parseFragment(e):parseField(e)}function parseField(e){var n=e.token.start,r=parseName(e),t=void 0,a=void 0;return skip(e,_lexer.TokenKind.COLON)?(t=r,a=parseName(e)):(t=null,a=r),{kind:_kinds.FIELD,alias:t,name:a,arguments:parseArguments(e),directives:parseDirectives(e),selectionSet:peek(e,_lexer.TokenKind.BRACE_L)?parseSelectionSet(e):null,loc:loc(e,n)}}function parseArguments(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseArgument,_lexer.TokenKind.PAREN_R):[]}function parseArgument(e){var n=e.token.start;return{kind:_kinds.ARGUMENT,name:parseName(e),value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,!1)),loc:loc(e,n)}}function parseFragment(e){var n=e.token.start;if(expect(e,_lexer.TokenKind.SPREAD),peek(e,_lexer.TokenKind.NAME)&&"on"!==e.token.value)return{kind:_kinds.FRAGMENT_SPREAD,name:parseFragmentName(e),directives:parseDirectives(e),loc:loc(e,n)};var r=null;return"on"===e.token.value&&(advance(e),r=parseNamedType(e)),{kind:_kinds.INLINE_FRAGMENT,typeCondition:r,directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseFragmentDefinition(e){var n=e.token.start;return expectKeyword(e,"fragment"),{kind:_kinds.FRAGMENT_DEFINITION,name:parseFragmentName(e),typeCondition:(expectKeyword(e,"on"),parseNamedType(e)),directives:parseDirectives(e),selectionSet:parseSelectionSet(e),loc:loc(e,n)}}function parseFragmentName(e){if("on"===e.token.value)throw unexpected(e);return parseName(e)}function parseValueLiteral(e,n){var r=e.token;switch(r.kind){case _lexer.TokenKind.BRACKET_L:return parseList(e,n);case _lexer.TokenKind.BRACE_L:return parseObject(e,n);case _lexer.TokenKind.INT:return advance(e),{kind:_kinds.INT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.FLOAT:return advance(e),{kind:_kinds.FLOAT,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.STRING:return advance(e),{kind:_kinds.STRING,value:r.value,loc:loc(e,r.start)};case _lexer.TokenKind.NAME:if("true"===r.value||"false"===r.value)return advance(e),{kind:_kinds.BOOLEAN,value:"true"===r.value,loc:loc(e,r.start)};if("null"!==r.value)return advance(e),{kind:_kinds.ENUM,value:r.value,loc:loc(e,r.start)};break;case _lexer.TokenKind.DOLLAR:if(!n)return parseVariable(e)}throw unexpected(e)}function parseConstValue(e){return parseValueLiteral(e,!0)}function parseValueValue(e){return parseValueLiteral(e,!1)}function parseList(e,n){var r=e.token.start,t=n?parseConstValue:parseValueValue;return{kind:_kinds.LIST,values:any(e,_lexer.TokenKind.BRACKET_L,t,_lexer.TokenKind.BRACKET_R),loc:loc(e,r)}}function parseObject(e,n){var r=e.token.start;expect(e,_lexer.TokenKind.BRACE_L);for(var t=[];!skip(e,_lexer.TokenKind.BRACE_R);)t.push(parseObjectField(e,n));return{kind:_kinds.OBJECT,fields:t,loc:loc(e,r)}}function parseObjectField(e,n){var r=e.token.start;return{kind:_kinds.OBJECT_FIELD,name:parseName(e),value:(expect(e,_lexer.TokenKind.COLON),parseValueLiteral(e,n)),loc:loc(e,r)}}function parseDirectives(e){for(var n=[];peek(e,_lexer.TokenKind.AT);)n.push(parseDirective(e));return n}function parseDirective(e){var n=e.token.start;return expect(e,_lexer.TokenKind.AT),{kind:_kinds.DIRECTIVE,name:parseName(e),arguments:parseArguments(e),loc:loc(e,n)}}function parseType(e){var n=e.token.start,r=void 0;return skip(e,_lexer.TokenKind.BRACKET_L)?(r=parseType(e),expect(e,_lexer.TokenKind.BRACKET_R),r={kind:_kinds.LIST_TYPE,type:r,loc:loc(e,n)}):r=parseNamedType(e),skip(e,_lexer.TokenKind.BANG)?{kind:_kinds.NON_NULL_TYPE,type:r,loc:loc(e,n)}:r}function parseNamedType(e){var n=e.token.start;return{kind:_kinds.NAMED_TYPE,name:parseName(e),loc:loc(e,n)}}function parseTypeDefinition(e){if(!peek(e,_lexer.TokenKind.NAME))throw unexpected(e);switch(e.token.value){case"type":return parseObjectTypeDefinition(e);case"interface":return parseInterfaceTypeDefinition(e);case"union":return parseUnionTypeDefinition(e);case"scalar":return parseScalarTypeDefinition(e);case"enum":return parseEnumTypeDefinition(e);case"input":return parseInputObjectTypeDefinition(e);default:throw unexpected(e)}}function parseObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"type");var r=parseName(e),t=parseImplementsInterfaces(e),a=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.OBJECT_TYPE_DEFINITION,name:r,interfaces:t,fields:a,loc:loc(e,n)}}function parseImplementsInterfaces(e){var n=[];if("implements"===e.token.value){advance(e);do n.push(parseNamedType(e));while(!peek(e,_lexer.TokenKind.BRACE_L))}return n}function parseFieldDefinition(e){var n=e.token.start,r=parseName(e),t=parseArgumentDefs(e);expect(e,_lexer.TokenKind.COLON);var a=parseType(e);return{kind:_kinds.FIELD_DEFINITION,name:r,arguments:t,type:a,loc:loc(e,n)}}function parseArgumentDefs(e){return peek(e,_lexer.TokenKind.PAREN_L)?many(e,_lexer.TokenKind.PAREN_L,parseInputValueDef,_lexer.TokenKind.PAREN_R):[]}function parseInputValueDef(e){var n=e.token.start,r=parseName(e);expect(e,_lexer.TokenKind.COLON);var t=parseType(e),a=null;return skip(e,_lexer.TokenKind.EQUALS)&&(a=parseConstValue(e)),{kind:_kinds.INPUT_VALUE_DEFINITION,name:r,type:t,defaultValue:a,loc:loc(e,n)}}function parseInterfaceTypeDefinition(e){var n=e.token.start;expectKeyword(e,"interface");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseFieldDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INTERFACE_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseUnionTypeDefinition(e){var n=e.token.start;expectKeyword(e,"union");var r=parseName(e);expect(e,_lexer.TokenKind.EQUALS);var t=parseUnionMembers(e);return{kind:_kinds.UNION_TYPE_DEFINITION,
name:r,types:t,loc:loc(e,n)}}function parseUnionMembers(e){var n=[];do n.push(parseNamedType(e));while(skip(e,_lexer.TokenKind.PIPE));return n}function parseScalarTypeDefinition(e){var n=e.token.start;expectKeyword(e,"scalar");var r=parseName(e);return{kind:_kinds.SCALAR_TYPE_DEFINITION,name:r,loc:loc(e,n)}}function parseEnumTypeDefinition(e){var n=e.token.start;expectKeyword(e,"enum");var r=parseName(e),t=many(e,_lexer.TokenKind.BRACE_L,parseEnumValueDefinition,_lexer.TokenKind.BRACE_R);return{kind:_kinds.ENUM_TYPE_DEFINITION,name:r,values:t,loc:loc(e,n)}}function parseEnumValueDefinition(e){var n=e.token.start,r=parseName(e);return{kind:_kinds.ENUM_VALUE_DEFINITION,name:r,loc:loc(e,n)}}function parseInputObjectTypeDefinition(e){var n=e.token.start;expectKeyword(e,"input");var r=parseName(e),t=any(e,_lexer.TokenKind.BRACE_L,parseInputValueDef,_lexer.TokenKind.BRACE_R);return{kind:_kinds.INPUT_OBJECT_TYPE_DEFINITION,name:r,fields:t,loc:loc(e,n)}}function parseTypeExtensionDefinition(e){var n=e.token.start;expectKeyword(e,"extend");var r=parseObjectTypeDefinition(e);return{kind:_kinds.TYPE_EXTENSION_DEFINITION,definition:r,loc:loc(e,n)}}function makeParser(e,n){var r=(0,_lexer.lex)(e);return{_lexToken:r,source:e,options:n,prevEnd:0,token:r()}}function loc(e,n){return e.options.noLocation?null:e.options.noSource?{start:n,end:e.prevEnd}:{start:n,end:e.prevEnd,source:e.source}}function advance(e){var n=e.token.end;e.prevEnd=n,e.token=e._lexToken(n)}function peek(e,n){return e.token.kind===n}function skip(e,n){var r=e.token.kind===n;return r&&advance(e),r}function expect(e,n){var r=e.token;if(r.kind===n)return advance(e),r;throw(0,_error.syntaxError)(e.source,r.start,"Expected "+(0,_lexer.getTokenKindDesc)(n)+", found "+(0,_lexer.getTokenDesc)(r))}function expectKeyword(e,n){var r=e.token;if(r.kind===_lexer.TokenKind.NAME&&r.value===n)return advance(e),r;throw(0,_error.syntaxError)(e.source,r.start,'Expected "'+n+'", found '+(0,_lexer.getTokenDesc)(r))}function unexpected(e,n){var r=n||e.token;return(0,_error.syntaxError)(e.source,r.start,"Unexpected "+(0,_lexer.getTokenDesc)(r))}function any(e,n,r,t){expect(e,n);for(var a=[];!skip(e,t);)a.push(r(e));return a}function many(e,n,r,t){expect(e,n);for(var a=[r(e)];!skip(e,t);)a.push(r(e));return a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.parse=parse,exports.parseValue=parseValue,exports.parseConstValue=parseConstValue,exports.parseType=parseType,exports.parseNamedType=parseNamedType;var _source=require("./source"),_error=require("../error"),_lexer=require("./lexer"),_kinds=require("./kinds")},{"../error":145,"./kinds":159,"./lexer":160,"./source":164}],163:[function(require,module,exports){"use strict";function print(n){return(0,_visitor.visit)(n,{leave:printDocASTReducer})}function join(n,e){return n?n.filter(function(n){return n}).join(e||""):""}function block(n){return length(n)?indent("{\n"+join(n,"\n"))+"\n}":""}function wrap(n,e,i){return e?n+e+(i||""):""}function indent(n){return n&&n.replace(/\n/g,"\n ")}function length(n){return n?n.length:0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.print=print;var _visitor=require("./visitor"),printDocASTReducer={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return join(n.definitions,"\n\n")+"\n"},OperationDefinition:function(n){var e=n.operation,i=n.name,t=wrap("(",join(n.variableDefinitions,", "),")"),r=join(n.directives," "),u=n.selectionSet;return i||r||t||"query"!==e?join([e,join([i,t]),r,u]," "):u},VariableDefinition:function(n){var e=n.variable,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},SelectionSet:function(n){var e=n.selections;return block(e)},Field:function(n){var e=n.alias,i=n.name,t=n.arguments,r=n.directives,u=n.selectionSet;return join([wrap("",e,": ")+i+wrap("(",join(t,", "),")"),join(r," "),u]," ")},Argument:function(n){var e=n.name,i=n.value;return e+": "+i},FragmentSpread:function(n){var e=n.name,i=n.directives;return"..."+e+wrap(" ",join(i," "))},InlineFragment:function(n){var e=n.typeCondition,i=n.directives,t=n.selectionSet;return join(["...",wrap("on ",e),join(i," "),t]," ")},FragmentDefinition:function(n){var e=n.name,i=n.typeCondition,t=n.directives,r=n.selectionSet;return"fragment "+e+" on "+i+" "+wrap("",join(t," ")," ")+r},IntValue:function(n){var e=n.value;return e},FloatValue:function(n){var e=n.value;return e},StringValue:function(n){var e=n.value;return JSON.stringify(e)},BooleanValue:function(n){var e=n.value;return JSON.stringify(e)},EnumValue:function(n){var e=n.value;return e},ListValue:function(n){var e=n.values;return"["+join(e,", ")+"]"},ObjectValue:function(n){var e=n.fields;return"{"+join(e,", ")+"}"},ObjectField:function(n){var e=n.name,i=n.value;return e+": "+i},Directive:function(n){var e=n.name,i=n.arguments;return"@"+e+wrap("(",join(i,", "),")")},NamedType:function(n){var e=n.name;return e},ListType:function(n){var e=n.type;return"["+e+"]"},NonNullType:function(n){var e=n.type;return e+"!"},ObjectTypeDefinition:function(n){var e=n.name,i=n.interfaces,t=n.fields;return"type "+e+" "+wrap("implements ",join(i,", ")," ")+block(t)},FieldDefinition:function(n){var e=n.name,i=n.arguments,t=n.type;return e+wrap("(",join(i,", "),")")+": "+t},InputValueDefinition:function(n){var e=n.name,i=n.type,t=n.defaultValue;return e+": "+i+wrap(" = ",t)},InterfaceTypeDefinition:function(n){var e=n.name,i=n.fields;return"interface "+e+" "+block(i)},UnionTypeDefinition:function(n){var e=n.name,i=n.types;return"union "+e+" = "+join(i," | ")},ScalarTypeDefinition:function(n){var e=n.name;return"scalar "+e},EnumTypeDefinition:function(n){var e=n.name,i=n.values;return"enum "+e+" "+block(i)},EnumValueDefinition:function(n){var e=n.name;return e},InputObjectTypeDefinition:function(n){var e=n.name,i=n.fields;return"input "+e+" "+block(i)},TypeExtensionDefinition:function(n){var e=n.definition;return"extend "+e}}},{"./visitor":165}],164:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var Source=function e(r,s){_classCallCheck(this,e),this.body=r,this.name=s||"GraphQL"};exports.Source=Source},{"babel-runtime/helpers/class-call-check":30}],165:[function(require,module,exports){"use strict";function visit(e,i,n){var t=n||QueryDocumentKeys,r=void 0,a=Array.isArray(e),o=[e],l=-1,s=[],f=void 0,u=[],v=[],p=e;do{l++;var d=l===o.length,y=void 0,c=void 0,m=d&&0!==s.length;if(d){if(y=0===v.length?void 0:u.pop(),c=f,f=v.pop(),m){if(a)c=c.slice();else{var g={};for(var A in c)c.hasOwnProperty(A)&&(g[A]=c[A]);c=g}for(var D=0,h=0;h<s.length;h++){var V=_slicedToArray(s[h],1),T=V[0],E=_slicedToArray(s[h],2),F=E[1];a&&(T-=D),a&&null===F?(c.splice(T,1),D++):c[T]=F}}l=r.index,o=r.keys,s=r.edits,a=r.inArray,r=r.prev}else{if(y=f?a?l:o[l]:void 0,c=f?f[y]:p,null===c||void 0===c)continue;f&&u.push(y)}var b=void 0;if(!Array.isArray(c)){if(!isNode(c))throw new Error("Invalid AST Node: "+JSON.stringify(c));var I=getVisitFn(i,c.kind,d);if(I){if(b=I.call(i,c,y,f,u,v),b===BREAK)break;if(b===!1){if(!d){u.pop();continue}}else if(void 0!==b&&(s.push([y,b]),!d)){if(!isNode(b)){u.pop();continue}c=b}}}void 0===b&&m&&s.push([y,c]),d||(r={inArray:a,index:l,keys:o,edits:s,prev:r},a=Array.isArray(c),o=a?c:t[c.kind]||[],l=-1,s=[],f&&v.push(f),f=c)}while(void 0!==r);return 0!==s.length&&(p=s[0][1]),p}function isNode(e){return e&&"string"==typeof e.kind}function visitInParallel(e){var i=new Array(e.length);return{enter:function(n){for(var t=0;t<e.length;t++)if(!i[t]){var r=getVisitFn(e[t],n.kind,!1);if(r){var a=r.apply(e[t],arguments);if(a===!1)i[t]=n;else if(a===BREAK)i[t]=BREAK;else if(void 0!==a)return a}}},leave:function(n){for(var t=0;t<e.length;t++)if(i[t])i[t]===n&&(i[t]=null);else{var r=getVisitFn(e[t],n.kind,!0);if(r){var a=r.apply(e[t],arguments);if(a===BREAK)i[t]=BREAK;else if(void 0!==a&&a!==!1)return a}}}}}function visitWithTypeInfo(e,i){return{enter:function(n){e.enter(n);var t=getVisitFn(i,n.kind,!1);if(t){var r=t.apply(i,arguments);return void 0!==r&&(e.leave(n),isNode(r)&&e.enter(r)),r}},leave:function(n){var t=getVisitFn(i,n.kind,!0),r=void 0;return t&&(r=t.apply(i,arguments)),e.leave(n),r}}}function getVisitFn(e,i,n){var t=e[i];if(t){if(!n&&"function"==typeof t)return t;var r=n?t.leave:t.enter;if("function"==typeof r)return r}else{var a=n?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[i];if("function"==typeof o)return o}}}var _slicedToArray=require("babel-runtime/helpers/sliced-to-array").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.visit=visit,exports.visitInParallel=visitInParallel,exports.visitWithTypeInfo=visitWithTypeInfo;var QueryDocumentKeys={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],ObjectTypeDefinition:["name","interfaces","fields"],FieldDefinition:["name","arguments","type"],InputValueDefinition:["name","type","defaultValue"],InterfaceTypeDefinition:["name","fields"],UnionTypeDefinition:["name","types"],ScalarTypeDefinition:["name"],EnumTypeDefinition:["name","values"],EnumValueDefinition:["name"],InputObjectTypeDefinition:["name","fields"],TypeExtensionDefinition:["definition"]};exports.QueryDocumentKeys=QueryDocumentKeys;var BREAK={};exports.BREAK=BREAK},{"babel-runtime/helpers/sliced-to-array":37}],166:[function(require,module,exports){"use strict";function isType(e){return e instanceof GraphQLScalarType||e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType||e instanceof GraphQLEnumType||e instanceof GraphQLInputObjectType||e instanceof GraphQLList||e instanceof GraphQLNonNull}function isInputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType||t instanceof GraphQLInputObjectType}function isOutputType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLObjectType||t instanceof GraphQLInterfaceType||t instanceof GraphQLUnionType||t instanceof GraphQLEnumType}function isLeafType(e){var t=getNamedType(e);return t instanceof GraphQLScalarType||t instanceof GraphQLEnumType}function isCompositeType(e){return e instanceof GraphQLObjectType||e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function isAbstractType(e){return e instanceof GraphQLInterfaceType||e instanceof GraphQLUnionType}function getNullableType(e){return e instanceof GraphQLNonNull?e.ofType:e}function getNamedType(e){for(var t=e;t instanceof GraphQLList||t instanceof GraphQLNonNull;)t=t.ofType;return t}function resolveMaybeThunk(e){return"function"==typeof e?e():e}function defineInterfaces(e,t){var n=resolveMaybeThunk(t);return n?((0,_jsutilsInvariant2.default)(Array.isArray(n),e+" interfaces must be an Array or a function which returns an Array."),n.forEach(function(t){(0,_jsutilsInvariant2.default)(t instanceof GraphQLInterfaceType,e+" may only implement Interface types, it cannot "+("implement: "+t+".")),"function"!=typeof t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof e.isTypeOf,"Interface Type "+t+' does not provide a "resolveType" function '+("and implementing Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this implementing type during execution.")}),n):[]}function defineFieldMap(e,t){var n=resolveMaybeThunk(t);(0,_jsutilsInvariant2.default)(isPlainObj(n),e+" fields must be an object with field names as keys or a function which returns such an object.");var a=_Object$keys(n);(0,_jsutilsInvariant2.default)(a.length>0,e+" fields must be an object with field names as keys or a function which returns such an object.");var s={};return a.forEach(function(t){assertValidName(t);var a=_extends({},n[t],{name:t});(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+t+' should provide "deprecationReason" instead of "isDeprecated".'),(0,_jsutilsInvariant2.default)(isOutputType(a.type),e+"."+t+" field type must be Output Type but "+("got: "+a.type+".")),a.args?((0,_jsutilsInvariant2.default)(isPlainObj(a.args),e+"."+t+" args must be an object with argument names as keys."),a.args=_Object$keys(a.args).map(function(n){assertValidName(n);var s=a.args[n];return(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+t+"("+n+":) argument type must be "+("Input Type but got: "+s.type+".")),{name:n,description:void 0===s.description?null:s.description,type:s.type,defaultValue:void 0===s.defaultValue?null:s.defaultValue}})):a.args=[],s[t]=a}),s}function isPlainObj(e){return e&&"object"==typeof e&&!Array.isArray(e)}function addImplementationToInterfaces(e){e.getInterfaces().forEach(function(t){t._implementations.push(e)})}function getTypeOf(e,t,n){for(var a=n.getPossibleTypes(),s=0;s<a.length;s++){var i=a[s];if("function"==typeof i.isTypeOf&&i.isTypeOf(e,t))return i}}function defineEnumValues(e,t){(0,_jsutilsInvariant2.default)(isPlainObj(t),e+" values must be an object with value names as keys.");var n=_Object$keys(t);return(0,_jsutilsInvariant2.default)(n.length>0,e+" values must be an object with value names as keys."),n.map(function(n){assertValidName(n);var a=t[n];return(0,_jsutilsInvariant2.default)(isPlainObj(a),e+"."+n+' must refer to an object with a "value" key '+("representing an internal value but got: "+a+".")),(0,_jsutilsInvariant2.default)(!a.hasOwnProperty("isDeprecated"),e+"."+n+' should provide "deprecationReason" instead of "isDeprecated".'),{name:n,description:a.description,deprecationReason:a.deprecationReason,value:(0,_jsutilsIsNullish2.default)(a.value)?n:a.value}})}function assertValidName(e){(0,_jsutilsInvariant2.default)(NAME_RX.test(e),'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'+e+'" does not.')}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_extends=require("babel-runtime/helpers/extends").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isType=isType,exports.isInputType=isInputType,exports.isOutputType=isOutputType,exports.isLeafType=isLeafType,exports.isCompositeType=isCompositeType,exports.isAbstractType=isAbstractType,exports.getNullableType=getNullableType,exports.getNamedType=getNamedType;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_languageKinds=require("../language/kinds"),GraphQLScalarType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,(0,_jsutilsInvariant2.default)("function"==typeof t.serialize,this+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(t.parseValue||t.parseLiteral)&&(0,_jsutilsInvariant2.default)("function"==typeof t.parseValue&&"function"==typeof t.parseLiteral,this+' must provide both "parseValue" and "parseLiteral" functions.'),this._scalarConfig=t}return _createClass(e,[{key:"serialize",value:function(e){var t=this._scalarConfig.serialize;return t(e)}},{key:"parseValue",value:function(e){var t=this._scalarConfig.parseValue;return t?t(e):null}},{key:"parseLiteral",value:function(e){var t=this._scalarConfig.parseLiteral;return t?t(e):null}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLScalarType=GraphQLScalarType;var GraphQLObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.isTypeOf&&(0,_jsutilsInvariant2.default)("function"==typeof t.isTypeOf,this+' must provide "isTypeOf" as a function.'),this.isTypeOf=t.isTypeOf,this._typeConfig=t,addImplementationToInterfaces(this)}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getInterfaces",value:function(){return this._interfaces||(this._interfaces=defineInterfaces(this,this._typeConfig.interfaces))}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLObjectType=GraphQLObjectType;var GraphQLInterfaceType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,this._typeConfig=t,this._implementations=[]}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=defineFieldMap(this,this._typeConfig.fields))}},{key:"getPossibleTypes",value:function(){return this._implementations}},{key:"isPossibleType",value:function(e){var t=this._possibleTypes||(this._possibleTypes=(0,_jsutilsKeyMap2.default)(this.getPossibleTypes(),function(e){return e.name}));return Boolean(t[e.name])}},{key:"getObjectType",value:function(e,t){var n=this.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInterfaceType=GraphQLInterfaceType;var GraphQLUnionType=function(){function e(t){var n=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,t.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof t.resolveType,this+' must provide "resolveType" as a function.'),this.resolveType=t.resolveType,(0,_jsutilsInvariant2.default)(Array.isArray(t.types)&&t.types.length>0,"Must provide Array of types for Union "+t.name+"."),t.types.forEach(function(e){(0,_jsutilsInvariant2.default)(e instanceof GraphQLObjectType,n+" may only contain Object types, it cannot contain: "+e+"."),"function"!=typeof n.resolveType&&(0,_jsutilsInvariant2.default)("function"==typeof e.isTypeOf,"Union Type "+n+' does not provide a "resolveType" function '+("and possible Type "+e+' does not provide a "isTypeOf" ')+"function. There is no way to resolve this possible type during execution.")}),this._types=t.types,this._typeConfig=t}return _createClass(e,[{key:"getPossibleTypes",value:function(){return this._types}},{key:"isPossibleType",value:function(e){var t=this._possibleTypeNames;return t||(this._possibleTypeNames=t=this.getPossibleTypes().reduce(function(e,t){return e[t.name]=!0,e},{})),t[e.name]===!0}},{key:"getObjectType",value:function(e,t){var n=this._typeConfig.resolveType;return n?n(e,t):getTypeOf(e,t,this)}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLUnionType=GraphQLUnionType;var GraphQLEnumType=function(){function e(t){_classCallCheck(this,e),this.name=t.name,assertValidName(t.name),this.description=t.description,this._values=defineEnumValues(this,t.values),this._enumConfig=t}return _createClass(e,[{key:"getValues",value:function(){return this._values}},{key:"serialize",value:function(e){var t=this._getValueLookup().get(e);return t?t.name:null}},{key:"parseValue",value:function(e){if("string"==typeof e){var t=this._getNameLookup()[e];if(t)return t.value}}},{key:"parseLiteral",value:function(e){if(e.kind===_languageKinds.ENUM){var t=this._getNameLookup()[e.value];if(t)return t.value}}},{key:"_getValueLookup",value:function(){var e=this;return this._valueLookup||!function(){var t=new _Map;e.getValues().forEach(function(e){t.set(e.value,e)}),e._valueLookup=t}(),this._valueLookup}},{key:"_getNameLookup",value:function(){var e=this;return this._nameLookup||!function(){var t=_Object$create(null);e.getValues().forEach(function(e){t[e.name]=e}),e._nameLookup=t}(),this._nameLookup}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLEnumType=GraphQLEnumType;var GraphQLInputObjectType=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(t.name,"Type must be named."),assertValidName(t.name),this.name=t.name,this.description=t.description,this._typeConfig=t}return _createClass(e,[{key:"getFields",value:function(){return this._fields||(this._fields=this._defineFieldMap())}},{key:"_defineFieldMap",value:function(){var e=this,t=resolveMaybeThunk(this._typeConfig.fields);(0,_jsutilsInvariant2.default)(isPlainObj(t),this+" fields must be an object with field names as keys or a function which returns such an object.");var n=_Object$keys(t);(0,_jsutilsInvariant2.default)(n.length>0,this+" fields must be an object with field names as keys or a function which returns such an object.");var a={};return n.forEach(function(n){assertValidName(n);var s=_extends({},t[n],{name:n});(0,_jsutilsInvariant2.default)(isInputType(s.type),e+"."+n+" field type must be Input Type but "+("got: "+s.type+".")),a[n]=s}),a}},{key:"toString",value:function(){return this.name}}]),e}();exports.GraphQLInputObjectType=GraphQLInputObjectType;var GraphQLList=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t),"Can only create List of a GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return"["+String(this.ofType)+"]"}}]),e}();exports.GraphQLList=GraphQLList;var GraphQLNonNull=function(){function e(t){_classCallCheck(this,e),(0,_jsutilsInvariant2.default)(isType(t)&&!(t instanceof e),"Can only create NonNull of a Nullable GraphQLType but got: "+t+"."),this.ofType=t}return _createClass(e,[{key:"toString",value:function(){return this.ofType.toString()+"!"}}]),e}();exports.GraphQLNonNull=GraphQLNonNull;var NAME_RX=/^[_a-zA-Z][_a-zA-Z0-9]*$/},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../jsutils/keyMap":156,"../language/kinds":159,"babel-runtime/core-js/map":21,"babel-runtime/core-js/object/create":23,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/extends":32,"babel-runtime/helpers/interop-require-default":35}],167:[function(require,module,exports){"use strict";var _classCallCheck=require("babel-runtime/helpers/class-call-check").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_scalars=require("./scalars"),GraphQLDirective=function e(i){_classCallCheck(this,e),this.name=i.name,this.description=i.description,this.args=i.args||[],this.onOperation=Boolean(i.onOperation),this.onFragment=Boolean(i.onFragment),this.onField=Boolean(i.onField)};exports.GraphQLDirective=GraphQLDirective;var GraphQLIncludeDirective=new GraphQLDirective({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Included when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLIncludeDirective=GraphQLIncludeDirective;var GraphQLSkipDirective=new GraphQLDirective({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",args:[{name:"if",type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),description:"Skipped when true."}],onOperation:!1,onFragment:!0,onField:!0});exports.GraphQLSkipDirective=GraphQLSkipDirective},{"./definition":166,"./scalars":170,"babel-runtime/helpers/class-call-check":30}],168:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _schema=require("./schema");Object.defineProperty(exports,"GraphQLSchema",{enumerable:!0,get:function(){return _schema.GraphQLSchema}});var _definition=require("./definition");Object.defineProperty(exports,"isType",{enumerable:!0,get:function(){return _definition.isType}}),Object.defineProperty(exports,"isInputType",{enumerable:!0,get:function(){return _definition.isInputType}}),Object.defineProperty(exports,"isOutputType",{enumerable:!0,get:function(){return _definition.isOutputType}}),Object.defineProperty(exports,"isLeafType",{enumerable:!0,get:function(){return _definition.isLeafType}}),Object.defineProperty(exports,"isCompositeType",{enumerable:!0,get:function(){return _definition.isCompositeType}}),Object.defineProperty(exports,"isAbstractType",{enumerable:!0,get:function(){return _definition.isAbstractType}}),Object.defineProperty(exports,"getNullableType",{enumerable:!0,get:function(){return _definition.getNullableType}}),Object.defineProperty(exports,"getNamedType",{enumerable:!0,get:function(){return _definition.getNamedType}}),Object.defineProperty(exports,"GraphQLScalarType",{enumerable:!0,get:function(){return _definition.GraphQLScalarType}}),Object.defineProperty(exports,"GraphQLObjectType",{enumerable:!0,get:function(){return _definition.GraphQLObjectType}}),Object.defineProperty(exports,"GraphQLInterfaceType",{enumerable:!0,get:function(){return _definition.GraphQLInterfaceType}}),Object.defineProperty(exports,"GraphQLUnionType",{enumerable:!0,get:function(){return _definition.GraphQLUnionType}}),Object.defineProperty(exports,"GraphQLEnumType",{enumerable:!0,get:function(){return _definition.GraphQLEnumType}}),Object.defineProperty(exports,"GraphQLInputObjectType",{enumerable:!0,get:function(){return _definition.GraphQLInputObjectType}}),Object.defineProperty(exports,"GraphQLList",{enumerable:!0,get:function(){return _definition.GraphQLList}}),Object.defineProperty(exports,"GraphQLNonNull",{enumerable:!0,get:function(){return _definition.GraphQLNonNull}});var _scalars=require("./scalars");Object.defineProperty(exports,"GraphQLInt",{enumerable:!0,get:function(){return _scalars.GraphQLInt}}),Object.defineProperty(exports,"GraphQLFloat",{enumerable:!0,get:function(){return _scalars.GraphQLFloat}}),Object.defineProperty(exports,"GraphQLString",{enumerable:!0,get:function(){return _scalars.GraphQLString}}),Object.defineProperty(exports,"GraphQLBoolean",{enumerable:!0,get:function(){return _scalars.GraphQLBoolean}}),Object.defineProperty(exports,"GraphQLID",{enumerable:!0,get:function(){return _scalars.GraphQLID}})},{"./definition":166,"./scalars":170,"./schema":171}],169:[function(require,module,exports){"use strict";var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_definition=require("./definition"),_scalars=require("./scalars"),__Schema=new _definition.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{types:{description:"A list of all types supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type))),resolve:function(e){var i=e.getTypeMap();return _Object$keys(i).map(function(e){return i[e]})}},queryType:{description:"The type that query operations will be rooted at.",type:new _definition.GraphQLNonNull(__Type),resolve:function(e){return e.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:__Type,resolve:function(e){return e.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:__Type,resolve:function(e){return e.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__Directive))),resolve:function(e){return e.getDirectives()}}}}});exports.__Schema=__Schema;var __Directive=new _definition.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL’s execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},onOperation:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onFragment:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)},onField:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean)}}}}),__Type=new _definition.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new _definition.GraphQLNonNull(__TypeKind),resolve:function(e){if(e instanceof _definition.GraphQLScalarType)return TypeKind.SCALAR;if(e instanceof _definition.GraphQLObjectType)return TypeKind.OBJECT;if(e instanceof _definition.GraphQLInterfaceType)return TypeKind.INTERFACE;if(e instanceof _definition.GraphQLUnionType)return TypeKind.UNION;if(e instanceof _definition.GraphQLEnumType)return TypeKind.ENUM;if(e instanceof _definition.GraphQLInputObjectType)return TypeKind.INPUT_OBJECT;if(e instanceof _definition.GraphQLList)return TypeKind.LIST;if(e instanceof _definition.GraphQLNonNull)return TypeKind.NON_NULL;throw new Error("Unknown kind of type: "+e)}},name:{type:_scalars.GraphQLString},description:{type:_scalars.GraphQLString},fields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Field)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLObjectType||e instanceof _definition.GraphQLInterfaceType){var t=function(){var i=e.getFields(),t=_Object$keys(i).map(function(e){return i[e]});return n||(t=t.filter(function(e){return!e.deprecationReason})),{v:t}}();if("object"==typeof t)return t.v;
}return null}},interfaces:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLObjectType?e.getInterfaces():void 0}},possibleTypes:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)),resolve:function(e){return e instanceof _definition.GraphQLInterfaceType||e instanceof _definition.GraphQLUnionType?e.getPossibleTypes():void 0}},enumValues:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__EnumValue)),args:{includeDeprecated:{type:_scalars.GraphQLBoolean,defaultValue:!1}},resolve:function(e,i){var n=i.includeDeprecated;if(e instanceof _definition.GraphQLEnumType){var t=e.getValues();return n||(t=t.filter(function(e){return!e.deprecationReason})),t}}},inputFields:{type:new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)),resolve:function(e){if(e instanceof _definition.GraphQLInputObjectType){var i=function(){var i=e.getFields();return{v:_Object$keys(i).map(function(e){return i[e]})}}();if("object"==typeof i)return i.v}}},ofType:{type:__Type}}}}),__Field=new _definition.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},args:{type:new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))),resolve:function(e){return e.args||[]}},type:{type:new _definition.GraphQLNonNull(__Type)},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),__InputValue=new _definition.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},type:{type:new _definition.GraphQLNonNull(__Type)},defaultValue:{type:_scalars.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(e){return(0,_jsutilsIsNullish2.default)(e.defaultValue)?null:(0,_languagePrinter.print)((0,_utilitiesAstFromValue.astFromValue)(e.defaultValue,e))}}}}}),__EnumValue=new _definition.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new _definition.GraphQLNonNull(_scalars.GraphQLString)},description:{type:_scalars.GraphQLString},isDeprecated:{type:new _definition.GraphQLNonNull(_scalars.GraphQLBoolean),resolve:function(e){return!(0,_jsutilsIsNullish2.default)(e.deprecationReason)}},deprecationReason:{type:_scalars.GraphQLString}}}}),TypeKind={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"};exports.TypeKind=TypeKind;var __TypeKind=new _definition.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:TypeKind.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:TypeKind.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:TypeKind.INTERFACE,description:"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields."},UNION:{value:TypeKind.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:TypeKind.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:TypeKind.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:TypeKind.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:TypeKind.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),SchemaMetaFieldDef={name:"__schema",type:new _definition.GraphQLNonNull(__Schema),description:"Access the current type schema of this server.",args:[],resolve:function(e,i,n){var t=n.schema;return t}};exports.SchemaMetaFieldDef=SchemaMetaFieldDef;var TypeMetaFieldDef={name:"__type",type:__Type,description:"Request the type information of a single type.",args:[{name:"name",type:new _definition.GraphQLNonNull(_scalars.GraphQLString)}],resolve:function(e,i,n){var t=i.name,r=n.schema;return function(){return r.getType(t)}()}};exports.TypeMetaFieldDef=TypeMetaFieldDef;var TypeNameMetaFieldDef={name:"__typename",type:new _definition.GraphQLNonNull(_scalars.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(e,i,n){var t=n.parentType;return t.name}};exports.TypeNameMetaFieldDef=TypeNameMetaFieldDef},{"../jsutils/isNullish":155,"../language/printer":163,"../utilities/astFromValue":173,"./definition":166,"./scalars":170,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],170:[function(require,module,exports){"use strict";function coerceInt(e){var a=Number(e);return a===a&&MAX_INT>=a&&a>=MIN_INT?(0>a?Math.ceil:Math.floor)(a):null}function coerceFloat(e){var a=Number(e);return a===a?a:null}Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_language=require("../language"),MAX_INT=2147483647,MIN_INT=-2147483648,GraphQLInt=new _definition.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ",serialize:coerceInt,parseValue:coerceInt,parseLiteral:function(e){if(e.kind===_language.Kind.INT){var a=parseInt(e.value,10);if(MAX_INT>=a&&a>=MIN_INT)return a}return null}});exports.GraphQLInt=GraphQLInt;var GraphQLFloat=new _definition.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ",serialize:coerceFloat,parseValue:coerceFloat,parseLiteral:function(e){return e.kind===_language.Kind.FLOAT||e.kind===_language.Kind.INT?parseFloat(e.value):null}});exports.GraphQLFloat=GraphQLFloat;var GraphQLString=new _definition.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING?e.value:null}});exports.GraphQLString=GraphQLString;var GraphQLBoolean=new _definition.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Boolean,parseValue:Boolean,parseLiteral:function(e){return e.kind===_language.Kind.BOOLEAN?e.value:null}});exports.GraphQLBoolean=GraphQLBoolean;var GraphQLID=new _definition.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:String,parseValue:String,parseLiteral:function(e){return e.kind===_language.Kind.STRING||e.kind===_language.Kind.INT?e.value:null}});exports.GraphQLID=GraphQLID},{"../language":158,"./definition":166}],171:[function(require,module,exports){"use strict";function typeMapReducer(e,t){for(var i=!0;i;){var r=e,n=t;if(a=void 0,i=!1,!n)return r;if(!(n instanceof _definition.GraphQLList||n instanceof _definition.GraphQLNonNull)){if(r[n.name])return(0,_jsutilsInvariant2.default)(r[n.name]===n,"Schema must contain unique named types but contains multiple "+('types named "'+n+'".')),r;r[n.name]=n;var a=r;return(n instanceof _definition.GraphQLUnionType||n instanceof _definition.GraphQLInterfaceType)&&(a=n.getPossibleTypes().reduce(typeMapReducer,a)),n instanceof _definition.GraphQLObjectType&&(a=n.getInterfaces().reduce(typeMapReducer,a)),(n instanceof _definition.GraphQLObjectType||n instanceof _definition.GraphQLInterfaceType||n instanceof _definition.GraphQLInputObjectType)&&!function(){var e=n.getFields();_Object$keys(e).forEach(function(t){var i=e[t];if(i.args){var r=i.args.map(function(e){return e.type});a=r.reduce(typeMapReducer,a)}a=typeMapReducer(a,i.type)})}(),a}e=r,t=n.ofType,i=!0}}function assertObjectImplementsInterface(e,t){var i=e.getFields(),r=t.getFields();_Object$keys(r).forEach(function(n){var a=i[n],s=r[n];(0,_jsutilsInvariant2.default)(a,'"'+t+'" expects field "'+n+'" but "'+e+'" does not provide it.'),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isTypeSubTypeOf)(a.type,s.type),t+"."+n+' expects type "'+s.type+'" but '+(e+"."+n+' provides type "'+a.type+'".')),s.args.forEach(function(i){var r=i.name,s=(0,_jsutilsFind2.default)(a.args,function(e){return e.name===r});(0,_jsutilsInvariant2.default)(s,t+"."+n+' expects argument "'+r+'" but '+(e+"."+n+" does not provide it.")),(0,_jsutilsInvariant2.default)((0,_utilitiesTypeComparators.isEqualType)(i.type,s.type),t+"."+n+"("+r+':) expects type "'+i.type+'" '+("but "+e+"."+n+"("+r+":) provides ")+('type "'+s.type+'".'))}),a.args.forEach(function(i){var r=i.name,a=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===r});a||(0,_jsutilsInvariant2.default)(!(i.type instanceof _definition.GraphQLNonNull),e+"."+n+"("+r+":) is of required type "+('"'+i.type+'" but is not also provided by the ')+("interface "+t+"."+n+"."))})})}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _definition=require("./definition"),_directives=require("./directives"),_introspection=require("./introspection"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_utilitiesTypeComparators=require("../utilities/typeComparators"),GraphQLSchema=function(){function e(t){var i=this;_classCallCheck(this,e),(0,_jsutilsInvariant2.default)("object"==typeof t,"Must provide configuration object."),(0,_jsutilsInvariant2.default)(t.query instanceof _definition.GraphQLObjectType,"Schema query must be Object Type but got: "+t.query+"."),this._queryType=t.query,(0,_jsutilsInvariant2.default)(!t.mutation||t.mutation instanceof _definition.GraphQLObjectType,"Schema mutation must be Object Type if provided but "+("got: "+t.mutation+".")),this._mutationType=t.mutation,(0,_jsutilsInvariant2.default)(!t.subscription||t.subscription instanceof _definition.GraphQLObjectType,"Schema subscription must be Object Type if provided but "+("got: "+t.subscription+".")),this._subscriptionType=t.subscription,(0,_jsutilsInvariant2.default)(!t.directives||Array.isArray(t.directives)&&t.directives.every(function(e){return e instanceof _directives.GraphQLDirective}),"Schema directives must be Array<GraphQLDirective> if provided but "+("got: "+t.directives+".")),this._directives=t.directives||[_directives.GraphQLIncludeDirective,_directives.GraphQLSkipDirective],this._typeMap=[this.getQueryType(),this.getMutationType(),this.getSubscriptionType(),_introspection.__Schema].reduce(typeMapReducer,{}),_Object$keys(this._typeMap).forEach(function(e){var t=i._typeMap[e];t instanceof _definition.GraphQLObjectType&&t.getInterfaces().forEach(function(e){return assertObjectImplementsInterface(t,e)})})}return _createClass(e,[{key:"getQueryType",value:function(){return this._queryType}},{key:"getMutationType",value:function(){return this._mutationType}},{key:"getSubscriptionType",value:function(){return this._subscriptionType}},{key:"getTypeMap",value:function(){return this._typeMap}},{key:"getType",value:function(e){return this.getTypeMap()[e]}},{key:"getDirectives",value:function(){return this._directives}},{key:"getDirective",value:function(e){return(0,_jsutilsFind2.default)(this.getDirectives(),function(t){return t.name===e})}}]),e}();exports.GraphQLSchema=GraphQLSchema},{"../jsutils/find":153,"../jsutils/invariant":154,"../utilities/typeComparators":184,"./definition":166,"./directives":167,"./introspection":169,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35}],172:[function(require,module,exports){"use strict";function getFieldDef(e,t,i){var n=i.name.value;return n===_typeIntrospection.SchemaMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.SchemaMetaFieldDef:n===_typeIntrospection.TypeMetaFieldDef.name&&e.getQueryType()===t?_typeIntrospection.TypeMetaFieldDef:n===_typeIntrospection.TypeNameMetaFieldDef.name&&(t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType||t instanceof _typeDefinition.GraphQLUnionType)?_typeIntrospection.TypeNameMetaFieldDef:t instanceof _typeDefinition.GraphQLObjectType||t instanceof _typeDefinition.GraphQLInterfaceType?t.getFields()[n]:void 0}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0});var _languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition"),_typeIntrospection=require("../type/introspection"),_typeFromAST=require("./typeFromAST"),_jsutilsFind=require("../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),TypeInfo=function(){function e(t,i){_classCallCheck(this,e),this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._directive=null,this._argument=null,this._getFieldDef=i||getFieldDef}return _createClass(e,[{key:"getType",value:function(){return this._typeStack.length>0?this._typeStack[this._typeStack.length-1]:void 0}},{key:"getParentType",value:function(){return this._parentTypeStack.length>0?this._parentTypeStack[this._parentTypeStack.length-1]:void 0}},{key:"getInputType",value:function(){return this._inputTypeStack.length>0?this._inputTypeStack[this._inputTypeStack.length-1]:void 0}},{key:"getFieldDef",value:function(){return this._fieldDefStack.length>0?this._fieldDefStack[this._fieldDefStack.length-1]:void 0}},{key:"getDirective",value:function(){return this._directive}},{key:"getArgument",value:function(){return this._argument}},{key:"enter",value:function(e){var t=this._schema;switch(e.kind){case Kind.SELECTION_SET:var i=(0,_typeDefinition.getNamedType)(this.getType()),n=void 0;(0,_typeDefinition.isCompositeType)(i)&&(n=i),this._parentTypeStack.push(n);break;case Kind.FIELD:var a=this.getParentType(),p=void 0;a&&(p=this._getFieldDef(t,a,e)),this._fieldDefStack.push(p),this._typeStack.push(p&&p.type);break;case Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case Kind.OPERATION_DEFINITION:var r=void 0;"query"===e.operation?r=t.getQueryType():"mutation"===e.operation?r=t.getMutationType():"subscription"===e.operation&&(r=t.getSubscriptionType()),this._typeStack.push(r);break;case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:var s=e.typeCondition,c=s?(0,_typeFromAST.typeFromAST)(t,s):this.getType();this._typeStack.push(c);break;case Kind.VARIABLE_DEFINITION:var u=(0,_typeFromAST.typeFromAST)(t,e.type);this._inputTypeStack.push(u);break;case Kind.ARGUMENT:var o=void 0,y=void 0,_=this.getDirective()||this.getFieldDef();_&&(o=(0,_jsutilsFind2.default)(_.args,function(t){return t.name===e.name.value}),o&&(y=o.type)),this._argument=o,this._inputTypeStack.push(y);break;case Kind.LIST:var l=(0,_typeDefinition.getNullableType)(this.getInputType());this._inputTypeStack.push(l instanceof _typeDefinition.GraphQLList?l.ofType:void 0);break;case Kind.OBJECT_FIELD:var h=(0,_typeDefinition.getNamedType)(this.getInputType()),d=void 0;if(h instanceof _typeDefinition.GraphQLInputObjectType){var T=h.getFields()[e.name.value];d=T?T.type:void 0}this._inputTypeStack.push(d)}}},{key:"leave",value:function(e){switch(e.kind){case Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Kind.DIRECTIVE:this._directive=null;break;case Kind.OPERATION_DEFINITION:case Kind.INLINE_FRAGMENT:case Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Kind.ARGUMENT:this._argument=null,this._inputTypeStack.pop();break;case Kind.LIST:case Kind.OBJECT_FIELD:this._inputTypeStack.pop()}}}]),e}();exports.TypeInfo=TypeInfo},{"../jsutils/find":153,"../language/kinds":159,"../type/definition":166,"../type/introspection":169,"./typeFromAST":185,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/interop-require-wildcard":36}],173:[function(require,module,exports){"use strict";function astFromValue(e,i){var n=!0;e:for(;n;){var a=e,t=i;r=u=s=l=o=void 0,n=!1;var r=a;if(!(t instanceof _typeDefinition.GraphQLNonNull)){if((0,_jsutilsIsNullish2.default)(r))return null;if(Array.isArray(r)){var u=function(){var e=t instanceof _typeDefinition.GraphQLList?t.ofType:null;return{v:{kind:_languageKinds.LIST,values:r.map(function(i){var n=astFromValue(i,e);return(0,_jsutilsInvariant2.default)(n,"Could not create AST item."),n})}}}();if("object"==typeof u)return u.v}else if(t instanceof _typeDefinition.GraphQLList){e=r,i=t.ofType,n=!0;continue e}if("boolean"==typeof r)return{kind:_languageKinds.BOOLEAN,value:r};if("number"==typeof r){var s=String(r),l=/^[0-9]+$/.test(s);return l?t===_typeScalars.GraphQLFloat?{kind:_languageKinds.FLOAT,value:s+".0"}:{kind:_languageKinds.INT,value:s}:{kind:_languageKinds.FLOAT,value:s}}if("string"==typeof r)return t instanceof _typeDefinition.GraphQLEnumType&&/^[_a-zA-Z][_a-zA-Z0-9]*$/.test(r)?{kind:_languageKinds.ENUM,value:r}:{kind:_languageKinds.STRING,value:JSON.stringify(r).slice(1,-1)};(0,_jsutilsInvariant2.default)("object"==typeof r&&null!==r);var o=[];return _Object$keys(r).forEach(function(e){var i=void 0;if(t instanceof _typeDefinition.GraphQLInputObjectType){var n=t.getFields()[e];i=n&&n.type}var a=astFromValue(r[e],i);a&&o.push({kind:_languageKinds.OBJECT_FIELD,name:{kind:_languageKinds.NAME,value:e},value:a})}),{kind:_languageKinds.OBJECT,fields:o}}e=r,i=t.ofType,n=!0}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.astFromValue=astFromValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars")},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../language/kinds":159,"../type/definition":166,"../type/scalars":170,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],174:[function(require,module,exports){"use strict";function buildWrappedType(e,n){if(n.kind===_languageKinds.LIST_TYPE)return new _type.GraphQLList(buildWrappedType(e,n.type));if(n.kind===_languageKinds.NON_NULL_TYPE){var r=buildWrappedType(e,n.type);return(0,_jsutilsInvariant2.default)(!(r instanceof _type.GraphQLNonNull),"No nesting nonnull."),new _type.GraphQLNonNull(r)}return e}function getNamedTypeAST(e){for(var n=e;n.kind===_languageKinds.LIST_TYPE||n.kind===_languageKinds.NON_NULL_TYPE;)n=n.type;return n}function buildASTSchema(e,n,r,t){function u(e){var n=i(e.name.value);return(0,_jsutilsInvariant2.default)(n instanceof _type.GraphQLObjectType,"AST must provide object type."),n}function a(e){var n=getNamedTypeAST(e).name.value,r=i(n);return buildWrappedType(r,e)}function i(e){if(m[e])return m[e];if(!g[e])throw new Error("Type "+e+" not found in document");var n=l(g[e]);if(!n)throw new Error("Nothing constructed for "+e);return m[e]=n,n}function l(e){if(!e)throw new Error("def must be defined");switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return s(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return f(e);case _languageKinds.ENUM_TYPE_DEFINITION:return c(e);case _languageKinds.UNION_TYPE_DEFINITION:return d(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return y(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return T(e);default:throw new Error(e.kind+" not supported")}}function s(e){var n=e.name.value,r={name:n,fields:function(){return o(e)},interfaces:function(){return p(e)}};return new _type.GraphQLObjectType(r)}function o(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:a(e.type),args:_(e.arguments)}})}function p(e){return e.interfaces.map(function(e){return a(e)})}function _(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name.value},function(e){var n=a(e.type);return{type:n,defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function f(e){var n=e.name.value,r={name:n,resolveType:function(){return null},fields:function(){return o(e)}};return new _type.GraphQLInterfaceType(r)}function c(e){var n=new _type.GraphQLEnumType({name:e.name.value,values:(0,_jsutilsKeyValMap2.default)(e.values,function(e){return e.name.value},function(){return{}})});return n}function d(e){return new _type.GraphQLUnionType({name:e.name.value,resolveType:function(){return null},types:e.types.map(function(e){return a(e)})})}function y(e){return new _type.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function T(e){return new _type.GraphQLInputObjectType({name:e.name.value,fields:function(){return _(e.fields)}})}if(!e)throw new Error("must pass in ast");if(!n)throw new Error("must pass in query type");for(var I=[],E=0;E<e.definitions.length;E++){var N=e.definitions[E];switch(N.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:case _languageKinds.INTERFACE_TYPE_DEFINITION:case _languageKinds.ENUM_TYPE_DEFINITION:case _languageKinds.UNION_TYPE_DEFINITION:case _languageKinds.SCALAR_TYPE_DEFINITION:case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:I.push(N)}}var g=(0,_jsutilsKeyMap2.default)(I,function(e){return e.name.value});if(!g[n])throw new Error("Specified query type "+n+" not found in document.");if(r&&!g[r])throw new Error("Specified mutation type "+r+" not found in document.");if(t&&!g[t])throw new Error("Specified subscription type "+t+" not found in document.");var m={String:_type.GraphQLString,Int:_type.GraphQLInt,Float:_type.GraphQLFloat,Boolean:_type.GraphQLBoolean,ID:_type.GraphQLID};return I.forEach(function(e){return i(e.name.value)}),new _type.GraphQLSchema({query:u(g[n]),mutation:r?u(g[r]):null,subscription:t?u(g[t]):null})}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildASTSchema=buildASTSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageKinds=require("../language/kinds"),_type=require("../type")},{"../jsutils/invariant":154,"../jsutils/keyMap":156,"../jsutils/keyValMap":157,"../language/kinds":159,"../type":168,"./valueFromAST":186,"babel-runtime/helpers/interop-require-default":35}],175:[function(require,module,exports){"use strict";function buildClientSchema(e){function n(e){if(e.kind===_typeIntrospection.TypeKind.LIST){var r=e.ofType;if(!r)throw new Error("Decorated type deeper than introspection query.");return new _typeDefinition.GraphQLList(n(r))}if(e.kind===_typeIntrospection.TypeKind.NON_NULL){var i=e.ofType;if(!i)throw new Error("Decorated type deeper than introspection query.");var a=n(i);return(0,_jsutilsInvariant2.default)(!(a instanceof _typeDefinition.GraphQLNonNull),"No nesting nonnull."),new _typeDefinition.GraphQLNonNull(a)}return t(e.name)}function t(e){if(I[e])return I[e];var n=T[e];if(!n)throw new Error("Invalid or incomplete schema, unknown type: "+e+". Ensure that a full introspection query is used in order to build a client schema.");var t=u(n);return I[e]=t,t}function r(e){var t=n(e);return(0,_jsutilsInvariant2.default)((0,_typeDefinition.isInputType)(t),"Introspection must provide input type for arguments."),t}function i(e){var t=n(e);return(0,_jsutilsInvariant2.default)((0,_typeDefinition.isOutputType)(t),"Introspection must provide output type for fields."),t}function a(e){var t=n(e);return(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLObjectType,"Introspection must provide object type for possibleTypes."),t}function o(e){var t=n(e);return(0,_jsutilsInvariant2.default)(t instanceof _typeDefinition.GraphQLInterfaceType,"Introspection must provide interface type for interfaces."),t}function u(e){switch(e.kind){case _typeIntrospection.TypeKind.SCALAR:return p(e);case _typeIntrospection.TypeKind.OBJECT:return s(e);case _typeIntrospection.TypeKind.INTERFACE:return c(e);case _typeIntrospection.TypeKind.UNION:return l(e);case _typeIntrospection.TypeKind.ENUM:return f(e);case _typeIntrospection.TypeKind.INPUT_OBJECT:return y(e);default:throw new Error("Invalid or incomplete schema, unknown kind: "+e.kind+". Ensure that a full introspection query is used in order to build a client schema.")}}function p(e){return new _typeDefinition.GraphQLScalarType({name:e.name,description:e.description,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function s(e){return new _typeDefinition.GraphQLObjectType({name:e.name,description:e.description,interfaces:e.interfaces.map(o),fields:function(){return d(e)}})}function c(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return d(e)},resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function l(e){return new _typeDefinition.GraphQLUnionType({name:e.name,description:e.description,types:e.possibleTypes.map(a),resolveType:function(){throw new Error("Client Schema cannot be used for execution.")}})}function f(e){return new _typeDefinition.GraphQLEnumType({name:e.name,description:e.description,values:(0,_jsutilsKeyValMap2.default)(e.enumValues,function(e){return e.name},function(e){return{description:e.description,deprecationReason:e.deprecationReason}})})}function y(e){return new _typeDefinition.GraphQLInputObjectType({name:e.name,description:e.description,fields:function(){return _(e.inputFields)}})}function d(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name},function(e){return{description:e.description,deprecationReason:e.deprecationReason,type:i(e.type),args:_(e.args),resolve:function(){throw new Error("Client Schema cannot be used for execution.")}}})}function _(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name},m)}function m(e){var n=r(e.type),t=e.defaultValue?(0,_valueFromAST.valueFromAST)((0,_languageParser.parseValue)(e.defaultValue),n):null;return{name:e.name,description:e.description,type:n,defaultValue:t}}function h(e){return new _typeDirectives.GraphQLDirective({name:e.name,description:e.description,args:e.args.map(m),onOperation:e.onOperation,onFragment:e.onFragment,onField:e.onField})}var v=e.__schema,T=(0,_jsutilsKeyMap2.default)(v.types,function(e){return e.name}),I={String:_typeScalars.GraphQLString,Int:_typeScalars.GraphQLInt,Float:_typeScalars.GraphQLFloat,Boolean:_typeScalars.GraphQLBoolean,ID:_typeScalars.GraphQLID};v.types.forEach(function(e){return t(e.name)});var w=a(v.queryType),j=v.mutationType?a(v.mutationType):null,D=v.subscriptionType?a(v.subscriptionType):null,L=v.directives?v.directives.map(h):[];return new _typeSchema.GraphQLSchema({query:w,mutation:j,subscription:D,directives:L})}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildClientSchema=buildClientSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_languageParser=require("../language/parser"),_typeSchema=require("../type/schema"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars"),_typeDirectives=require("../type/directives"),_typeIntrospection=require("../type/introspection")},{"../jsutils/invariant":154,"../jsutils/keyMap":156,"../jsutils/keyValMap":157,"../language/parser":162,"../type/definition":166,"../type/directives":167,"../type/introspection":169,"../type/scalars":170,"../type/schema":171,"./valueFromAST":186,"babel-runtime/helpers/interop-require-default":35}],176:[function(require,module,exports){"use strict";function concatAST(e){for(var t=[],n=0;n<e.length;n++)for(var o=e[n].definitions,r=0;r<o.length;r++)t.push(o[r]);return{kind:"Document",definitions:t}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatAST=concatAST},{}],177:[function(require,module,exports){"use strict";function extendSchema(e,n){function r(e){var n=i(e.name);return(0,_jsutilsInvariant2.default)(n,"Invalid schema"),n}function t(e){var n=i(e.name.value);if(!n)throw new _errorGraphQLError.GraphQLError('Unknown type: "'+e.name.value+'". Ensure that this type exists either in the original schema, or is added in a type definition.',[e]);return n}function i(n){var r=O[n];if(r)return r;var t=e.getType(n);if(t){var i=a(t);return O[n]=i,i}var u=L[n];if(u){var i=f(u);return O[n]=i,i}}function a(e){return e instanceof _typeDefinition.GraphQLObjectType?u(e):e instanceof _typeDefinition.GraphQLInterfaceType?o(e):e instanceof _typeDefinition.GraphQLUnionType?s(e):e}function u(e){return new _typeDefinition.GraphQLObjectType({name:e.name,description:e.description,interfaces:function(){return p(e)},fields:function(){return c(e)}})}function o(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name,description:e.description,fields:function(){return c(e)},resolveType:throwClientSchemaExecutionError})}function s(e){return new _typeDefinition.GraphQLUnionType({name:e.name,description:e.description,types:e.getPossibleTypes().map(r),resolveType:throwClientSchemaExecutionError
})}function p(e){var n=e.getInterfaces().map(r),i=N[e.name];return i&&i.forEach(function(r){r.definition.interfaces.forEach(function(r){var i=r.name.value;if(n.some(function(e){return e.name===i}))throw new _errorGraphQLError.GraphQLError("'Type \""+e.name+'" already implements "'+i+'". It cannot also be implemented in this type extension.',[r]);n.push(t(r))})}),n}function c(e){var n={},r=e.getFields();_Object$keys(r).forEach(function(e){var t=r[e];n[e]={description:t.description,deprecationReason:t.deprecationReason,type:l(t.type),args:(0,_jsutilsKeyMap2.default)(t.args,function(e){return e.name}),resolve:throwClientSchemaExecutionError}});var t=N[e.name];return t&&t.forEach(function(t){t.definition.fields.forEach(function(t){var i=t.name.value;if(r[i])throw new _errorGraphQLError.GraphQLError('Field "'+e.name+"."+i+'" already exists in the schema. It cannot also be defined in this type extension.',[t]);n[i]={type:g(t.type),args:v(t.arguments),resolve:throwClientSchemaExecutionError}})}),n}function l(e){return e instanceof _typeDefinition.GraphQLList?new _typeDefinition.GraphQLList(l(e.ofType)):e instanceof _typeDefinition.GraphQLNonNull?new _typeDefinition.GraphQLNonNull(l(e.ofType)):r(e)}function f(e){switch(e.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:return _(e);case _languageKinds.INTERFACE_TYPE_DEFINITION:return y(e);case _languageKinds.UNION_TYPE_DEFINITION:return h(e);case _languageKinds.SCALAR_TYPE_DEFINITION:return d(e);case _languageKinds.ENUM_TYPE_DEFINITION:return E(e);case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:return m(e)}}function _(e){return new _typeDefinition.GraphQLObjectType({name:e.name.value,interfaces:function(){return T(e)},fields:function(){return I(e)}})}function y(e){return new _typeDefinition.GraphQLInterfaceType({name:e.name.value,fields:function(){return I(e)},resolveType:throwClientSchemaExecutionError})}function h(e){return new _typeDefinition.GraphQLUnionType({name:e.name.value,types:e.types.map(t),resolveType:throwClientSchemaExecutionError})}function d(e){return new _typeDefinition.GraphQLScalarType({name:e.name.value,serialize:function(){return null},parseValue:function(){return!1},parseLiteral:function(){return!1}})}function E(e){return new _typeDefinition.GraphQLEnumType({name:e.name.value,values:(0,_jsutilsKeyValMap2.default)(e.values,function(e){return e.name.value},function(){return{}})})}function m(e){return new _typeDefinition.GraphQLInputObjectType({name:e.name.value,fields:function(){return v(e.fields)}})}function T(e){return e.interfaces.map(t)}function I(e){return(0,_jsutilsKeyValMap2.default)(e.fields,function(e){return e.name.value},function(e){return{type:g(e.type),args:v(e.arguments),resolve:throwClientSchemaExecutionError}})}function v(e){return(0,_jsutilsKeyValMap2.default)(e,function(e){return e.name.value},function(e){var n=g(e.type);return{type:n,defaultValue:(0,_valueFromAST.valueFromAST)(e.defaultValue,n)}})}function g(e){return e.kind===_languageKinds.LIST_TYPE?new _typeDefinition.GraphQLList(g(e.type)):e.kind===_languageKinds.NON_NULL_TYPE?new _typeDefinition.GraphQLNonNull(g(e.type)):t(e)}(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Must provide valid GraphQLSchema"),(0,_jsutilsInvariant2.default)(n&&n.kind===_languageKinds.DOCUMENT,"Must provide valid Document AST");for(var L={},N={},D=0;D<n.definitions.length;D++){var Q=n.definitions[D];switch(Q.kind){case _languageKinds.OBJECT_TYPE_DEFINITION:case _languageKinds.INTERFACE_TYPE_DEFINITION:case _languageKinds.ENUM_TYPE_DEFINITION:case _languageKinds.UNION_TYPE_DEFINITION:case _languageKinds.SCALAR_TYPE_DEFINITION:case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:var G=Q.name.value;if(e.getType(G))throw new _errorGraphQLError.GraphQLError('Type "'+G+'" already exists in the schema. It cannot also be defined in this type definition.',[Q]);L[G]=Q;break;case _languageKinds.TYPE_EXTENSION_DEFINITION:var w=Q.definition.name.value,S=e.getType(w);if(!S)throw new _errorGraphQLError.GraphQLError('Cannot extend type "'+w+'" because it does not exist in the existing schema.',[Q.definition]);if(!(S instanceof _typeDefinition.GraphQLObjectType))throw new _errorGraphQLError.GraphQLError('Cannot extend non-object type "'+w+'".',[Q.definition]);var j=N[w];j?j.push(Q):j=[Q],N[w]=j}}if(0===_Object$keys(N).length&&0===_Object$keys(L).length)return e;var O={String:_typeScalars.GraphQLString,Int:_typeScalars.GraphQLInt,Float:_typeScalars.GraphQLFloat,Boolean:_typeScalars.GraphQLBoolean,ID:_typeScalars.GraphQLID},b=r(e.getQueryType()),K=e.getMutationType(),x=K?r(K):null,F=e.getSubscriptionType(),C=F?r(F):null;return _Object$keys(e.getTypeMap()).forEach(function(n){return r(e.getType(n))}),_Object$keys(L).forEach(function(e){return t(L[e])}),new _typeSchema.GraphQLSchema({query:b,mutation:x,subscription:C,directives:e.getDirectives()})}function throwClientSchemaExecutionError(){throw new Error("Client Schema cannot be used for execution.")}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendSchema=extendSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsKeyValMap=require("../jsutils/keyValMap"),_jsutilsKeyValMap2=_interopRequireDefault(_jsutilsKeyValMap),_valueFromAST=require("./valueFromAST"),_errorGraphQLError=require("../error/GraphQLError"),_typeSchema=require("../type/schema"),_typeDefinition=require("../type/definition"),_typeScalars=require("../type/scalars"),_languageKinds=require("../language/kinds")},{"../error/GraphQLError":143,"../jsutils/invariant":154,"../jsutils/keyMap":156,"../jsutils/keyValMap":157,"../language/kinds":159,"../type/definition":166,"../type/scalars":170,"../type/schema":171,"./valueFromAST":186,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],178:[function(require,module,exports){"use strict";function getOperationAST(e,n){for(var i=null,r=0;r<e.definitions.length;r++){var t=e.definitions[r];if(t.kind===_languageKinds.OPERATION_DEFINITION)if(n){if(t.name&&t.name.value===n)return t}else{if(i)return null;i=t}}return i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOperationAST=getOperationAST;var _languageKinds=require("../language/kinds")},{"../language/kinds":159}],179:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _introspectionQuery=require("./introspectionQuery");Object.defineProperty(exports,"introspectionQuery",{enumerable:!0,get:function(){return _introspectionQuery.introspectionQuery}});var _getOperationAST=require("./getOperationAST");Object.defineProperty(exports,"getOperationAST",{enumerable:!0,get:function(){return _getOperationAST.getOperationAST}});var _buildClientSchema=require("./buildClientSchema");Object.defineProperty(exports,"buildClientSchema",{enumerable:!0,get:function(){return _buildClientSchema.buildClientSchema}});var _buildASTSchema=require("./buildASTSchema");Object.defineProperty(exports,"buildASTSchema",{enumerable:!0,get:function(){return _buildASTSchema.buildASTSchema}});var _extendSchema=require("./extendSchema");Object.defineProperty(exports,"extendSchema",{enumerable:!0,get:function(){return _extendSchema.extendSchema}});var _schemaPrinter=require("./schemaPrinter");Object.defineProperty(exports,"printSchema",{enumerable:!0,get:function(){return _schemaPrinter.printSchema}}),Object.defineProperty(exports,"printIntrospectionSchema",{enumerable:!0,get:function(){return _schemaPrinter.printIntrospectionSchema}});var _typeFromAST=require("./typeFromAST");Object.defineProperty(exports,"typeFromAST",{enumerable:!0,get:function(){return _typeFromAST.typeFromAST}});var _valueFromAST=require("./valueFromAST");Object.defineProperty(exports,"valueFromAST",{enumerable:!0,get:function(){return _valueFromAST.valueFromAST}});var _astFromValue=require("./astFromValue");Object.defineProperty(exports,"astFromValue",{enumerable:!0,get:function(){return _astFromValue.astFromValue}});var _TypeInfo=require("./TypeInfo");Object.defineProperty(exports,"TypeInfo",{enumerable:!0,get:function(){return _TypeInfo.TypeInfo}});var _isValidJSValue=require("./isValidJSValue");Object.defineProperty(exports,"isValidJSValue",{enumerable:!0,get:function(){return _isValidJSValue.isValidJSValue}});var _isValidLiteralValue=require("./isValidLiteralValue");Object.defineProperty(exports,"isValidLiteralValue",{enumerable:!0,get:function(){return _isValidLiteralValue.isValidLiteralValue}});var _concatAST=require("./concatAST");Object.defineProperty(exports,"concatAST",{enumerable:!0,get:function(){return _concatAST.concatAST}});var _typeComparators=require("./typeComparators");Object.defineProperty(exports,"isEqualType",{enumerable:!0,get:function(){return _typeComparators.isEqualType}}),Object.defineProperty(exports,"isTypeSubTypeOf",{enumerable:!0,get:function(){return _typeComparators.isTypeSubTypeOf}}),Object.defineProperty(exports,"doTypesOverlap",{enumerable:!0,get:function(){return _typeComparators.doTypesOverlap}})},{"./TypeInfo":172,"./astFromValue":173,"./buildASTSchema":174,"./buildClientSchema":175,"./concatAST":176,"./extendSchema":177,"./getOperationAST":178,"./introspectionQuery":180,"./isValidJSValue":181,"./isValidLiteralValue":182,"./schemaPrinter":183,"./typeComparators":184,"./typeFromAST":185,"./valueFromAST":186}],180:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var introspectionQuery="\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n args {\n ...InputValue\n }\n onOperation\n onFragment\n onField\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n";exports.introspectionQuery=introspectionQuery},{}],181:[function(require,module,exports){"use strict";function isValidJSValue(e,t){for(var r=!0;r;){var i=e,n=t;if(a=u=l=s=o=f=v=_=j=m=void 0,r=!1,!(n instanceof _typeDefinition.GraphQLNonNull)){if((0,_jsutilsIsNullish2.default)(i))return[];if(n instanceof _typeDefinition.GraphQLList){var a=function(){var e=n.ofType;return Array.isArray(i)?{v:i.reduce(function(t,r,i){var n=isValidJSValue(r,e);return t.concat(n.map(function(e){return"In element #"+i+": "+e}))},[])}:{v:isValidJSValue(i,e)}}();if("object"==typeof a)return a.v}if(n instanceof _typeDefinition.GraphQLInputObjectType){if("object"!=typeof i||null===i)return['Expected "'+n.name+'", found not an object.'];var u=n.getFields(),l=[],s=!0,o=!1,f=void 0;try{for(var p,y=_getIterator(_Object$keys(i));!(s=(p=y.next()).done);s=!0){var c=p.value;u[c]||l.push('In field "'+c+'": Unknown field.')}}catch(d){o=!0,f=d}finally{try{!s&&y.return&&y.return()}finally{if(o)throw f}}var v=!0,_=!1,j=void 0;try{for(var b,h=function(){var e=b.value,t=isValidJSValue(i[e],u[e].type);l.push.apply(l,_toConsumableArray(t.map(function(t){return'In field "'+e+'": '+t})))},I=_getIterator(_Object$keys(u));!(v=(b=I.next()).done);v=!0)h()}catch(d){_=!0,j=d}finally{try{!v&&I.return&&I.return()}finally{if(_)throw j}}return l}(0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLScalarType||n instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var m=n.parseValue(i);return(0,_jsutilsIsNullish2.default)(m)?['Expected type "'+n.name+'", found '+JSON.stringify(i)+"."]:[]}if((0,_jsutilsIsNullish2.default)(i))return n.ofType.name?['Expected "'+n.ofType.name+'!", found null.']:["Expected non-null value, found null."];e=i,t=n.ofType,r=!0}}var _toConsumableArray=require("babel-runtime/helpers/to-consumable-array").default,_getIterator=require("babel-runtime/core-js/get-iterator").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidJSValue=isValidJSValue;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../type/definition":166,"babel-runtime/core-js/get-iterator":19,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/to-consumable-array":38}],182:[function(require,module,exports){"use strict";function isValidLiteralValue(e,t){for(var i=!0;i;){var r=e,n=t;if(a=u=l=s=o=f=p=v=j=g=b=q=void 0,i=!1,!(r instanceof _typeDefinition.GraphQLNonNull)){if(!n)return[];if(n.kind===_languageKinds.VARIABLE)return[];if(r instanceof _typeDefinition.GraphQLList){var a=function(){var e=r.ofType;return n.kind===_languageKinds.LIST?{v:n.values.reduce(function(t,i,r){var n=isValidLiteralValue(e,i);return t.concat(n.map(function(e){return"In element #"+r+": "+e}))},[])}:{v:isValidLiteralValue(e,n)}}();if("object"==typeof a)return a.v}if(r instanceof _typeDefinition.GraphQLInputObjectType){if(n.kind!==_languageKinds.OBJECT)return['Expected "'+r.name+'", found not an object.'];var u=r.getFields(),l=[],s=n.fields,o=!0,f=!1,p=void 0;try{for(var d,y=_getIterator(s);!(o=(d=y.next()).done);o=!0){var _=d.value;u[_.name.value]||l.push('In field "'+_.name.value+'": Unknown field.')}}catch(c){f=!0,p=c}finally{try{!o&&y.return&&y.return()}finally{if(f)throw p}}var v=(0,_jsutilsKeyMap2.default)(s,function(e){return e.name.value}),j=!0,g=!1,b=void 0;try{for(var h,m=function(){var e=h.value,t=isValidLiteralValue(u[e].type,v[e]&&v[e].value);l.push.apply(l,_toConsumableArray(t.map(function(t){return'In field "'+e+'": '+t})))},I=_getIterator(_Object$keys(u));!(j=(h=I.next()).done);j=!0)m()}catch(c){g=!0,b=c}finally{try{!j&&I.return&&I.return()}finally{if(g)throw b}}return l}(0,_jsutilsInvariant2.default)(r instanceof _typeDefinition.GraphQLScalarType||r instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var q=r.parseLiteral(n);return(0,_jsutilsIsNullish2.default)(q)?['Expected type "'+r.name+'", found '+(0,_languagePrinter.print)(n)+"."]:[]}if(!n)return r.ofType.name?['Expected "'+r.ofType.name+'!", found null.']:["Expected non-null value, found null."];e=r.ofType,t=n,i=!0}}var _toConsumableArray=require("babel-runtime/helpers/to-consumable-array").default,_getIterator=require("babel-runtime/core-js/get-iterator").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidLiteralValue=isValidLiteralValue;var _languagePrinter=require("../language/printer"),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition"),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish)},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../jsutils/keyMap":156,"../language/kinds":159,"../language/printer":163,"../type/definition":166,"babel-runtime/core-js/get-iterator":19,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/to-consumable-array":38}],183:[function(require,module,exports){"use strict";function printSchema(n){return printFilteredSchema(n,isDefinedType)}function printIntrospectionSchema(n){return printFilteredSchema(n,isIntrospectionType)}function isDefinedType(n){return!isIntrospectionType(n)&&!isBuiltInScalar(n)}function isIntrospectionType(n){return 0===n.indexOf("__")}function isBuiltInScalar(n){return"String"===n||"Boolean"===n||"Int"===n||"Float"===n||"ID"===n}function printFilteredSchema(n,e){var t=n.getTypeMap(),i=_Object$keys(t).filter(e).sort(function(n,e){return n.localeCompare(e)}).map(function(n){return t[n]});return i.map(printType).join("\n\n")+"\n"}function printType(n){return n instanceof _typeDefinition.GraphQLScalarType?printScalar(n):n instanceof _typeDefinition.GraphQLObjectType?printObject(n):n instanceof _typeDefinition.GraphQLInterfaceType?printInterface(n):n instanceof _typeDefinition.GraphQLUnionType?printUnion(n):n instanceof _typeDefinition.GraphQLEnumType?printEnum(n):((0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLInputObjectType),printInputObject(n))}function printScalar(n){return"scalar "+n.name}function printObject(n){var e=n.getInterfaces(),t=e.length?" implements "+e.map(function(n){return n.name}).join(", "):"";return"type "+n.name+t+" {\n"+printFields(n)+"\n}"}function printInterface(n){return"interface "+n.name+" {\n"+printFields(n)+"\n}"}function printUnion(n){return"union "+n.name+" = "+n.getPossibleTypes().join(" | ")}function printEnum(n){var e=n.getValues();return"enum "+n.name+" {\n"+e.map(function(n){return" "+n.name}).join("\n")+"\n}"}function printInputObject(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return"input "+n.name+" {\n"+t.map(function(n){return" "+printInputValue(n)}).join("\n")+"\n}"}function printFields(n){var e=n.getFields(),t=_Object$keys(e).map(function(n){return e[n]});return t.map(function(n){return" "+n.name+printArgs(n)+": "+n.type}).join("\n")}function printArgs(n){return 0===n.args.length?"":"("+n.args.map(printInputValue).join(", ")+")"}function printInputValue(n){var e=n.name+": "+n.type;return(0,_jsutilsIsNullish2.default)(n.defaultValue)||(e+=" = "+(0,_languagePrinter.print)((0,_utilitiesAstFromValue.astFromValue)(n.defaultValue,n.type))),e}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.printSchema=printSchema,exports.printIntrospectionSchema=printIntrospectionSchema;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_utilitiesAstFromValue=require("../utilities/astFromValue"),_languagePrinter=require("../language/printer"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../language/printer":163,"../type/definition":166,"../utilities/astFromValue":173,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35}],184:[function(require,module,exports){"use strict";function isEqualType(e,i){for(var n=!0;n;){var t=e,p=i;if(n=!1,t===p)return!0;if(t instanceof _typeDefinition.GraphQLNonNull&&p instanceof _typeDefinition.GraphQLNonNull)e=t.ofType,i=p.ofType,n=!0;else{if(!(t instanceof _typeDefinition.GraphQLList&&p instanceof _typeDefinition.GraphQLList))return!1;e=t.ofType,i=p.ofType,n=!0}}}function isTypeSubTypeOf(e,i){var n=!0;e:for(;n;){var t=e,p=i;if(n=!1,t===p)return!0;if(p instanceof _typeDefinition.GraphQLNonNull){if(t instanceof _typeDefinition.GraphQLNonNull){e=t.ofType,i=p.ofType,n=!0;continue e}return!1}if(!(t instanceof _typeDefinition.GraphQLNonNull)){if(p instanceof _typeDefinition.GraphQLList){if(t instanceof _typeDefinition.GraphQLList){e=t.ofType,i=p.ofType,n=!0;continue e}return!1}return t instanceof _typeDefinition.GraphQLList?!1:!!((0,_typeDefinition.isAbstractType)(p)&&t instanceof _typeDefinition.GraphQLObjectType&&p.isPossibleType(t))}e=t.ofType,i=p,n=!0}}function doTypesOverlap(e,i){var n=i;return e===n?!0:e instanceof _typeDefinition.GraphQLInterfaceType||e instanceof _typeDefinition.GraphQLUnionType?n instanceof _typeDefinition.GraphQLInterfaceType||n instanceof _typeDefinition.GraphQLUnionType?e.getPossibleTypes().some(function(e){return n.isPossibleType(e)}):e.isPossibleType(n):n instanceof _typeDefinition.GraphQLInterfaceType||n instanceof _typeDefinition.GraphQLUnionType?n.isPossibleType(e):!1}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEqualType=isEqualType,exports.isTypeSubTypeOf=isTypeSubTypeOf,exports.doTypesOverlap=doTypesOverlap;var _typeDefinition=require("../type/definition")},{"../type/definition":166}],185:[function(require,module,exports){"use strict";function typeFromAST(e,i){var t=void 0;return i.kind===_languageKinds.LIST_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLList(t)):i.kind===_languageKinds.NON_NULL_TYPE?(t=typeFromAST(e,i.type),t&&new _typeDefinition.GraphQLNonNull(t)):((0,_jsutilsInvariant2.default)(i.kind===_languageKinds.NAMED_TYPE,"Must be a named type."),e.getType(i.name.value))}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeFromAST=typeFromAST;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../language/kinds"),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":154,"../language/kinds":159,"../type/definition":166,"babel-runtime/helpers/interop-require-default":35}],186:[function(require,module,exports){"use strict";function valueFromAST(e,i,t){for(var r=!0;r;){var u=e,n=i,a=t;if(l=s=f=o=void 0,r=!1,n instanceof _typeDefinition.GraphQLNonNull)e=u,i=n.ofType,t=a,r=!0;else{if(!u)return null;if(u.kind===Kind.VARIABLE){var l=u.name.value;return a&&a.hasOwnProperty(l)?a[l]:null}if(n instanceof _typeDefinition.GraphQLList){var s=function(){var e=n.ofType;return u.kind===Kind.LIST?{v:u.values.map(function(i){return valueFromAST(i,e,a)})}:{v:[valueFromAST(u,e,a)]}}();if("object"==typeof s)return s.v}if(n instanceof _typeDefinition.GraphQLInputObjectType){var f=function(){var e=n.getFields();if(u.kind!==Kind.OBJECT)return{v:null};var i=(0,_jsutilsKeyMap2.default)(u.fields,function(e){return e.name.value});return{v:_Object$keys(e).reduce(function(t,r){var u=e[r],n=i[r],l=valueFromAST(n&&n.value,u.type,a);return(0,_jsutilsIsNullish2.default)(l)&&(l=u.defaultValue),(0,_jsutilsIsNullish2.default)(l)||(t[r]=l),t},{})}}();if("object"==typeof f)return f.v}(0,_jsutilsInvariant2.default)(n instanceof _typeDefinition.GraphQLScalarType||n instanceof _typeDefinition.GraphQLEnumType,"Must be input type");var o=n.parseLiteral(u);if(!(0,_jsutilsIsNullish2.default)(o))return o}}}var _Object$keys=require("babel-runtime/core-js/object/keys").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.valueFromAST=valueFromAST;var _jsutilsKeyMap=require("../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_jsutilsIsNullish=require("../jsutils/isNullish"),_jsutilsIsNullish2=_interopRequireDefault(_jsutilsIsNullish),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeDefinition=require("../type/definition")},{"../jsutils/invariant":154,"../jsutils/isNullish":155,"../jsutils/keyMap":156,"../language/kinds":159,"../type/definition":166,"babel-runtime/core-js/object/keys":26,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/interop-require-wildcard":36}],187:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _validate=require("./validate");Object.defineProperty(exports,"validate",{enumerable:!0,get:function(){return _validate.validate}});var _specifiedRules=require("./specifiedRules");Object.defineProperty(exports,"specifiedRules",{enumerable:!0,get:function(){return _specifiedRules.specifiedRules}})},{"./specifiedRules":212,"./validate":213}],188:[function(require,module,exports){"use strict";function badValueMessage(e,r,a,t){var u=t?"\n"+t.join("\n"):"";return'Argument "'+e+'" has invalid value '+a+"."+u}function ArgumentsOfCorrectType(e){return{Argument:function(r){var a=e.getArgument();if(a){var t=(0,_utilitiesIsValidLiteralValue.isValidLiteralValue)(a.type,r.value);t&&t.length>0&&e.reportError(new _error.GraphQLError(badValueMessage(r.name.value,a.type,(0,_languagePrinter.print)(r.value),t),[r.value]))}return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.badValueMessage=badValueMessage,exports.ArgumentsOfCorrectType=ArgumentsOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":145,"../../language/printer":163,"../../utilities/isValidLiteralValue":182}],189:[function(require,module,exports){"use strict";function defaultForNonNullArgMessage(e,r,a){return'Variable "$'+e+'" of type "'+r+'" is required and will not '+('use the default value. Perhaps you meant to use type "'+a+'".')}function badValueForDefaultArgMessage(e,r,a,t){var l=t?"\n"+t.join("\n"):"";return'Variable "$'+e+" has invalid default value "+a+"."+l}function DefaultValuesOfCorrectType(e){return{VariableDefinition:function(r){var a=r.variable.name.value,t=r.defaultValue,l=e.getInputType();if(l instanceof _typeDefinition.GraphQLNonNull&&t&&e.reportError(new _error.GraphQLError(defaultForNonNullArgMessage(a,l,l.ofType),[t])),l&&t){var u=(0,_utilitiesIsValidLiteralValue.isValidLiteralValue)(l,t);u&&u.length>0&&e.reportError(new _error.GraphQLError(badValueForDefaultArgMessage(a,l,(0,_languagePrinter.print)(t),u),[t]))}return!1},SelectionSet:function(){return!1},FragmentDefinition:function(){return!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultForNonNullArgMessage=defaultForNonNullArgMessage,exports.badValueForDefaultArgMessage=badValueForDefaultArgMessage,exports.DefaultValuesOfCorrectType=DefaultValuesOfCorrectType;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesIsValidLiteralValue=require("../../utilities/isValidLiteralValue")},{"../../error":145,"../../language/printer":163,"../../type/definition":166,"../../utilities/isValidLiteralValue":182}],190:[function(require,module,exports){"use strict";function undefinedFieldMessage(e,n,t){var r='Cannot query field "'+e+'" on type "'+n+'".',i=5;if(0!==t.length){var o=t.slice(0,i).map(function(e){return'"'+e+'"'}).join(", ");t.length>i&&(o+=", and "+(t.length-i)+" other types"),r+=" However, this field exists on "+o+".",r+=" Perhaps you meant to use an inline fragment?"}return r}function FieldsOnCorrectType(e){return{Field:function(n){var t=e.getParentType();if(t){var r=e.getFieldDef();if(!r){var i=[];(0,_typeDefinition.isAbstractType)(t)&&(i=getSiblingInterfacesIncludingField(t,n.name.value),i=i.concat(getImplementationsIncludingField(t,n.name.value))),e.reportError(new _error.GraphQLError(undefinedFieldMessage(n.name.value,t.name,i),[n]))}}}}}function getImplementationsIncludingField(e,n){return e.getPossibleTypes().filter(function(e){return void 0!==e.getFields()[n]}).map(function(e){return e.name}).sort()}function getSiblingInterfacesIncludingField(e,n){var t=e.getPossibleTypes().filter(function(e){return e instanceof _typeDefinition.GraphQLObjectType}),r=t.reduce(function(e,t){return t.getInterfaces().forEach(function(t){void 0!==t.getFields()[n]&&(void 0===e[t.name]&&(e[t.name]=0),e[t.name]+=1)}),e},{});return _Object$keys(r).sort(function(e,n){return r[n]-r[e]})}var _Object$keys=require("babel-runtime/core-js/object/keys").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedFieldMessage=undefinedFieldMessage,exports.FieldsOnCorrectType=FieldsOnCorrectType;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../type/definition":166,"babel-runtime/core-js/object/keys":26}],191:[function(require,module,exports){"use strict";function inlineFragmentOnNonCompositeErrorMessage(e){return'Fragment cannot condition on non composite type "'+e+'".'}function fragmentOnNonCompositeErrorMessage(e,n){return'Fragment "'+e+'" cannot condition on non composite '+('type "'+n+'".')}function FragmentsOnCompositeTypes(e){return{InlineFragment:function(n){var r=e.getType();n.typeCondition&&r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))},FragmentDefinition:function(n){var r=e.getType();r&&!(0,_typeDefinition.isCompositeType)(r)&&e.reportError(new _error.GraphQLError(fragmentOnNonCompositeErrorMessage(n.name.value,(0,_languagePrinter.print)(n.typeCondition)),[n.typeCondition]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inlineFragmentOnNonCompositeErrorMessage=inlineFragmentOnNonCompositeErrorMessage,exports.fragmentOnNonCompositeErrorMessage=fragmentOnNonCompositeErrorMessage,exports.FragmentsOnCompositeTypes=FragmentsOnCompositeTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../language/printer":163,"../../type/definition":166}],192:[function(require,module,exports){"use strict";function unknownArgMessage(e,n,r){return'Unknown argument "'+e+'" on field "'+n+'" of '+('type "'+r+'".')}function unknownDirectiveArgMessage(e,n){return'Unknown argument "'+e+'" on directive "@'+n+'".'}function KnownArgumentNames(e){return{Argument:function(n,r,i,t,a){var u=a[a.length-1];if(u.kind===_languageKinds.FIELD){var s=e.getFieldDef();if(s){var o=(0,_jsutilsFind2.default)(s.args,function(e){return e.name===n.name.value});if(!o){var g=e.getParentType();(0,_jsutilsInvariant2.default)(g),e.reportError(new _error.GraphQLError(unknownArgMessage(n.name.value,s.name,g.name),[n]))}}}else if(u.kind===_languageKinds.DIRECTIVE){var l=e.getDirective();if(l){var f=(0,_jsutilsFind2.default)(l.args,function(e){return e.name===n.name.value});f||e.reportError(new _error.GraphQLError(unknownDirectiveArgMessage(n.name.value,l.name),[n]))}}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownArgMessage=unknownArgMessage,exports.unknownDirectiveArgMessage=unknownDirectiveArgMessage,exports.KnownArgumentNames=KnownArgumentNames;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_jsutilsInvariant=require("../../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageKinds=require("../../language/kinds");
},{"../../error":145,"../../jsutils/find":153,"../../jsutils/invariant":154,"../../language/kinds":159,"babel-runtime/helpers/interop-require-default":35}],193:[function(require,module,exports){"use strict";function unknownDirectiveMessage(e){return'Unknown directive "'+e+'".'}function misplacedDirectiveMessage(e,r){return'Directive "'+e+'" may not be used on "'+r+'".'}function KnownDirectives(e){return{Directive:function(r,i,n,a,s){var t=(0,_jsutilsFind2.default)(e.getSchema().getDirectives(),function(e){return e.name===r.name.value});if(!t)return void e.reportError(new _error.GraphQLError(unknownDirectiveMessage(r.name.value),[r]));var o=s[s.length-1];switch(o.kind){case _languageKinds.OPERATION_DEFINITION:t.onOperation||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"operation"),[r]));break;case _languageKinds.FIELD:t.onField||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"field"),[r]));break;case _languageKinds.FRAGMENT_SPREAD:case _languageKinds.INLINE_FRAGMENT:case _languageKinds.FRAGMENT_DEFINITION:t.onFragment||e.reportError(new _error.GraphQLError(misplacedDirectiveMessage(r.name.value,"fragment"),[r]))}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownDirectiveMessage=unknownDirectiveMessage,exports.misplacedDirectiveMessage=misplacedDirectiveMessage,exports.KnownDirectives=KnownDirectives;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds")},{"../../error":145,"../../jsutils/find":153,"../../language/kinds":159,"babel-runtime/helpers/interop-require-default":35}],194:[function(require,module,exports){"use strict";function unknownFragmentMessage(e){return'Unknown fragment "'+e+'".'}function KnownFragmentNames(e){return{FragmentSpread:function(n){var r=n.name.value,a=e.getFragment(r);a||e.reportError(new _error.GraphQLError(unknownFragmentMessage(r),[n.name]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownFragmentMessage=unknownFragmentMessage,exports.KnownFragmentNames=KnownFragmentNames;var _error=require("../../error")},{"../../error":145}],195:[function(require,module,exports){"use strict";function unknownTypeMessage(e){return'Unknown type "'+e+'".'}function KnownTypeNames(e){return{ObjectTypeDefinition:function(){return!1},InterfaceTypeDefinition:function(){return!1},UnionTypeDefinition:function(){return!1},InputObjectTypeDefinition:function(){return!1},NamedType:function(n){var r=n.name.value,t=e.getSchema().getType(r);t||e.reportError(new _error.GraphQLError(unknownTypeMessage(r),[n]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.unknownTypeMessage=unknownTypeMessage,exports.KnownTypeNames=KnownTypeNames;var _error=require("../../error")},{"../../error":145}],196:[function(require,module,exports){"use strict";function anonOperationNotAloneMessage(){return"This anonymous operation must be the only defined operation."}function LoneAnonymousOperation(n){var e=0;return{Document:function(n){e=n.definitions.filter(function(n){return n.kind===_languageKinds.OPERATION_DEFINITION}).length},OperationDefinition:function(o){!o.name&&e>1&&n.reportError(new _error.GraphQLError(anonOperationNotAloneMessage(),[o]))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.anonOperationNotAloneMessage=anonOperationNotAloneMessage,exports.LoneAnonymousOperation=LoneAnonymousOperation;var _error=require("../../error"),_languageKinds=require("../../language/kinds")},{"../../error":145,"../../language/kinds":159}],197:[function(require,module,exports){"use strict";function cycleErrorMessage(e,r){var t=r.length?" via "+r.join(", "):"";return'Cannot spread fragment "'+e+'" within itself'+t+"."}function NoFragmentCycles(e){function r(o){var c=o.name.value;t[c]=!0;var i=e.getFragmentSpreads(o);if(0!==i.length){a[c]=n.length;for(var l=0;l<i.length;l++){var u=i[l],s=u.name.value,v=a[s];if(void 0===v){if(n.push(u),!t[s]){var g=e.getFragment(s);g&&r(g)}n.pop()}else{var f=n.slice(v);e.reportError(new _error.GraphQLError(cycleErrorMessage(s,f.map(function(e){return e.name.value})),f.concat(u)))}}a[c]=void 0}}var t=_Object$create(null),n=[],a=_Object$create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(e){return t[e.name.value]||r(e),!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.cycleErrorMessage=cycleErrorMessage,exports.NoFragmentCycles=NoFragmentCycles;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],198:[function(require,module,exports){"use strict";function undefinedVarMessage(e,r){return r?'Variable "$'+e+'" is not defined by operation "'+r+'".':'Variable "$'+e+'" is not defined.'}function NoUndefinedVariables(e){var r=_Object$create(null);return{OperationDefinition:{enter:function(){r=_Object$create(null)},leave:function(a){var n=e.getRecursiveVariableUsages(a);n.forEach(function(n){var i=n.node,t=i.name.value;r[t]!==!0&&e.reportError(new _error.GraphQLError(undefinedVarMessage(t,a.name&&a.name.value),[i,a]))})}},VariableDefinition:function(e){r[e.variable.name.value]=!0}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.undefinedVarMessage=undefinedVarMessage,exports.NoUndefinedVariables=NoUndefinedVariables;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],199:[function(require,module,exports){"use strict";function unusedFragMessage(e){return'Fragment "'+e+'" is never used.'}function NoUnusedFragments(e){var r=[],n=[];return{OperationDefinition:function(e){return r.push(e),!1},FragmentDefinition:function(e){return n.push(e),!1},Document:{leave:function(){var t=_Object$create(null);r.forEach(function(r){e.getRecursivelyReferencedFragments(r).forEach(function(e){t[e.name.value]=!0})}),n.forEach(function(r){var n=r.name.value;t[n]!==!0&&e.reportError(new _error.GraphQLError(unusedFragMessage(n),[r]))})}}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedFragMessage=unusedFragMessage,exports.NoUnusedFragments=NoUnusedFragments;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],200:[function(require,module,exports){"use strict";function unusedVariableMessage(e,r){return r?'Variable "$'+e+'" is never used in operation "'+r+'".':'Variable "$'+e+'" is never used.'}function NoUnusedVariables(e){var r=[];return{OperationDefinition:{enter:function(){r=[]},leave:function(a){var n=_Object$create(null),i=e.getRecursiveVariableUsages(a),u=a.name?a.name.value:null;i.forEach(function(e){var r=e.node;n[r.name.value]=!0}),r.forEach(function(r){var a=r.variable.name.value;n[a]!==!0&&e.reportError(new _error.GraphQLError(unusedVariableMessage(a,u),[r]))})}},VariableDefinition:function(e){r.push(e)}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.unusedVariableMessage=unusedVariableMessage,exports.NoUnusedVariables=NoUnusedVariables;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],201:[function(require,module,exports){"use strict";function fieldsConflictMessage(e,r){return'Fields "'+e+'" conflict because '+reasonMessage(r)+"."}function reasonMessage(e){return Array.isArray(e)?e.map(function(e){var r=_slicedToArray(e,2),t=r[0],a=r[1];return'subfields "'+t+'" conflict because '+reasonMessage(a)}).join(" and "):e}function OverlappingFieldsCanBeMerged(e){function r(e){var r=[];return _Object$keys(e).forEach(function(a){var i=e[a];if(i.length>1)for(var n=0;n<i.length;n++)for(var s=n;s<i.length;s++){var l=t(a,i[n],i[s]);l&&r.push(l)}}),r}function t(t,i,n){var s=_slicedToArray(i,3),l=s[0],u=s[1],o=s[2],c=_slicedToArray(n,3),d=c[0],f=c[1],p=c[2];if(u!==f&&!(l!==d&&l instanceof _typeDefinition.GraphQLObjectType&&d instanceof _typeDefinition.GraphQLObjectType||a.has(u,f))){a.add(u,f);var _=u.name.value,g=f.name.value;if(_!==g)return[[t,_+" and "+g+" are different fields"],[u],[f]];var y=o&&o.type,v=p&&p.type;if(y&&v&&!(0,_utilitiesTypeComparators.isEqualType)(y,v))return[[t,"they return differing types "+y+" and "+v],[u],[f]];if(!sameArguments(u.arguments||[],f.arguments||[]))return[[t,"they have differing arguments"],[u],[f]];var m=u.selectionSet,h=f.selectionSet;if(m&&h){var A={},T=collectFieldASTsAndDefs(e,(0,_typeDefinition.getNamedType)(y),m,A);T=collectFieldASTsAndDefs(e,(0,_typeDefinition.getNamedType)(v),h,A,T);var S=r(T);if(S.length>0)return[[t,S.map(function(e){var r=_slicedToArray(e,1),t=r[0];return t})],S.reduce(function(e,r){var t=_slicedToArray(r,2),a=t[1];return e.concat(a)},[u]),S.reduce(function(e,r){var t=_slicedToArray(r,3),a=t[2];return e.concat(a)},[f])]}}}var a=new PairSet;return{SelectionSet:{leave:function(t){var a=collectFieldASTsAndDefs(e,e.getParentType(),t),i=r(a);i.forEach(function(r){var t=_slicedToArray(r,3),a=_slicedToArray(t[0],2),i=a[0],n=a[1],s=t[1],l=t[2];return e.reportError(new _error.GraphQLError(fieldsConflictMessage(i,n),s.concat(l)))})}}}}function sameArguments(e,r){return e.length!==r.length?!1:e.every(function(e){var t=(0,_jsutilsFind2.default)(r,function(r){return r.name.value===e.name.value});return t?sameValue(e.value,t.value):!1})}function sameValue(e,r){return!e&&!r||(0,_languagePrinter.print)(e)===(0,_languagePrinter.print)(r)}function collectFieldASTsAndDefs(e,r,t,a,i){for(var n=a||{},s=i||{},l=0;l<t.selections.length;l++){var u=t.selections[l];switch(u.kind){case _languageKinds.FIELD:var o=u.name.value,c=void 0;(r instanceof _typeDefinition.GraphQLObjectType||r instanceof _typeDefinition.GraphQLInterfaceType)&&(c=r.getFields()[o]);var d=u.alias?u.alias.value:o;s[d]||(s[d]=[]),s[d].push([r,u,c]);break;case _languageKinds.INLINE_FRAGMENT:var f=u.typeCondition,p=f?(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),u.typeCondition):r;s=collectFieldASTsAndDefs(e,p,u.selectionSet,n,s);break;case _languageKinds.FRAGMENT_SPREAD:var _=u.name.value;if(n[_])continue;n[_]=!0;var g=e.getFragment(_);if(!g)continue;var y=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),g.typeCondition);s=collectFieldASTsAndDefs(e,y,g.selectionSet,n,s)}}return s}function _pairSetAdd(e,r,t){var a=e.get(r);a||(a=new _Set,e.set(r,a)),a.add(t)}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_slicedToArray=require("babel-runtime/helpers/sliced-to-array").default,_Object$keys=require("babel-runtime/core-js/object/keys").default,_Map=require("babel-runtime/core-js/map").default,_Set=require("babel-runtime/core-js/set").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.fieldsConflictMessage=fieldsConflictMessage,exports.OverlappingFieldsCanBeMerged=OverlappingFieldsCanBeMerged;var _error=require("../../error"),_jsutilsFind=require("../../jsutils/find"),_jsutilsFind2=_interopRequireDefault(_jsutilsFind),_languageKinds=require("../../language/kinds"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST"),PairSet=function(){function e(){_classCallCheck(this,e),this._data=new _Map}return _createClass(e,[{key:"has",value:function(e,r){var t=this._data.get(e);return t&&t.has(r)}},{key:"add",value:function(e,r){_pairSetAdd(this._data,e,r),_pairSetAdd(this._data,r,e)}}]),e}()},{"../../error":145,"../../jsutils/find":153,"../../language/kinds":159,"../../language/printer":163,"../../type/definition":166,"../../utilities/typeComparators":184,"../../utilities/typeFromAST":185,"babel-runtime/core-js/map":21,"babel-runtime/core-js/object/keys":26,"babel-runtime/core-js/set":29,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/sliced-to-array":37}],202:[function(require,module,exports){"use strict";function typeIncompatibleSpreadMessage(e,r,t){return'Fragment "'+e+'" cannot be spread here as objects of '+('type "'+r+'" can never be of type "'+t+'".')}function typeIncompatibleAnonSpreadMessage(e,r){return"Fragment cannot be spread here as objects of "+('type "'+e+'" can never be of type "'+r+'".')}function PossibleFragmentSpreads(e){return{InlineFragment:function(r){var t=e.getType(),a=e.getParentType();t&&a&&!(0,_utilitiesTypeComparators.doTypesOverlap)(t,a)&&e.reportError(new _error.GraphQLError(typeIncompatibleAnonSpreadMessage(a,t),[r]))},FragmentSpread:function(r){var t=r.name.value,a=getFragmentType(e,t),p=e.getParentType();a&&p&&!(0,_utilitiesTypeComparators.doTypesOverlap)(a,p)&&e.reportError(new _error.GraphQLError(typeIncompatibleSpreadMessage(t,p,a),[r]))}}}function getFragmentType(e,r){var t=e.getFragment(r);return t&&(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),t.typeCondition)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeIncompatibleSpreadMessage=typeIncompatibleSpreadMessage,exports.typeIncompatibleAnonSpreadMessage=typeIncompatibleAnonSpreadMessage,exports.PossibleFragmentSpreads=PossibleFragmentSpreads;var _error=require("../../error"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":145,"../../utilities/typeComparators":184,"../../utilities/typeFromAST":185}],203:[function(require,module,exports){"use strict";function missingFieldArgMessage(e,r,i){return'Field "'+e+'" argument "'+r+'" of type "'+i+'" is required but not provided.'}function missingDirectiveArgMessage(e,r,i){return'Directive "@'+e+'" argument "'+r+'" of type '+('"'+i+'" is required but not provided.')}function ProvidedNonNullArguments(e){return{Field:{leave:function(r){var i=e.getFieldDef();if(!i)return!1;var t=r.arguments||[],n=(0,_jsutilsKeyMap2.default)(t,function(e){return e.name.value});i.args.forEach(function(i){var t=n[i.name];!t&&i.type instanceof _typeDefinition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingFieldArgMessage(r.name.value,i.name,i.type),[r]))})}},Directive:{leave:function(r){var i=e.getDirective();if(!i)return!1;var t=r.arguments||[],n=(0,_jsutilsKeyMap2.default)(t,function(e){return e.name.value});i.args.forEach(function(i){var t=n[i.name];!t&&i.type instanceof _typeDefinition.GraphQLNonNull&&e.reportError(new _error.GraphQLError(missingDirectiveArgMessage(r.name.value,i.name,i.type),[r]))})}}}}var _interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.missingFieldArgMessage=missingFieldArgMessage,exports.missingDirectiveArgMessage=missingDirectiveArgMessage,exports.ProvidedNonNullArguments=ProvidedNonNullArguments;var _error=require("../../error"),_jsutilsKeyMap=require("../../jsutils/keyMap"),_jsutilsKeyMap2=_interopRequireDefault(_jsutilsKeyMap),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../jsutils/keyMap":156,"../../type/definition":166,"babel-runtime/helpers/interop-require-default":35}],204:[function(require,module,exports){"use strict";function noSubselectionAllowedMessage(e,r){return'Field "'+e+'" of type "'+r+'" must not have a sub selection.'}function requiredSubselectionMessage(e,r){return'Field "'+e+'" of type "'+r+'" must have a sub selection.'}function ScalarLeafs(e){return{Field:function(r){var o=e.getType();o&&((0,_typeDefinition.isLeafType)(o)?r.selectionSet&&e.reportError(new _error.GraphQLError(noSubselectionAllowedMessage(r.name.value,o),[r.selectionSet])):r.selectionSet||e.reportError(new _error.GraphQLError(requiredSubselectionMessage(r.name.value,o),[r])))}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noSubselectionAllowedMessage=noSubselectionAllowedMessage,exports.requiredSubselectionMessage=requiredSubselectionMessage,exports.ScalarLeafs=ScalarLeafs;var _error=require("../../error"),_typeDefinition=require("../../type/definition")},{"../../error":145,"../../type/definition":166}],205:[function(require,module,exports){"use strict";function duplicateArgMessage(e){return'There can be only one argument named "'+e+'".'}function UniqueArgumentNames(e){var r=_Object$create(null);return{Field:function(){r=_Object$create(null)},Directive:function(){r=_Object$create(null)},Argument:function(t){var n=t.name.value;return r[n]?e.reportError(new _error.GraphQLError(duplicateArgMessage(n),[r[n],t.name])):r[n]=t.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateArgMessage=duplicateArgMessage,exports.UniqueArgumentNames=UniqueArgumentNames;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],206:[function(require,module,exports){"use strict";function duplicateFragmentNameMessage(e){return'There can only be one fragment named "'+e+'".'}function UniqueFragmentNames(e){var r=_Object$create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(a){var n=a.name.value;return r[n]?e.reportError(new _error.GraphQLError(duplicateFragmentNameMessage(n),[r[n],a.name])):r[n]=a.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateFragmentNameMessage=duplicateFragmentNameMessage,exports.UniqueFragmentNames=UniqueFragmentNames;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],207:[function(require,module,exports){"use strict";function duplicateInputFieldMessage(e){return'There can be only one input field named "'+e+'".'}function UniqueInputFieldNames(e){var r=[],t=_Object$create(null);return{ObjectValue:{enter:function(){r.push(t),t=_Object$create(null)},leave:function(){t=r.pop()}},ObjectField:function(r){var n=r.name.value;return t[n]?e.reportError(new _error.GraphQLError(duplicateInputFieldMessage(n),[t[n],r.name])):t[n]=r.name,!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateInputFieldMessage=duplicateInputFieldMessage,exports.UniqueInputFieldNames=UniqueInputFieldNames;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],208:[function(require,module,exports){"use strict";function duplicateOperationNameMessage(e){return'There can only be one operation named "'+e+'".'}function UniqueOperationNames(e){var r=_Object$create(null);return{OperationDefinition:function(a){var t=a.name;return t&&(r[t.value]?e.reportError(new _error.GraphQLError(duplicateOperationNameMessage(t.value),[r[t.value],t])):r[t.value]=t),!1},FragmentDefinition:function(){return!1}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateOperationNameMessage=duplicateOperationNameMessage,exports.UniqueOperationNames=UniqueOperationNames;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],209:[function(require,module,exports){"use strict";function duplicateVariableMessage(e){return'There can be only one variable named "'+e+'".'}function UniqueVariableNames(e){var r=_Object$create(null);return{OperationDefinition:function(){r=_Object$create(null)},VariableDefinition:function(a){var i=a.variable.name.value;r[i]?e.reportError(new _error.GraphQLError(duplicateVariableMessage(i),[r[i],a.variable.name])):r[i]=a.variable.name}}}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.duplicateVariableMessage=duplicateVariableMessage,exports.UniqueVariableNames=UniqueVariableNames;var _error=require("../../error")},{"../../error":145,"babel-runtime/core-js/object/create":23}],210:[function(require,module,exports){"use strict";function nonInputTypeOnVarMessage(e,r){return'Variable "$'+e+'" cannot be non-input type "'+r+'".'}function VariablesAreInputTypes(e){return{VariableDefinition:function(r){var n=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,_typeDefinition.isInputType)(n)){var t=r.variable.name.value;e.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(t,(0,_languagePrinter.print)(r.type)),[r.type]))}}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nonInputTypeOnVarMessage=nonInputTypeOnVarMessage,exports.VariablesAreInputTypes=VariablesAreInputTypes;var _error=require("../../error"),_languagePrinter=require("../../language/printer"),_typeDefinition=require("../../type/definition"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":145,"../../language/printer":163,"../../type/definition":166,"../../utilities/typeFromAST":185}],211:[function(require,module,exports){"use strict";function badVarPosMessage(e,r,i){return'Variable "$'+e+'" of type "'+r+'" used in position '+('expecting type "'+i+'".')}function VariablesInAllowedPosition(e){var r=_Object$create(null);return{OperationDefinition:{enter:function(){r=_Object$create(null)},leave:function(i){var t=e.getRecursiveVariableUsages(i);t.forEach(function(i){var t=i.node,a=i.type,o=t.name.value,n=r[o];if(n&&a){var s=(0,_utilitiesTypeFromAST.typeFromAST)(e.getSchema(),n.type);s&&!(0,_utilitiesTypeComparators.isTypeSubTypeOf)(effectiveType(s,n),a)&&e.reportError(new _error.GraphQLError(badVarPosMessage(o,s,a),[n,t]))}})}},VariableDefinition:function(e){r[e.variable.name.value]=e}}}function effectiveType(e,r){return!r.defaultValue||e instanceof _typeDefinition.GraphQLNonNull?e:new _typeDefinition.GraphQLNonNull(e)}var _Object$create=require("babel-runtime/core-js/object/create").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.badVarPosMessage=badVarPosMessage,exports.VariablesInAllowedPosition=VariablesInAllowedPosition;var _error=require("../../error"),_typeDefinition=require("../../type/definition"),_utilitiesTypeComparators=require("../../utilities/typeComparators"),_utilitiesTypeFromAST=require("../../utilities/typeFromAST")},{"../../error":145,"../../type/definition":166,"../../utilities/typeComparators":184,"../../utilities/typeFromAST":185,"babel-runtime/core-js/object/create":23}],212:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _rulesUniqueOperationNames=require("./rules/UniqueOperationNames"),_rulesLoneAnonymousOperation=require("./rules/LoneAnonymousOperation"),_rulesKnownTypeNames=require("./rules/KnownTypeNames"),_rulesFragmentsOnCompositeTypes=require("./rules/FragmentsOnCompositeTypes"),_rulesVariablesAreInputTypes=require("./rules/VariablesAreInputTypes"),_rulesScalarLeafs=require("./rules/ScalarLeafs"),_rulesFieldsOnCorrectType=require("./rules/FieldsOnCorrectType"),_rulesUniqueFragmentNames=require("./rules/UniqueFragmentNames"),_rulesKnownFragmentNames=require("./rules/KnownFragmentNames"),_rulesNoUnusedFragments=require("./rules/NoUnusedFragments"),_rulesPossibleFragmentSpreads=require("./rules/PossibleFragmentSpreads"),_rulesNoFragmentCycles=require("./rules/NoFragmentCycles"),_rulesUniqueVariableNames=require("./rules/UniqueVariableNames"),_rulesNoUndefinedVariables=require("./rules/NoUndefinedVariables"),_rulesNoUnusedVariables=require("./rules/NoUnusedVariables"),_rulesKnownDirectives=require("./rules/KnownDirectives"),_rulesKnownArgumentNames=require("./rules/KnownArgumentNames"),_rulesUniqueArgumentNames=require("./rules/UniqueArgumentNames"),_rulesArgumentsOfCorrectType=require("./rules/ArgumentsOfCorrectType"),_rulesProvidedNonNullArguments=require("./rules/ProvidedNonNullArguments"),_rulesDefaultValuesOfCorrectType=require("./rules/DefaultValuesOfCorrectType"),_rulesVariablesInAllowedPosition=require("./rules/VariablesInAllowedPosition"),_rulesOverlappingFieldsCanBeMerged=require("./rules/OverlappingFieldsCanBeMerged"),_rulesUniqueInputFieldNames=require("./rules/UniqueInputFieldNames"),specifiedRules=[_rulesUniqueOperationNames.UniqueOperationNames,_rulesLoneAnonymousOperation.LoneAnonymousOperation,_rulesKnownTypeNames.KnownTypeNames,_rulesFragmentsOnCompositeTypes.FragmentsOnCompositeTypes,_rulesVariablesAreInputTypes.VariablesAreInputTypes,_rulesScalarLeafs.ScalarLeafs,_rulesFieldsOnCorrectType.FieldsOnCorrectType,_rulesUniqueFragmentNames.UniqueFragmentNames,_rulesKnownFragmentNames.KnownFragmentNames,_rulesNoUnusedFragments.NoUnusedFragments,_rulesPossibleFragmentSpreads.PossibleFragmentSpreads,_rulesNoFragmentCycles.NoFragmentCycles,_rulesUniqueVariableNames.UniqueVariableNames,_rulesNoUndefinedVariables.NoUndefinedVariables,_rulesNoUnusedVariables.NoUnusedVariables,_rulesKnownDirectives.KnownDirectives,_rulesKnownArgumentNames.KnownArgumentNames,_rulesUniqueArgumentNames.UniqueArgumentNames,_rulesArgumentsOfCorrectType.ArgumentsOfCorrectType,_rulesProvidedNonNullArguments.ProvidedNonNullArguments,_rulesDefaultValuesOfCorrectType.DefaultValuesOfCorrectType,_rulesVariablesInAllowedPosition.VariablesInAllowedPosition,_rulesOverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged,_rulesUniqueInputFieldNames.UniqueInputFieldNames];exports.specifiedRules=specifiedRules},{"./rules/ArgumentsOfCorrectType":188,"./rules/DefaultValuesOfCorrectType":189,"./rules/FieldsOnCorrectType":190,"./rules/FragmentsOnCompositeTypes":191,"./rules/KnownArgumentNames":192,"./rules/KnownDirectives":193,"./rules/KnownFragmentNames":194,"./rules/KnownTypeNames":195,"./rules/LoneAnonymousOperation":196,"./rules/NoFragmentCycles":197,"./rules/NoUndefinedVariables":198,"./rules/NoUnusedFragments":199,"./rules/NoUnusedVariables":200,"./rules/OverlappingFieldsCanBeMerged":201,"./rules/PossibleFragmentSpreads":202,"./rules/ProvidedNonNullArguments":203,"./rules/ScalarLeafs":204,"./rules/UniqueArgumentNames":205,"./rules/UniqueFragmentNames":206,"./rules/UniqueInputFieldNames":207,"./rules/UniqueOperationNames":208,"./rules/UniqueVariableNames":209,"./rules/VariablesAreInputTypes":210,"./rules/VariablesInAllowedPosition":211}],213:[function(require,module,exports){"use strict";function validate(e,t,r){(0,_jsutilsInvariant2.default)(e,"Must provide schema"),(0,_jsutilsInvariant2.default)(t,"Must provide document"),(0,_jsutilsInvariant2.default)(e instanceof _typeSchema.GraphQLSchema,"Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.");var i=new _utilitiesTypeInfo.TypeInfo(e);return visitUsingRules(e,i,t,r||_specifiedRules.specifiedRules)}function visitUsingRules(e,t,r,i){var a=new ValidationContext(e,r,t),n=i.map(function(e){return e(a)});return(0,_languageVisitor.visit)(r,(0,_languageVisitor.visitWithTypeInfo)(t,(0,_languageVisitor.visitInParallel)(n))),a.getErrors()}var _createClass=require("babel-runtime/helpers/create-class").default,_classCallCheck=require("babel-runtime/helpers/class-call-check").default,_Map=require("babel-runtime/core-js/map").default,_Object$create=require("babel-runtime/core-js/object/create").default,_interopRequireDefault=require("babel-runtime/helpers/interop-require-default").default,_interopRequireWildcard=require("babel-runtime/helpers/interop-require-wildcard").default;Object.defineProperty(exports,"__esModule",{value:!0}),exports.validate=validate,exports.visitUsingRules=visitUsingRules;var _jsutilsInvariant=require("../jsutils/invariant"),_jsutilsInvariant2=_interopRequireDefault(_jsutilsInvariant),_languageVisitor=(require("../error"),require("../language/visitor")),_languageKinds=require("../language/kinds"),Kind=_interopRequireWildcard(_languageKinds),_typeSchema=require("../type/schema"),_utilitiesTypeInfo=require("../utilities/TypeInfo"),_specifiedRules=require("./specifiedRules"),ValidationContext=function(){function e(t,r,i){_classCallCheck(this,e),this._schema=t,this._ast=r,this._typeInfo=i,this._errors=[],this._fragmentSpreads=new _Map,this._recursivelyReferencedFragments=new _Map,this._variableUsages=new _Map,this._recursiveVariableUsages=new _Map}return _createClass(e,[{key:"reportError",value:function(e){this._errors.push(e)}},{key:"getErrors",value:function(){return this._errors}},{key:"getSchema",value:function(){return this._schema}},{key:"getDocument",value:function(){return this._ast}},{key:"getFragment",value:function(e){var t=this._fragments;return t||(this._fragments=t=this.getDocument().definitions.reduce(function(e,t){return t.kind===Kind.FRAGMENT_DEFINITION&&(e[t.name.value]=t),e},{})),t[e]}},{key:"getFragmentSpreads",value:function(e){var t=this._fragmentSpreads.get(e);if(!t){t=[];for(var r=[e.selectionSet];0!==r.length;)for(var i=r.pop(),a=0;a<i.selections.length;a++){var n=i.selections[a];n.kind===Kind.FRAGMENT_SPREAD?t.push(n):n.selectionSet&&r.push(n.selectionSet)}this._fragmentSpreads.set(e,t)}return t}},{key:"getRecursivelyReferencedFragments",value:function(e){var t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];for(var r=_Object$create(null),i=[e];0!==i.length;)for(var a=i.pop(),n=this.getFragmentSpreads(a),s=0;s<n.length;s++){var u=n[s].name.value;if(r[u]!==!0){r[u]=!0;var l=this.getFragment(u);l&&(t.push(l),i.push(l))}}this._recursivelyReferencedFragments.set(e,t)}return t}},{key:"getVariableUsages",value:function(e){var t=this,r=this._variableUsages.get(e);return r||!function(){var i=[],a=new _utilitiesTypeInfo.TypeInfo(t._schema);(0,_languageVisitor.visit)(e,(0,_languageVisitor.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(e){i.push({node:e,type:a.getInputType()})}})),r=i,t._variableUsages.set(e,r)}(),r}},{key:"getRecursiveVariableUsages",value:function(e){var t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(var r=this.getRecursivelyReferencedFragments(e),i=0;i<r.length;i++)Array.prototype.push.apply(t,this.getVariableUsages(r[i]));this._recursiveVariableUsages.set(e,t)}return t}},{key:"getType",value:function(){return this._typeInfo.getType()}},{key:"getParentType",value:function(){return this._typeInfo.getParentType()}},{key:"getInputType",value:function(){return this._typeInfo.getInputType()}},{key:"getFieldDef",value:function(){return this._typeInfo.getFieldDef()}},{key:"getDirective",value:function(){return this._typeInfo.getDirective()}},{key:"getArgument",value:function(){return this._typeInfo.getArgument()}}]),e}();exports.ValidationContext=ValidationContext},{"../error":145,"../jsutils/invariant":154,"../language/kinds":159,"../language/visitor":165,"../type/schema":171,"../utilities/TypeInfo":172,"./specifiedRules":212,"babel-runtime/core-js/map":21,"babel-runtime/core-js/object/create":23,"babel-runtime/helpers/class-call-check":30,"babel-runtime/helpers/create-class":31,"babel-runtime/helpers/interop-require-default":35,"babel-runtime/helpers/interop-require-wildcard":36}],214:[function(require,module,exports){(function(global){(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic);
}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(){}function h(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function a(t,n,i){if(i||"function"==typeof n){i||(i=n,n=null),n=h({},a.defaults,n||{});var l,o,p=n.highlight,u=0;try{l=e.lex(t,n)}catch(c){return i(c)}o=l.length;var g=function(e){if(e)return n.highlight=p,i(e);var t;try{t=r.parse(l,n)}catch(s){e=s}return n.highlight=p,e?i(e):i(null,t)};if(!p||p.length<3)return g();if(delete n.highlight,!o)return g();for(;u<l.length;u++)!function(e){return"code"!==e.type?--o||g():p(e.text,e.lang,function(t,n){return t?g(t):null==n||n===e.text?--o||g():(e.text=n,e.escaped=!0,void(--o||g()))})}(l[u])}else try{return n&&(n=h({},a.defaults,n)),r.parse(e.lex(t,n),n)}catch(c){if(c.message+="\nPlease report this to https://github.com/chjj/marked.",(n||a.defaults).silent)return"<p>An error occured:</p><pre>"+s(c.message+"",!0)+"</pre>";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].split(/ *\| */);this.tokens.push(h)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;c>u;u++)h=i[u],a=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(a-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&u!==c-1&&(o=p.bullet.exec(i[u+1])[0],l===o||l.length>1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<h.align.length;u++)/^ *-+: *$/.test(h.align[u])?h.align[u]="right":/^ *:-+: *$/.test(h.align[u])?h.align[u]="center":/^ *:-+ *$/.test(h.align[u])?h.align[u]="left":h.align[u]=null;for(u=0;u<h.cells.length;u++)h.cells[u]=h.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(h)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var u={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};u._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,u._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;r>s;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+s(t,!0)+'">'+(n?e:s(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"\n</code></pre>"},n.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},n.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},n.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},n.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},n.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},n.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},n.prototype.strong=function(e){return"<strong>"+e+"</strong>"},n.prototype.em=function(e){return"<em>"+e+"</em>"},n.prototype.codespan=function(e){return"<code>"+e+"</code>"},n.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.prototype.del=function(e){return"<del>"+e+"</del>"},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"},n.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(i+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",s=0;s<t.length;s++)n+=this.renderer.tablecell(this.inline.output(t[s]),{header:!1,align:this.token.align[s]});l+=this.renderer.tablerow(n)}return this.renderer.table(i,l);case"blockquote_start":for(var l="";"blockquote_end"!==this.next().type;)l+=this.tok();return this.renderer.blockquote(l);case"list_start":for(var l="",o=this.token.ordered;"list_end"!==this.next().type;)l+=this.tok();return this.renderer.list(l,o);case"list_item_start":for(var l="";"list_item_end"!==this.next().type;)l+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(l);case"loose_item_start":for(var l="";"list_item_end"!==this.next().type;)l+=this.tok();return this.renderer.listitem(l);case"html":var h=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(h);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},o.exec=o,a.options=a.setOptions=function(e){return h(a.defaults,e),a},a.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new n,xhtml:!1},a.Parser=r,a.parser=r.parse,a.Renderer=n,a.Lexer=e,a.lexer=e.lex,a.InlineLexer=t,a.inlineLexer=t.output,a.parse=a,"undefined"!=typeof module&&"object"==typeof exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):this.marked=a}).call(function(){return this||("undefined"!=typeof window?window:global)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[8])(8)});
|
docs/app/Examples/modules/Checkbox/Variations/CheckboxExampleFitted.js | mohammed88/Semantic-UI-React | import React from 'react'
import { Checkbox, Segment } from 'semantic-ui-react'
const CheckboxExampleFitted = () => (
<div>
<Segment compact>
<Checkbox />
</Segment>
<Segment compact>
<Checkbox slider />
</Segment>
<Segment compact>
<Checkbox toggle />
</Segment>
</div>
)
export default CheckboxExampleFitted
|
node_modules/re-base/tests/specs/rtdb/push.spec.js | aggiedefenders/aggiedefenders.github.io | const Rebase = require('../../../src/rebase');
var React = require('react');
var ReactDOM = require('react-dom');
var firebase = require('firebase');
var database = require('firebase/database');
var invalidEndpoints = require('../../fixtures/invalidEndpoints');
var dummyObjData = require('../../fixtures/dummyObjData');
var invalidOptions = require('../../fixtures/invalidOptions');
var firebaseConfig = require('../../fixtures/config');
describe('push()', function() {
var base;
var testEndpoint = 'test/push';
var app;
beforeEach(done => {
app = firebase.initializeApp(firebaseConfig);
var db = firebase.database(app);
base = Rebase.createClass(db);
done();
});
afterEach(done => {
var testApp = firebase.initializeApp(firebaseConfig, 'CLEAN_UP');
testApp
.database()
.ref(testEndpoint)
.set(null)
.then(() => {
return firebase.Promise.all([app.delete(), testApp.delete()]);
})
.then(done)
.catch(err => done.fail(err));
});
it('push() throws an error given a invalid endpoint', function() {
invalidEndpoints.forEach(endpoint => {
try {
base.push(endpoint, {
data: dummyObjData
});
} catch (err) {
expect(err.code).toEqual('INVALID_ENDPOINT');
}
});
});
it('push() throws an error given an invalid options object', function() {
invalidOptions.forEach(option => {
try {
base.push(testEndpoint, option);
} catch (err) {
expect(err.code).toEqual('INVALID_OPTIONS');
}
});
});
it('push() returns a Firebase reference for the generated location', function() {
var returnedRef = base.push(testEndpoint, {
data: dummyObjData
});
var endpointBaseUrl = returnedRef.parent.toString();
expect(endpointBaseUrl).toEqual(
`${firebaseConfig.databaseURL}/${testEndpoint}`
);
expect(returnedRef.key).toEqual(jasmine.any(String));
});
it('push() updates Firebase correctly', done => {
base.push(testEndpoint, {
data: dummyObjData,
then() {
var testApp = firebase.initializeApp(firebaseConfig, 'DB_CHECK');
var ref = testApp.database().ref();
ref.child(testEndpoint).once('value', snapshot => {
var keyedData = snapshot.val();
var data = keyedData[Object.keys(keyedData)[0]];
expect(data).toEqual(dummyObjData);
testApp.delete().then(done);
});
}
});
});
});
|
src/js/components/icons/base/Link.js | odedre/grommet-final | /**
* @description Link SVG Icon.
* @property {string} a11yTitle - Accessibility Title. If not set uses the default title of the status icon.
* @property {string} colorIndex - The color identifier to use for the stroke color.
* If not specified, this component will default to muiTheme.palette.textColor.
* @property {xsmall|small|medium|large|xlarge|huge} size - The icon size. Defaults to small.
* @property {boolean} responsive - Allows you to redefine what the coordinates.
* @example
* <svg width="24" height="24" ><path d="M16.1251884,2.42026615 C16.9095797,1.63587482 18.1818354,1.63638083 18.9643331,2.41887857 L21.5811214,5.03566688 C22.3647464,5.81929188 22.3723943,7.08215115 21.5797338,7.87481161 L17.8748116,11.5797338 C17.0904203,12.3641252 15.8181646,12.3636192 15.0356669,11.5811214 L12.4188786,8.96433312 C11.6352536,8.18070812 11.6276057,6.91784885 12.4202662,6.12518839 L16.1251884,2.42026615 Z M6.12518839,12.4202662 C6.90957973,11.6358748 8.18183538,11.6363808 8.96433312,12.4188786 L11.5811214,15.0356669 C12.3647464,15.8192919 12.3723943,17.0821512 11.5797338,17.8748116 L7.87481161,21.5797338 C7.09042027,22.3641252 5.81816462,22.3636192 5.03566688,21.5811214 L2.41887857,18.9643331 C1.63525357,18.1807081 1.6276057,16.9178488 2.42026615,16.1251884 L6.12518839,12.4202662 Z M7,17 L17,7"/></svg>
*/
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import CSSClassnames from '../../../utils/CSSClassnames';
import Intl from '../../../utils/Intl';
import Props from '../../../utils/Props';
const CLASS_ROOT = CSSClassnames.CONTROL_ICON;
const COLOR_INDEX = CSSClassnames.COLOR_INDEX;
export default class Icon extends Component {
render () {
const { className, colorIndex } = this.props;
let { a11yTitle, size, responsive } = this.props;
let { intl } = this.context;
const classes = classnames(
CLASS_ROOT,
`${CLASS_ROOT}-link`,
className,
{
[`${CLASS_ROOT}--${size}`]: size,
[`${CLASS_ROOT}--responsive`]: responsive,
[`${COLOR_INDEX}-${colorIndex}`]: colorIndex
}
);
a11yTitle = a11yTitle || Intl.getMessage(intl, 'link');
const restProps = Props.omit(this.props, Object.keys(Icon.propTypes));
return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeWidth="2" d="M16.1251884,2.42026615 C16.9095797,1.63587482 18.1818354,1.63638083 18.9643331,2.41887857 L21.5811214,5.03566688 C22.3647464,5.81929188 22.3723943,7.08215115 21.5797338,7.87481161 L17.8748116,11.5797338 C17.0904203,12.3641252 15.8181646,12.3636192 15.0356669,11.5811214 L12.4188786,8.96433312 C11.6352536,8.18070812 11.6276057,6.91784885 12.4202662,6.12518839 L16.1251884,2.42026615 Z M6.12518839,12.4202662 C6.90957973,11.6358748 8.18183538,11.6363808 8.96433312,12.4188786 L11.5811214,15.0356669 C12.3647464,15.8192919 12.3723943,17.0821512 11.5797338,17.8748116 L7.87481161,21.5797338 C7.09042027,22.3641252 5.81816462,22.3636192 5.03566688,21.5811214 L2.41887857,18.9643331 C1.63525357,18.1807081 1.6276057,16.9178488 2.42026615,16.1251884 L6.12518839,12.4202662 Z M7,17 L17,7"/></svg>;
}
};
Icon.contextTypes = {
intl: PropTypes.object
};
Icon.defaultProps = {
responsive: true
};
Icon.displayName = 'Link';
Icon.icon = true;
Icon.propTypes = {
a11yTitle: PropTypes.string,
colorIndex: PropTypes.string,
size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']),
responsive: PropTypes.bool
};
|
src/shared/utils/reactProdInvariant.js | leexiaosi/react | /**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule reactProdInvariant
* @flow
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code: string): void {
var argCount = arguments.length - 1;
var message =
'Minified React error #' +
code +
'; visit ' +
'http://facebook.github.io/react/docs/error-decoder.html?invariant=' +
code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message +=
' for the full message or use the non-minified dev environment' +
' for full errors and additional helpful warnings.';
var error: Error & {framesToPop?: number} = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
|
pages/index/components/layout.js | hschlichter/react-redux-pages-demo | import React, { Component } from 'react';
import { connect } from 'react-redux';
import Snip from './snip';
export default class Layout extends Component {
render() {
return (
<div>
<header className="c-box c-box--dark">
<a className="c-box--dark" href="/"><strong>React Redux Pages Demo</strong></a>
</header>
<div className="c-box c-box--scroll">
<div className="o-layout o-layout--center-horizontal">
<div className="c-box">
<p>{this.props.dummy.welcome}</p>
</div>
</div>
<div className="c-box">
<div className="o-pack o-pack--equal o-pack--top">
<Snip article={this.props.dummy.articles[0]} />
<Snip article={this.props.dummy.articles[1]} />
</div>
</div>
</div>
</div>
);
}
}
export default connect((state) => {
return {
dummy: state.dummy
};
})(Layout);
|
installer/frontend/trail.js | hhoover/tectonic-installer | import _ from 'lodash';
import React from 'react';
import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable';
import { commitPhases } from './actions';
import { PLATFORM_TYPE, DRY_RUN } from './cluster-config';
import { CertificateAuthority } from './components/certificate-authority';
import { ClusterInfo } from './components/cluster-info';
import { ClusterType } from './components/cluster-type';
import { DryRun } from './components/dry-run';
import { SubmitDefinition } from './components/submit-definition';
import { Success } from './components/success';
import { TF_PowerOn } from './components/tf-poweron';
import { Users } from './components/users';
import { BM_Controllers, BM_Workers } from './components/bm-nodeforms';
import { BM_Credentials } from './components/bm-credentials';
import { BM_Hostname } from './components/bm-hostname';
import { BM_Matchbox } from './components/bm-matchbox';
import { KubernetesCIDRs } from './components/k8s-cidrs';
import { BM_SSHKeys } from './components/bm-sshkeys';
import { AWS_CloudCredentials } from './components/aws-cloud-credentials';
import { AWS_ClusterInfo } from './components/aws-cluster-info';
import { AWS_Nodes, Etcd } from './components/nodes';
import { AWS_SubmitKeys } from './components/aws-submit-keys';
import { AWS_VPC } from './components/aws-vpc';
import {
AWS_TF,
BARE_METAL_TF,
isSupported,
} from './platforms';
// Common pages
const certificateAuthorityPage = {
path: '/define/certificate-authority',
component: CertificateAuthority,
title: 'Certificate Authority',
};
const clusterTypePage = {
path: '/define/cluster-type',
component: ClusterType,
title: 'Platform',
};
const dryRunPage = {
path: '/define/advanced',
component: DryRun,
title: 'Download Assets',
};
const etcdPage = {
path: '/define/etcd',
component: Etcd,
title: 'etcd Connection',
};
const submitDefinitionPage = {
path: '/define/submit',
component: SubmitDefinition,
title: 'Submit',
hidePager: true,
};
const successPage = {
path: '/boot/complete',
component: Success,
title: 'Installation Complete',
hidePager: true,
};
const TFPowerOnPage = {
path: '/boot/tf/poweron',
component: TF_PowerOn,
title: 'Start Installation',
};
const usersPage = {
path: '/define/users',
component: Users,
title: 'Console Login',
};
// Baremetal pages
const bmClusterInfoPage = {
path: '/define/cluster-info',
component: ClusterInfo,
title: 'Cluster Info',
};
const bmControllersPage = {
path: '/define/controllers',
component: BM_Controllers,
title: 'Define Masters',
};
const bmCredentialsPage = {
path: '/define/credentials',
component: BM_Credentials,
title: 'Matchbox Credentials',
};
const bmHostnamePage = {
path: '/define/hostname',
component: BM_Hostname,
title: 'Cluster DNS',
};
const bmMatchboxPage = {
path: '/define/matchbox',
component: BM_Matchbox,
title: 'Matchbox Address',
};
const bmNetworkConfigPage = {
path: '/define/network-config',
component: KubernetesCIDRs,
title: 'Network Configuration',
};
const bmSshKeysPage = {
path: '/define/ssh-keys',
component: BM_SSHKeys,
title: 'SSH Key',
};
const bmWorkersPage = {
path: '/define/workers',
component: BM_Workers,
title: 'Define Workers',
};
// AWS pages
const awsClusterInfoPage = {
path: '/define/aws/cluster-info',
component: AWS_ClusterInfo,
title: 'Cluster Info',
};
const awsCloudCredentialsPage = {
path: '/define/aws/cloud-credentials',
component: AWS_CloudCredentials,
title: 'AWS Credentials',
};
const awsDefineNodesPage = {
path: '/define/aws/nodes',
component: AWS_Nodes,
title: 'Define Nodes',
};
const awsSubmitKeysPage = {
path: '/define/aws/keys',
component: AWS_SubmitKeys,
title: 'SSH Key',
};
const awsVPCPage = {
path: '/define/aws/vpc',
component: AWS_VPC,
title: 'Networking',
};
// This component is never visible!
const loadingPage = {
path: '/',
component: React.createElement('div'),
title: 'Tectonic',
};
export const trailSections = new Map([
['loading', [
loadingPage,
]],
['choose', [
clusterTypePage,
]],
['defineBaremetal', [
bmClusterInfoPage,
bmHostnamePage,
certificateAuthorityPage,
bmMatchboxPage,
bmCredentialsPage,
bmControllersPage,
bmWorkersPage,
bmNetworkConfigPage,
etcdPage,
bmSshKeysPage,
usersPage,
submitDefinitionPage,
]],
['defineAWS', [
awsCloudCredentialsPage,
awsClusterInfoPage,
certificateAuthorityPage,
awsSubmitKeysPage,
awsDefineNodesPage,
awsVPCPage,
usersPage,
submitDefinitionPage,
]],
['bootBaremetalTF', [
TFPowerOnPage,
successPage,
]],
['bootAWSTF', [
TFPowerOnPage,
successPage,
]],
['bootDryRun', [
dryRunPage,
]],
]);
// Lets us do 'trailSections.defineAWS' instead of using trailSections.get('defineAWS')
trailSections.forEach((v, k) => {
trailSections[k] = v;
});
// A Trail is an immutable representation of the navigation options available to a user.
class Trail {
constructor (sections, whitelist) {
this.sections = sections;
const sectionPages = this.sections.reduce((ls, l) => ls.concat(l), []);
sectionPages.forEach(p => {
if (!p.component) {
throw new Error(`${p.title} has no component`);
}
});
this.pages = !whitelist ? sectionPages : sectionPages.filter(p => whitelist.includes(p));
this.ixByPage = this.pages.reduce((m, v, ix) => m.set(v, ix), ImmutableMap());
this.pageByPath = this.pages.reduce((m, v) => m.set(v.path, v), ImmutableMap());
}
// Returns the previous page in the trail if that page exists
previousFrom (page) {
const myIx = this.ixByPage.get(page);
return this.pages[myIx - 1];
}
// Returns the next page in the trail if that exists
nextFrom (page) {
const myIx = this.ixByPage.get(page);
return this.pages[myIx + 1];
}
}
const doingStuff = ImmutableSet([commitPhases.REQUESTED, commitPhases.WAITING]);
const platformToSection = {
[AWS_TF]: {
choose: new Trail([trailSections.choose, trailSections.defineAWS]),
define: new Trail([trailSections.defineAWS], [submitDefinitionPage]),
boot: new Trail([trailSections.bootAWSTF]),
},
[BARE_METAL_TF]: {
choose: new Trail([trailSections.choose, trailSections.defineBaremetal]),
define: new Trail([trailSections.defineBaremetal], [submitDefinitionPage]),
boot: new Trail([trailSections.bootBaremetalTF]),
},
};
export const trail = ({cluster, clusterConfig, commitState}) => {
const platform = clusterConfig[PLATFORM_TYPE];
if (platform === '') {
return new Trail([trailSections.loading]);
}
if (!isSupported(platform)) {
return new Trail([trailSections.choose]);
}
const {phase} = commitState;
const submitted = cluster.ready || (phase === commitPhases.SUCCEEDED);
if (submitted) {
// If we detected a dry run in progress when the app started, then clusterConfig will not be populated, so also
// check for a Terraform "show" (dry run) action
if (clusterConfig[DRY_RUN] || _.get(cluster, 'status.terraform.action') === 'show') {
return new Trail([trailSections.bootDryRun]);
}
return platformToSection[platform].boot;
}
if (doingStuff.has(phase)) {
return platformToSection[platform].define;
}
return platformToSection[platform].choose;
};
|
node_modules/react-dom/lib/ReactUpdateQueue.js | Rabbit884/reactapp | /**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = require('./reactProdInvariant');
var ReactCurrentOwner = require('react/lib/ReactCurrentOwner');
var ReactInstanceMap = require('./ReactInstanceMap');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactUpdates = require('./ReactUpdates');
var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
function enqueueUpdate(internalInstance) {
ReactUpdates.enqueueUpdate(internalInstance);
}
function formatUnexpectedArgument(arg) {
var type = typeof arg;
if (type !== 'object') {
return type;
}
var displayName = arg.constructor && arg.constructor.name || type;
var keys = Object.keys(arg);
if (keys.length > 0 && keys.length < 20) {
return displayName + ' (keys: ' + keys.join(', ') + ')';
}
return displayName;
}
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
var internalInstance = ReactInstanceMap.get(publicInstance);
if (!internalInstance) {
if (process.env.NODE_ENV !== 'production') {
var ctor = publicInstance.constructor;
// Only warn when we have a callerName. Otherwise we should be silent.
// We're probably calling from enqueueCallback. We don't want to warn
// there because we already warned for the corresponding lifecycle method.
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
}
return null;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
}
return internalInstance;
}
/**
* ReactUpdateQueue allows for state updates to be scheduled into a later
* reconciliation step.
*/
var ReactUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
var internalInstance = ReactInstanceMap.get(publicInstance);
if (internalInstance) {
// During componentWillMount and render this will still be null but after
// that will always render to something. At least for now. So we can use
// this hack.
return !!internalInstance._renderedComponent;
} else {
return false;
}
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @param {string} callerName Name of the calling function in the public API.
* @internal
*/
enqueueCallback: function (publicInstance, callback, callerName) {
ReactUpdateQueue.validateCallback(callback, callerName);
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
// Previously we would throw an error if we didn't have an internal
// instance. Since we want to make it a no-op instead, we mirror the same
// behavior we have in other enqueue* methods.
// We also need to ignore callbacks in componentWillMount. See
// enqueueUpdates.
if (!internalInstance) {
return null;
}
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
// TODO: The callback here is ignored when setState is called from
// componentWillMount. Either fix it or disallow doing so completely in
// favor of getInitialState. Alternatively, we can disallow
// componentWillMount during server-side rendering.
enqueueUpdate(internalInstance);
},
enqueueCallbackInternal: function (internalInstance, callback) {
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
enqueueUpdate(internalInstance);
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
if (!internalInstance) {
return;
}
internalInstance._pendingForceUpdate = true;
enqueueUpdate(internalInstance);
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
if (!internalInstance) {
return;
}
internalInstance._pendingStateQueue = [completeState];
internalInstance._pendingReplaceState = true;
enqueueUpdate(internalInstance);
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetState();
process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
}
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
if (!internalInstance) {
return;
}
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
queue.push(partialState);
enqueueUpdate(internalInstance);
},
enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
internalInstance._pendingElement = nextElement;
// TODO: introduce _pendingContext instead of setting it directly.
internalInstance._context = nextContext;
enqueueUpdate(internalInstance);
},
validateCallback: function (callback, callerName) {
!(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
}
};
module.exports = ReactUpdateQueue; |
src/Parser/Paladin/Holy/Modules/Items/ChainOfThrayn.js | enragednuke/WoWAnalyzer | import React from 'react';
import SPELLS from 'common/SPELLS';
import ITEMS from 'common/ITEMS';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import ItemHealingDone from 'Main/ItemHealingDone';
import { ABILITIES_AFFECTED_BY_HEALING_INCREASES, AVENGING_WRATH_HEALING_INCREASE } from '../../Constants';
const CHAIN_OF_THRAYN_HEALING_INCREASE = 0.25;
class ChainOfThrayn extends Analyzer {
static dependencies = {
combatants: Combatants,
};
healing = 0;
on_initialized() {
this.active = this.combatants.selected.hasWaist(ITEMS.CHAIN_OF_THRAYN.id);
}
on_heal(event) {
if (this.owner.byPlayer(event)) {
this.processHeal(event);
}
}
processHeal(event) {
const spellId = event.ability.guid;
if (ABILITIES_AFFECTED_BY_HEALING_INCREASES.indexOf(spellId) === -1) {
return;
}
if (!this.combatants.selected.hasBuff(SPELLS.AVENGING_WRATH.id, event.timestamp)) {
return;
}
const amount = event.amount;
const absorbed = event.absorbed || 0;
const overheal = event.overheal || 0;
const raw = amount + absorbed + overheal;
const totalHealingIncreaseFactor = 1 + AVENGING_WRATH_HEALING_INCREASE + CHAIN_OF_THRAYN_HEALING_INCREASE;
const totalHealingBeforeIncreases = raw / totalHealingIncreaseFactor;
const regularAvengingWrathHealingIncreaseFactor = 1 + AVENGING_WRATH_HEALING_INCREASE;
const totalHealingBeforeChainBonus = totalHealingBeforeIncreases * regularAvengingWrathHealingIncreaseFactor;
const healingIncrease = raw - totalHealingBeforeChainBonus;
const effectiveHealing = Math.max(0, healingIncrease - overheal);
this.healing += effectiveHealing;
}
// Beacon transfer is included in `ABILITIES_AFFECTED_BY_HEALING_INCREASES`
item() {
return {
item: ITEMS.CHAIN_OF_THRAYN,
result: <ItemHealingDone amount={this.healing} />,
};
}
}
export default ChainOfThrayn;
|
ajax/libs/react/0.5.1/react.min.js | jimmybyrum/cdnjs | /**
* React v0.5.1
*
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.React=t():"undefined"!=typeof global?global.React=t():"undefined"!=typeof self&&(self.React=t())}(function(){return function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e){function n(t){var e=r(t);if(!e)throw new Error(o('Tried to get element with id of "%s" but it is not present on the page.',t));return e}var r=t("./ge"),o=t("./ex");e.exports=n},{"./ex":82,"./ge":86}],2:[function(t,e){"use strict";var n={fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,zIndex:!0,zoom:!0},r={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},o={isUnitlessNumber:n,shorthandPropertyExpansions:r};e.exports=o},{}],3:[function(t,e){"use strict";var n=t("./CSSProperty"),r=t("./dangerousStyleValue"),o=t("./escapeTextForBrowser"),i=t("./hyphenate"),a=t("./memoizeStringOnly"),s=a(function(t){return o(i(t))}),u={createMarkupForStyles:function(t){var e="";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];null!=o&&(e+=s(n)+":",e+=r(n,o)+";")}return e||null},setValueForStyles:function(t,e){var o=t.style;for(var i in e)if(e.hasOwnProperty(i)){var a=r(i,e[i]);if(a)o[i]=a;else{var s=n.shorthandPropertyExpansions[i];if(s)for(var u in s)o[u]="";else o[i]=""}}}};e.exports=u},{"./CSSProperty":2,"./dangerousStyleValue":79,"./escapeTextForBrowser":81,"./hyphenate":93,"./memoizeStringOnly":102}],4:[function(t,e){"use strict";var n={},r={putListener:function(t,e,r){var o=n[e]||(n[e]={});o[t]=r},getListener:function(t,e){var r=n[e];return r&&r[t]},deleteListener:function(t,e){var r=n[e];r&&delete r[t]},deleteAllListeners:function(t){for(var e in n)delete n[e][t]},__purge:function(){n={}}};e.exports=r},{}],5:[function(t,e){"use strict";function n(t){return"SELECT"===t.nodeName||"INPUT"===t.nodeName&&"file"===t.type}function r(t){var e=E.getPooled(N.change,T,t);y.accumulateTwoPhaseDispatches(e),g.enqueueEvents(e),g.processEventQueue()}function o(t,e){_=t,T=e,_.attachEvent("onchange",r)}function i(){_&&(_.detachEvent("onchange",r),_=null,T=null)}function a(t,e,n){return t===b.topChange?n:void 0}function s(t,e,n){t===b.topFocus?(i(),o(e,n)):t===b.topBlur&&i()}function u(t,e){_=t,T=e,I=t.value,x=Object.getOwnPropertyDescriptor(t.constructor.prototype,"value"),Object.defineProperty(_,"value",S),_.attachEvent("onpropertychange",l)}function c(){_&&(delete _.value,_.detachEvent("onpropertychange",l),_=null,T=null,I=null,x=null)}function l(t){if("value"===t.propertyName){var e=t.srcElement.value;e!==I&&(I=e,r(t))}}function p(t,e,n){return t===b.topInput?n:void 0}function d(t,e,n){t===b.topFocus?(c(),u(e,n)):t===b.topBlur&&c()}function h(t){return t!==b.topSelectionChange&&t!==b.topKeyUp&&t!==b.topKeyDown||!_||_.value===I?void 0:(I=_.value,T)}function f(t){return"INPUT"===t.nodeName&&("checkbox"===t.type||"radio"===t.type)}function m(t,e,n){return t===b.topClick?n:void 0}var v=t("./EventConstants"),g=t("./EventPluginHub"),y=t("./EventPropagators"),C=t("./ExecutionEnvironment"),E=t("./SyntheticEvent"),M=t("./isEventSupported"),R=t("./isTextInputElement"),D=t("./keyOf"),b=v.topLevelTypes,N={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})}}},_=null,T=null,I=null,x=null,P=!1;C.canUseDOM&&(P=M("change")&&(!("documentMode"in document)||document.documentMode>8));var O=!1;C.canUseDOM&&(O=M("input")&&(!("documentMode"in document)||document.documentMode>9));var S={get:function(){return x.get.call(this)},set:function(t){I=""+t,x.set.call(this,t)}},w={eventTypes:N,extractEvents:function(t,e,r,o){var i,u;if(n(e)?P?i=a:u=s:R(e)?O?i=p:(i=h,u=d):f(e)&&(i=m),i){var c=i(t,e,r);if(c){var l=E.getPooled(N.change,c,o);return y.accumulateTwoPhaseDispatches(l),l}}u&&u(t,e,r)}};e.exports=w},{"./EventConstants":14,"./EventPluginHub":16,"./EventPropagators":19,"./ExecutionEnvironment":20,"./SyntheticEvent":64,"./isEventSupported":95,"./isTextInputElement":97,"./keyOf":101}],6:[function(t,e){"use strict";function n(t){switch(t){case v.topCompositionStart:return y.compositionStart;case v.topCompositionEnd:return y.compositionEnd;case v.topCompositionUpdate:return y.compositionUpdate}}function r(t,e){return t===v.topKeyDown&&e.keyCode===f}function o(t,e){switch(t){case v.topKeyUp:return-1!==h.indexOf(e.keyCode);case v.topKeyDown:return e.keyCode!==f;case v.topKeyPress:case v.topMouseDown:case v.topBlur:return!0;default:return!1}}function i(t){this.root=t,this.startSelection=c.getSelection(t),this.startValue=this.getText()}var a=t("./EventConstants"),s=t("./EventPropagators"),u=t("./ExecutionEnvironment"),c=t("./ReactInputSelection"),l=t("./SyntheticCompositionEvent"),p=t("./getTextContentAccessor"),d=t("./keyOf"),h=[9,13,27,32],f=229,m=u.canUseDOM&&"CompositionEvent"in window,v=a.topLevelTypes,g=null,y={compositionEnd:{phasedRegistrationNames:{bubbled:d({onCompositionEnd:null}),captured:d({onCompositionEndCapture:null})}},compositionStart:{phasedRegistrationNames:{bubbled:d({onCompositionStart:null}),captured:d({onCompositionStartCapture:null})}},compositionUpdate:{phasedRegistrationNames:{bubbled:d({onCompositionUpdate:null}),captured:d({onCompositionUpdateCapture:null})}}};i.prototype.getText=function(){return this.root.value||this.root[p()]},i.prototype.getData=function(){var t=this.getText(),e=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return t.substr(e,t.length-n-e)};var C={eventTypes:y,extractEvents:function(t,e,a,u){var c,p;if(m?c=n(t):g?o(t,u)&&(c=y.compositionEnd,p=g.getData(),g=null):r(t,u)&&(c=y.start,g=new i(e)),c){var d=l.getPooled(c,a,u);return p&&(d.data=p),s.accumulateTwoPhaseDispatches(d),d}}};e.exports=C},{"./EventConstants":14,"./EventPropagators":19,"./ExecutionEnvironment":20,"./ReactInputSelection":45,"./SyntheticCompositionEvent":63,"./getTextContentAccessor":92,"./keyOf":101}],7:[function(t,e){"use strict";function n(t,e,n){var r=t.childNodes;r[n]!==e&&(e.parentNode===t&&t.removeChild(e),n>=r.length?t.appendChild(e):t.insertBefore(e,r[n]))}var r=t("./Danger"),o=t("./ReactMultiChildUpdateTypes"),i=t("./getTextContentAccessor"),a=i()||"NA",s={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,processUpdates:function(t,e){for(var i,s=null,u=null,c=0;i=t[c];c++)if(i.type===o.MOVE_EXISTING||i.type===o.REMOVE_NODE){var l=i.fromIndex,p=i.parentNode.childNodes[l],d=i.parentID;s=s||{},s[d]=s[d]||[],s[d][l]=p,u=u||[],u.push(p)}var h=r.dangerouslyRenderMarkup(e);if(u)for(var f=0;f<u.length;f++)u[f].parentNode.removeChild(u[f]);for(var m=0;i=t[m];m++)switch(i.type){case o.INSERT_MARKUP:n(i.parentNode,h[i.markupIndex],i.toIndex);break;case o.MOVE_EXISTING:n(i.parentNode,s[i.parentID][i.fromIndex],i.toIndex);break;case o.TEXT_CONTENT:i.parentNode[a]=i.textContent;break;case o.REMOVE_NODE:}}};e.exports=s},{"./Danger":10,"./ReactMultiChildUpdateTypes":51,"./getTextContentAccessor":92}],8:[function(t,e){"use strict";var n=t("./invariant"),r={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_BOOLEAN_VALUE:4,HAS_SIDE_EFFECTS:8,injectDOMPropertyConfig:function(t){var e=t.Properties||{},o=t.DOMAttributeNames||{},a=t.DOMPropertyNames||{},s=t.DOMMutationMethods||{};t.isCustomAttribute&&i._isCustomAttributeFunctions.push(t.isCustomAttribute);for(var u in e){n(!i.isStandardName[u]),i.isStandardName[u]=!0;var c=u.toLowerCase();i.getPossibleStandardName[c]=u;var l=o[u];l&&(i.getPossibleStandardName[l]=u),i.getAttributeName[u]=l||c,i.getPropertyName[u]=a[u]||u;var p=s[u];p&&(i.getMutationMethod[u]=p);var d=e[u];i.mustUseAttribute[u]=d&r.MUST_USE_ATTRIBUTE,i.mustUseProperty[u]=d&r.MUST_USE_PROPERTY,i.hasBooleanValue[u]=d&r.HAS_BOOLEAN_VALUE,i.hasSideEffects[u]=d&r.HAS_SIDE_EFFECTS,n(!i.mustUseAttribute[u]||!i.mustUseProperty[u]),n(i.mustUseProperty[u]||!i.hasSideEffects[u])}}},o={},i={isStandardName:{},getPossibleStandardName:{},getAttributeName:{},getPropertyName:{},getMutationMethod:{},mustUseAttribute:{},mustUseProperty:{},hasBooleanValue:{},hasSideEffects:{},_isCustomAttributeFunctions:[],isCustomAttribute:function(t){return i._isCustomAttributeFunctions.some(function(e){return e.call(null,t)})},getDefaultValueForProperty:function(t,e){var n,r=o[t];return r||(o[t]=r={}),e in r||(n=document.createElement(t),r[e]=n[e]),r[e]},injection:r};e.exports=i},{"./invariant":94}],9:[function(t,e){"use strict";var n=t("./DOMProperty"),r=t("./escapeTextForBrowser"),o=t("./memoizeStringOnly"),i=o(function(t){return r(t)+'="'}),a={createMarkupForProperty:function(t,e){if(n.isStandardName[t]){if(null==e||n.hasBooleanValue[t]&&!e)return"";var o=n.getAttributeName[t];return i(o)+r(e)+'"'}return n.isCustomAttribute(t)?null==e?"":i(t)+r(e)+'"':null},setValueForProperty:function(t,e,r){if(n.isStandardName[e]){var o=n.getMutationMethod[e];if(o)o(t,r);else if(n.mustUseAttribute[e])n.hasBooleanValue[e]&&!r?t.removeAttribute(n.getAttributeName[e]):t.setAttribute(n.getAttributeName[e],""+r);else{var i=n.getPropertyName[e];n.hasSideEffects[e]&&t[i]===r||(t[i]=r)}}else n.isCustomAttribute(e)&&t.setAttribute(e,""+r)},deleteValueForProperty:function(t,e){if(n.isStandardName[e]){var r=n.getMutationMethod[e];if(r)r(t,void 0);else if(n.mustUseAttribute[e])t.removeAttribute(n.getAttributeName[e]);else{var o=n.getPropertyName[e];t[o]=n.getDefaultValueForProperty(t.nodeName,e)}}else n.isCustomAttribute(e)&&t.removeAttribute(e)}};e.exports=a},{"./DOMProperty":8,"./escapeTextForBrowser":81,"./memoizeStringOnly":102}],10:[function(t,e){"use strict";function n(t){return t.substring(1,t.indexOf(" "))}var r=t("./ExecutionEnvironment"),o=t("./createNodesFromMarkup"),i=t("./emptyFunction"),a=t("./getMarkupWrap"),s=t("./invariant"),u=t("./mutateHTMLNodeWithMarkup"),c=/^(<[^ \/>]+)/,l="data-danger-index",p={dangerouslyRenderMarkup:function(t){s(r.canUseDOM);for(var e,u={},p=0;p<t.length;p++)s(t[p]),e=n(t[p]),e=a(e)?e:"*",u[e]=u[e]||[],u[e][p]=t[p];var d=[],h=0;for(e in u)if(u.hasOwnProperty(e)){var f=u[e];for(var m in f)if(f.hasOwnProperty(m)){var v=f[m];f[m]=v.replace(c,"$1 "+l+'="'+m+'" ')}var g=o(f.join(""),i);for(p=0;p<g.length;++p){var y=g[p];y.hasAttribute&&y.hasAttribute(l)&&(m=+y.getAttribute(l),y.removeAttribute(l),s(!d.hasOwnProperty(m)),d[m]=y,h+=1)}}return s(h===d.length),s(d.length===t.length),d},dangerouslyReplaceNodeWithMarkup:function(t,e){if(s(r.canUseDOM),s(e),"html"===t.tagName.toLowerCase())return u(t,e),void 0;var n=o(e,i)[0];t.parentNode.replaceChild(n,t)}};e.exports=p},{"./ExecutionEnvironment":20,"./createNodesFromMarkup":77,"./emptyFunction":80,"./getMarkupWrap":89,"./invariant":94,"./mutateHTMLNodeWithMarkup":107}],11:[function(t,e){"use strict";var n=t("./DOMProperty"),r=n.injection.MUST_USE_ATTRIBUTE,o=n.injection.MUST_USE_PROPERTY,i=n.injection.HAS_BOOLEAN_VALUE,a=n.injection.HAS_SIDE_EFFECTS,s={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,accessKey:null,action:null,allowFullScreen:r|i,allowTransparency:r,alt:null,autoComplete:null,autoFocus:i,autoPlay:i,cellPadding:null,cellSpacing:null,charSet:r,checked:o|i,className:o,colSpan:null,content:null,contentEditable:null,contextMenu:r,controls:o|i,data:null,dateTime:r,dir:null,disabled:r|i,draggable:null,encType:null,form:r,frameBorder:r,height:r,hidden:r|i,href:null,htmlFor:null,httpEquiv:null,icon:null,id:o,label:null,lang:null,list:null,max:null,maxLength:r,method:null,min:null,multiple:o|i,name:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:o|i,rel:null,required:i,role:r,rowSpan:null,scrollLeft:o,scrollTop:o,selected:o|i,size:null,spellCheck:null,src:null,step:null,style:null,tabIndex:null,target:null,title:null,type:null,value:o|a,width:r,wmode:r,autoCapitalize:null,cx:r,cy:r,d:r,fill:r,fx:r,fy:r,gradientTransform:r,gradientUnits:r,offset:r,points:r,r:r,rx:r,ry:r,spreadMethod:r,stopColor:r,stopOpacity:r,stroke:r,strokeLinecap:r,strokeWidth:r,transform:r,version:r,viewBox:r,x1:r,x2:r,x:r,y1:r,y2:r,y:r},DOMAttributeNames:{className:"class",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",htmlFor:"for",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeLinecap:"stroke-linecap",strokeWidth:"stroke-width",viewBox:"viewBox"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",encType:"enctype",radioGroup:"radiogroup",spellCheck:"spellcheck"},DOMMutationMethods:{className:function(t,e){t.className=e||""}}};e.exports=s},{"./DOMProperty":8}],12:[function(t,e){"use strict";var n=t("./keyOf"),r=[n({ResponderEventPlugin:null}),n({SimpleEventPlugin:null}),n({TapEventPlugin:null}),n({EnterLeaveEventPlugin:null}),n({ChangeEventPlugin:null}),n({SelectEventPlugin:null}),n({CompositionEventPlugin:null}),n({AnalyticsEventPlugin:null}),n({MobileSafariClickEventPlugin:null})];e.exports=r},{"./keyOf":101}],13:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./EventPropagators"),o=t("./SyntheticMouseEvent"),i=t("./ReactMount"),a=t("./keyOf"),s=n.topLevelTypes,u=i.getFirstReactDOM,c={mouseEnter:{registrationName:a({onMouseEnter:null})},mouseLeave:{registrationName:a({onMouseLeave:null})}},l=[null,null],p={eventTypes:c,extractEvents:function(t,e,n,a){if(t===s.topMouseOver&&(a.relatedTarget||a.fromElement))return null;if(t!==s.topMouseOut&&t!==s.topMouseOver)return null;var p,d;if(t===s.topMouseOut?(p=e,d=u(a.relatedTarget||a.toElement)||window):(p=window,d=e),p===d)return null;var h=p?i.getID(p):"",f=d?i.getID(d):"",m=o.getPooled(c.mouseLeave,h,a),v=o.getPooled(c.mouseEnter,f,a);return r.accumulateEnterLeaveDispatches(m,v,h,f),l[0]=m,l[1]=v,l}};e.exports=p},{"./EventConstants":14,"./EventPropagators":19,"./ReactMount":48,"./SyntheticMouseEvent":67,"./keyOf":101}],14:[function(t,e){"use strict";var n=t("./keyMirror"),r=n({bubbled:null,captured:null}),o=n({topBlur:null,topChange:null,topClick:null,topCompositionEnd:null,topCompositionStart:null,topCompositionUpdate:null,topCopy:null,topCut:null,topDoubleClick:null,topDrag:null,topDragEnd:null,topDragEnter:null,topDragExit:null,topDragLeave:null,topDragOver:null,topDragStart:null,topDrop:null,topFocus:null,topInput:null,topKeyDown:null,topKeyPress:null,topKeyUp:null,topMouseDown:null,topMouseMove:null,topMouseOut:null,topMouseOver:null,topMouseUp:null,topPaste:null,topScroll:null,topSelectionChange:null,topSubmit:null,topTouchCancel:null,topTouchEnd:null,topTouchMove:null,topTouchStart:null,topWheel:null}),i={topLevelTypes:o,PropagationPhases:r};e.exports=i},{"./keyMirror":100}],15:[function(t,e){var n={listen:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)},capture:function(t,e,n){t.addEventListener&&t.addEventListener(e,n,!0)}};e.exports=n},{}],16:[function(t,e){"use strict";var n=t("./CallbackRegistry"),r=t("./EventPluginRegistry"),o=t("./EventPluginUtils"),i=t("./EventPropagators"),a=t("./ExecutionEnvironment"),s=t("./accumulate"),u=t("./forEachAccumulated"),c=t("./invariant"),l=null,p=function(t){if(t){var e=o.executeDispatch,n=r.getPluginModuleForEvent(t);n&&n.executeDispatch&&(e=n.executeDispatch),o.executeDispatchesInOrder(t,e),t.isPersistent()||t.constructor.release(t)}},d={injection:{injectInstanceHandle:i.injection.injectInstanceHandle,injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},registrationNames:r.registrationNames,putListener:n.putListener,getListener:n.getListener,deleteListener:n.deleteListener,deleteAllListeners:n.deleteAllListeners,extractEvents:function(t,e,n,o){for(var i,a=r.plugins,u=0,c=a.length;c>u;u++){var l=a[u];if(l){var p=l.extractEvents(t,e,n,o);p&&(i=s(i,p))}}return i},enqueueEvents:function(t){t&&(l=s(l,t))},processEventQueue:function(){var t=l;l=null,u(t,p),c(!l)}};a.canUseDOM&&(window.EventPluginHub=d),e.exports=d},{"./CallbackRegistry":4,"./EventPluginRegistry":17,"./EventPluginUtils":18,"./EventPropagators":19,"./ExecutionEnvironment":20,"./accumulate":73,"./forEachAccumulated":85,"./invariant":94}],17:[function(t,e){"use strict";function n(){if(a)for(var t in s){var e=s[t],n=a.indexOf(t);if(i(n>-1),!u.plugins[n]){i(e.extractEvents),u.plugins[n]=e;var o=e.eventTypes;for(var c in o)i(r(o[c],e))}}}function r(t,e){var n=t.phasedRegistrationNames;if(n){for(var r in n)if(n.hasOwnProperty(r)){var i=n[r];o(i,e)}return!0}return t.registrationName?(o(t.registrationName,e),!0):!1}function o(t,e){i(!u.registrationNames[t]),u.registrationNames[t]=e,u.registrationNamesKeys.push(t)}var i=t("./invariant"),a=null,s={},u={plugins:[],registrationNames:{},registrationNamesKeys:[],injectEventPluginOrder:function(t){i(!a),a=Array.prototype.slice.call(t),n()},injectEventPluginsByName:function(t){var e=!1;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];s[r]!==o&&(i(!s[r]),s[r]=o,e=!0)}e&&n()},getPluginModuleForEvent:function(t){var e=t.dispatchConfig;if(e.registrationName)return u.registrationNames[e.registrationName]||null;for(var n in e.phasedRegistrationNames)if(e.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNames[e.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var t in s)s.hasOwnProperty(t)&&delete s[t];u.plugins.length=0;var e=u.registrationNames;for(var n in e)e.hasOwnProperty(n)&&delete e[n];u.registrationNamesKeys.length=0}};e.exports=u},{"./invariant":94}],18:[function(t,e){"use strict";function n(t){return t===h.topMouseUp||t===h.topTouchEnd||t===h.topTouchCancel}function r(t){return t===h.topMouseMove||t===h.topTouchMove}function o(t){return t===h.topMouseDown||t===h.topTouchStart}function i(t,e){var n=t._dispatchListeners,r=t._dispatchIDs;if(Array.isArray(n))for(var o=0;o<n.length&&!t.isPropagationStopped();o++)e(t,n[o],r[o]);else n&&e(t,n,r)}function a(t,e,n){e(t,n)}function s(t,e){i(t,e),t._dispatchListeners=null,t._dispatchIDs=null}function u(t){var e=t._dispatchListeners,n=t._dispatchIDs;if(Array.isArray(e)){for(var r=0;r<e.length&&!t.isPropagationStopped();r++)if(e[r](t,n[r]))return n[r]}else if(e&&e(t,n))return n;return null}function c(t){var e=t._dispatchListeners,n=t._dispatchIDs;d(!Array.isArray(e));var r=e?e(t,n):null;return t._dispatchListeners=null,t._dispatchIDs=null,r}function l(t){return!!t._dispatchListeners}var p=t("./EventConstants"),d=t("./invariant"),h=p.topLevelTypes,f={isEndish:n,isMoveish:r,isStartish:o,executeDispatchesInOrder:s,executeDispatchesInOrderStopAtTrue:u,executeDirectDispatch:c,hasDispatches:l,executeDispatch:a};e.exports=f},{"./EventConstants":14,"./invariant":94}],19:[function(t,e){"use strict";function n(t,e,n){var r=e.dispatchConfig.phasedRegistrationNames[n];return f(t,r)}function r(t,e,r){var o=e?m.bubbled:m.captured,i=n(t,r,o);i&&(r._dispatchListeners=d(r._dispatchListeners,i),r._dispatchIDs=d(r._dispatchIDs,t))}function o(t){t&&t.dispatchConfig.phasedRegistrationNames&&v.InstanceHandle.traverseTwoPhase(t.dispatchMarker,r,t)}function i(t,e,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,o=f(t,r);o&&(n._dispatchListeners=d(n._dispatchListeners,o),n._dispatchIDs=d(n._dispatchIDs,t))}}function a(t){t&&t.dispatchConfig.registrationName&&i(t.dispatchMarker,null,t)}function s(t){h(t,o)}function u(t,e,n,r){v.InstanceHandle.traverseEnterLeave(n,r,i,t,e)}function c(t){h(t,a)}var l=t("./CallbackRegistry"),p=t("./EventConstants"),d=t("./accumulate"),h=t("./forEachAccumulated"),f=l.getListener,m=p.PropagationPhases,v={InstanceHandle:null,injectInstanceHandle:function(t){v.InstanceHandle=t},validate:function(){var t=!v.InstanceHandle||!v.InstanceHandle.traverseTwoPhase||!v.InstanceHandle.traverseEnterLeave;if(t)throw new Error("InstanceHandle not injected before use!")}},g={accumulateTwoPhaseDispatches:s,accumulateDirectDispatches:c,accumulateEnterLeaveDispatches:u,injection:v};e.exports=g},{"./CallbackRegistry":4,"./EventConstants":14,"./accumulate":73,"./forEachAccumulated":85}],20:[function(t,e){"use strict";var n="undefined"!=typeof window,r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,isInWorker:!n};e.exports=r},{}],21:[function(t,e){"use strict";var n=t("./invariant"),r={_assertLink:function(){n(null==this.props.value&&null==this.props.onChange)},getValue:function(){return this.props.valueLink?(this._assertLink(),this.props.valueLink.value):this.props.value},getOnChange:function(){return this.props.valueLink?(this._assertLink(),this._handleLinkedValueChange):this.props.onChange},_handleLinkedValueChange:function(t){this.props.valueLink.requestChange(t.target.value)}};e.exports=r},{"./invariant":94}],22:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./emptyFunction"),o=n.topLevelTypes,i={eventTypes:null,extractEvents:function(t,e,n,i){if(t===o.topTouchStart){var a=i.target;a&&!a.onclick&&(a.onclick=r)}}};e.exports=i},{"./EventConstants":14,"./emptyFunction":80}],23:[function(t,e){"use strict";var n=function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)},r=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},o=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},i=function(t,e,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,t,e,n,r,o),a}return new i(t,e,n,r,o)},a=function(t){var e=this;t.destructor&&t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},s=10,u=n,c=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||u,n.poolSize||(n.poolSize=s),n.release=a,n},l={addPoolingTo:c,oneArgumentPooler:n,twoArgumentPooler:r,threeArgumentPooler:o,fiveArgumentPooler:i};e.exports=l},{}],24:[function(t,e){"use strict";var n=t("./ReactComponent"),r=t("./ReactCompositeComponent"),o=t("./ReactCurrentOwner"),i=t("./ReactDOM"),a=t("./ReactDOMComponent"),s=t("./ReactDefaultInjection"),u=t("./ReactInstanceHandles"),c=t("./ReactMount"),l=t("./ReactMultiChild"),p=t("./ReactPerf"),d=t("./ReactPropTypes"),h=t("./ReactServerRendering"),f=t("./ReactTextComponent");s.inject();var m={DOM:i,PropTypes:d,initializeTouchEvents:function(t){c.useTouchEvents=t},createClass:r.createClass,constructAndRenderComponent:c.constructAndRenderComponent,constructAndRenderComponentByID:c.constructAndRenderComponentByID,renderComponent:p.measure("React","renderComponent",c.renderComponent),renderComponentToString:h.renderComponentToString,unmountComponentAtNode:c.unmountComponentAtNode,unmountAndReleaseReactRootNode:c.unmountAndReleaseReactRootNode,isValidClass:r.isValidClass,isValidComponent:n.isValidComponent,__internals:{Component:n,CurrentOwner:o,DOMComponent:a,InstanceHandles:u,Mount:c,MultiChild:l,TextComponent:f}};m.version="0.5.1",e.exports=m},{"./ReactComponent":25,"./ReactCompositeComponent":28,"./ReactCurrentOwner":29,"./ReactDOM":30,"./ReactDOMComponent":32,"./ReactDefaultInjection":41,"./ReactInstanceHandles":46,"./ReactMount":48,"./ReactMultiChild":50,"./ReactPerf":53,"./ReactPropTypes":55,"./ReactServerRendering":57,"./ReactTextComponent":58}],25:[function(t,e){"use strict";var n=t("./ReactComponentEnvironment"),r=t("./ReactCurrentOwner"),o=t("./ReactOwner"),i=t("./ReactUpdates"),a=t("./invariant"),s=t("./keyMirror"),u=t("./merge"),c=s({MOUNTED:null,UNMOUNTED:null}),l={isValidComponent:function(t){return!(!t||"function"!=typeof t.mountComponentIntoNode||"function"!=typeof t.receiveProps)},getKey:function(t,e){return t&&t.props&&null!=t.props.key?"{"+t.props.key+"}":"["+e+"]"},LifeCycle:c,DOMIDOperations:n.DOMIDOperations,unmountIDFromEnvironment:n.unmountIDFromEnvironment,mountImageIntoNode:n.mountImageIntoNode,ReactReconcileTransaction:n.ReactReconcileTransaction,Mixin:u(n.Mixin,{isMounted:function(){return this._lifeCycleState===c.MOUNTED},setProps:function(t,e){this.replaceProps(u(this._pendingProps||this.props,t),e)},replaceProps:function(t,e){a(!this.props.__owner__),a(this.isMounted()),this._pendingProps=t,i.enqueueUpdate(this,e)},construct:function(t,e){this.props=t||{},this.props.__owner__=r.current,this._lifeCycleState=c.UNMOUNTED,this._pendingProps=null,this._pendingCallbacks=null;var n=arguments.length-1;if(1===n)this.props.children=e;else if(n>1){for(var o=Array(n),i=0;n>i;i++)o[i]=arguments[i+1];this.props.children=o}},mountComponent:function(t,e,n){a(!this.isMounted());var r=this.props;null!=r.ref&&o.addComponentAsRefTo(this,r.ref,r.__owner__),this._rootNodeID=t,this._lifeCycleState=c.MOUNTED,this._mountDepth=n},unmountComponent:function(){a(this.isMounted());var t=this.props;null!=t.ref&&o.removeComponentAsRefFrom(this,t.ref,t.__owner__),l.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=c.UNMOUNTED},receiveProps:function(t,e){a(this.isMounted()),this._pendingProps=t,this._performUpdateIfNecessary(e)},performUpdateIfNecessary:function(){var t=l.ReactReconcileTransaction.getPooled();t.perform(this._performUpdateIfNecessary,this,t),l.ReactReconcileTransaction.release(t)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps){var e=this.props;this.props=this._pendingProps,this._pendingProps=null,this.updateComponent(t,e)}},updateComponent:function(t,e){var n=this.props;(n.__owner__!==e.__owner__||n.ref!==e.ref)&&(null!=e.ref&&o.removeComponentAsRefFrom(this,e.ref,e.__owner__),null!=n.ref&&o.addComponentAsRefTo(this,n.ref,n.__owner__))},mountComponentIntoNode:function(t,e,n){var r=l.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,t,e,r,n),l.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(t,e,n,r){var o=this.mountComponent(t,n,0);l.mountImageIntoNode(o,e,r)},isOwnedBy:function(t){return this.props.__owner__===t},getSiblingByRef:function(t){var e=this.props.__owner__;return e&&e.refs?e.refs[t]:null}})};e.exports=l},{"./ReactComponentEnvironment":27,"./ReactCurrentOwner":29,"./ReactOwner":52,"./ReactUpdates":59,"./invariant":94,"./keyMirror":100,"./merge":103}],26:[function(t,e){"use strict";var n=t("./ReactDOMIDOperations"),r=t("./ReactMarkupChecksum"),o=t("./ReactMount"),i=t("./ReactReconcileTransaction"),a=t("./getReactRootElementInContainer"),s=t("./invariant"),u=t("./mutateHTMLNodeWithMarkup"),c=1,l=9,p={Mixin:{getDOMNode:function(){return s(this.isMounted()),o.getNode(this._rootNodeID)}},ReactReconcileTransaction:i,DOMIDOperations:n,unmountIDFromEnvironment:function(t){o.purgeID(t)},mountImageIntoNode:function(t,e,n){if(s(e&&(e.nodeType===c||e.nodeType===l&&o.allowFullPageRender)),!n||!r.canReuseMarkup(t,a(e))){if(e.nodeType===l)return u(e.documentElement,t),void 0;var i=e.parentNode;if(i){var p=e.nextSibling;i.removeChild(e),e.innerHTML=t,p?i.insertBefore(e,p):i.appendChild(e)}else e.innerHTML=t}}};e.exports=p},{"./ReactDOMIDOperations":34,"./ReactMarkupChecksum":47,"./ReactMount":48,"./ReactReconcileTransaction":56,"./getReactRootElementInContainer":91,"./invariant":94,"./mutateHTMLNodeWithMarkup":107}],27:[function(t,e){var n=t("./ReactComponentBrowserEnvironment"),r=n;e.exports=r},{"./ReactComponentBrowserEnvironment":26}],28:[function(t,e){"use strict";function n(t,e){var n=E[e];D.hasOwnProperty(e)&&f(n===C.OVERRIDE_BASE),t.hasOwnProperty(e)&&f(n===C.DEFINE_MANY||n===C.DEFINE_MANY_MERGED)}function r(t){var e=t._compositeLifeCycleState;f(t.isMounted()||e===R.MOUNTING),f(e!==R.RECEIVING_STATE&&e!==R.UNMOUNTING)}function o(t,e){var r=t.prototype;for(var o in e){var i=e[o];if(e.hasOwnProperty(o)&&i)if(n(r,o),M.hasOwnProperty(o))M[o](t,i);else{var u=o in E,c=o in r,l=i.__reactDontBind,p="function"==typeof i,d=p&&!u&&!c&&!l;d?(r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[o]=i,r[o]=i):r[o]=c?E[o]===C.DEFINE_MANY_MERGED?a(r[o],i):s(r[o],i):i}}}function i(t,e){return f(t&&e&&"object"==typeof t&&"object"==typeof e),y(e,function(e,n){f(void 0===t[n]),t[n]=e}),t}function a(t,e){return function(){return i(t.apply(this,arguments),e.apply(this,arguments))}}function s(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}var u=t("./ReactComponent"),c=t("./ReactCurrentOwner"),l=t("./ReactOwner"),p=t("./ReactPerf"),d=t("./ReactPropTransferer"),h=t("./ReactUpdates"),f=t("./invariant"),m=t("./keyMirror"),v=t("./merge"),g=t("./mixInto"),y=t("./objMap"),C=m({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),E={mixins:C.DEFINE_MANY,propTypes:C.DEFINE_ONCE,getDefaultProps:C.DEFINE_MANY_MERGED,getInitialState:C.DEFINE_MANY_MERGED,render:C.DEFINE_ONCE,componentWillMount:C.DEFINE_MANY,componentDidMount:C.DEFINE_MANY,componentWillReceiveProps:C.DEFINE_MANY,shouldComponentUpdate:C.DEFINE_ONCE,componentWillUpdate:C.DEFINE_MANY,componentDidUpdate:C.DEFINE_MANY,componentWillUnmount:C.DEFINE_MANY,updateComponent:C.OVERRIDE_BASE},M={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)o(t,e[n])},propTypes:function(t,e){t.propTypes=e}},R=m({MOUNTING:null,UNMOUNTING:null,RECEIVING_PROPS:null,RECEIVING_STATE:null}),D={construct:function(){u.Mixin.construct.apply(this,arguments),this.state=null,this._pendingState=null,this._compositeLifeCycleState=null},isMounted:function(){return u.Mixin.isMounted.call(this)&&this._compositeLifeCycleState!==R.MOUNTING},mountComponent:p.measure("ReactCompositeComponent","mountComponent",function(t,e,n){u.Mixin.mountComponent.call(this,t,e,n),this._compositeLifeCycleState=R.MOUNTING,this._defaultProps=this.getDefaultProps?this.getDefaultProps():null,this._processProps(this.props),this.__reactAutoBindMap&&this._bindAutoBindMethods(),this.state=this.getInitialState?this.getInitialState():null,this._pendingState=null,this._pendingForceUpdate=!1,this.componentWillMount&&(this.componentWillMount(),this._pendingState&&(this.state=this._pendingState,this._pendingState=null)),this._renderedComponent=this._renderValidatedComponent(),this._compositeLifeCycleState=null;var r=this._renderedComponent.mountComponent(t,e,n+1);return this.componentDidMount&&e.getReactMountReady().enqueue(this,this.componentDidMount),r}),unmountComponent:function(){this._compositeLifeCycleState=R.UNMOUNTING,this.componentWillUnmount&&this.componentWillUnmount(),this._compositeLifeCycleState=null,this._defaultProps=null,u.Mixin.unmountComponent.call(this),this._renderedComponent.unmountComponent(),this._renderedComponent=null,this.refs&&(this.refs=null)},setState:function(t,e){this.replaceState(v(this._pendingState||this.state,t),e)},replaceState:function(t,e){r(this),this._pendingState=t,h.enqueueUpdate(this,e)},_processProps:function(t){var e,n=this._defaultProps;for(e in n)e in t||(t[e]=n[e]);var r=this.constructor.propTypes;if(r){var o=this.constructor.displayName;for(e in r){var i=r[e];i&&i(t,e,o)}}},performUpdateIfNecessary:function(){var t=this._compositeLifeCycleState;t!==R.MOUNTING&&t!==R.RECEIVING_PROPS&&u.Mixin.performUpdateIfNecessary.call(this)},_performUpdateIfNecessary:function(t){if(null!=this._pendingProps||null!=this._pendingState||this._pendingForceUpdate){var e=this.props;null!=this._pendingProps&&(e=this._pendingProps,this._processProps(e),this._pendingProps=null,this._compositeLifeCycleState=R.RECEIVING_PROPS,this.componentWillReceiveProps&&this.componentWillReceiveProps(e,t)),this._compositeLifeCycleState=R.RECEIVING_STATE;
var n=this._pendingState||this.state;this._pendingState=null,this._pendingForceUpdate||!this.shouldComponentUpdate||this.shouldComponentUpdate(e,n)?(this._pendingForceUpdate=!1,this._performComponentUpdate(e,n,t)):(this.props=e,this.state=n),this._compositeLifeCycleState=null}},_performComponentUpdate:function(t,e,n){var r=this.props,o=this.state;this.componentWillUpdate&&this.componentWillUpdate(t,e,n),this.props=t,this.state=e,this.updateComponent(n,r,o),this.componentDidUpdate&&n.getReactMountReady().enqueue(this,this.componentDidUpdate.bind(this,r,o))},updateComponent:p.measure("ReactCompositeComponent","updateComponent",function(t,e){u.Mixin.updateComponent.call(this,t,e);var n=this._renderedComponent,r=this._renderValidatedComponent();if(n.constructor===r.constructor)n.receiveProps(r.props,t);else{var o=this._rootNodeID,i=n._rootNodeID;n.unmountComponent(),this._renderedComponent=r;var a=r.mountComponent(o,t,this._mountDepth+1);u.DOMIDOperations.dangerouslyReplaceNodeWithMarkupByID(i,a)}}),forceUpdate:function(t){var e=this._compositeLifeCycleState;f(this.isMounted()||e===R.MOUNTING),f(e!==R.RECEIVING_STATE&&e!==R.UNMOUNTING),this._pendingForceUpdate=!0,h.enqueueUpdate(this,t)},_renderValidatedComponent:function(){var t;c.current=this;try{t=this.render()}catch(e){throw e}finally{c.current=null}return f(u.isValidComponent(t)),t},_bindAutoBindMethods:function(){for(var t in this.__reactAutoBindMap)if(this.__reactAutoBindMap.hasOwnProperty(t)){var e=this.__reactAutoBindMap[t];this[t]=this._bindAutoBindMethod(e)}},_bindAutoBindMethod:function(t){var e=this,n=function(){return t.apply(e,arguments)};return n}},b=function(){};g(b,u.Mixin),g(b,l.Mixin),g(b,d.Mixin),g(b,D);var N={LifeCycle:R,Base:b,createClass:function(t){var e=function(){};e.prototype=new b,e.prototype.constructor=e,o(e,t),f(e.prototype.render);for(var n in E)e.prototype[n]||(e.prototype[n]=null);var r=function(){var t=new e;return t.construct.apply(t,arguments),t};return r.componentConstructor=e,r.originalSpec=t,r},isValidClass:function(t){return t instanceof Function&&"componentConstructor"in t&&t.componentConstructor instanceof Function}};e.exports=N},{"./ReactComponent":25,"./ReactCurrentOwner":29,"./ReactOwner":52,"./ReactPerf":53,"./ReactPropTransferer":54,"./ReactUpdates":59,"./invariant":94,"./keyMirror":100,"./merge":103,"./mixInto":106,"./objMap":109}],29:[function(t,e){"use strict";var n={current:null};e.exports=n},{}],30:[function(t,e){"use strict";function n(t,e){var n=function(){};n.prototype=new r(t,e),n.prototype.constructor=n,n.displayName=t;var o=function(){var t=new n;return t.construct.apply(t,arguments),t};return o.componentConstructor=n,o}var r=t("./ReactDOMComponent"),o=t("./mergeInto"),i=t("./objMapKeyVal"),a=i({a:!1,abbr:!1,address:!1,area:!1,article:!1,aside:!1,audio:!1,b:!1,base:!1,bdi:!1,bdo:!1,big:!1,blockquote:!1,body:!1,br:!0,button:!1,canvas:!1,caption:!1,cite:!1,code:!1,col:!0,colgroup:!1,data:!1,datalist:!1,dd:!1,del:!1,details:!1,dfn:!1,div:!1,dl:!1,dt:!1,em:!1,embed:!0,fieldset:!1,figcaption:!1,figure:!1,footer:!1,form:!1,h1:!1,h2:!1,h3:!1,h4:!1,h5:!1,h6:!1,head:!1,header:!1,hr:!0,html:!1,i:!1,iframe:!1,img:!0,input:!0,ins:!1,kbd:!1,keygen:!0,label:!1,legend:!1,li:!1,link:!1,main:!1,map:!1,mark:!1,menu:!1,menuitem:!1,meta:!0,meter:!1,nav:!1,noscript:!1,object:!1,ol:!1,optgroup:!1,option:!1,output:!1,p:!1,param:!0,pre:!1,progress:!1,q:!1,rp:!1,rt:!1,ruby:!1,s:!1,samp:!1,script:!1,section:!1,select:!1,small:!1,source:!1,span:!1,strong:!1,style:!1,sub:!1,summary:!1,sup:!1,table:!1,tbody:!1,td:!1,textarea:!1,tfoot:!1,th:!1,thead:!1,time:!1,title:!1,tr:!1,track:!0,u:!1,ul:!1,"var":!1,video:!1,wbr:!1,circle:!1,g:!1,line:!1,path:!1,polyline:!1,rect:!1,svg:!1,text:!1},n),s={injectComponentClasses:function(t){o(a,t)}};a.injection=s,e.exports=a},{"./ReactDOMComponent":32,"./mergeInto":105,"./objMapKeyVal":110}],31:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=t("./keyMirror"),i=r.button,a=o({onClick:!0,onDoubleClick:!0,onMouseDown:!0,onMouseMove:!0,onMouseUp:!0,onClickCapture:!0,onDoubleClickCapture:!0,onMouseDownCapture:!0,onMouseMoveCapture:!0,onMouseUpCapture:!0}),s=n.createClass({render:function(){var t={};for(var e in this.props)!this.props.hasOwnProperty(e)||this.props.disabled&&a[e]||(t[e]=this.props[e]);return i(t,this.props.children)}});e.exports=s},{"./ReactCompositeComponent":28,"./ReactDOM":30,"./keyMirror":100}],32:[function(t,e){"use strict";function n(t){t&&(h(null==t.children||null==t.dangerouslySetInnerHTML),h(null==t.style||"object"==typeof t.style))}function r(t,e){this._tagOpen="<"+t,this._tagClose=e?"":"</"+t+">",this.tagName=t.toUpperCase()}var o=t("./CSSPropertyOperations"),i=t("./DOMProperty"),a=t("./DOMPropertyOperations"),s=t("./ReactComponent"),u=t("./ReactEventEmitter"),c=t("./ReactMultiChild"),l=t("./ReactMount"),p=t("./ReactPerf"),d=t("./escapeTextForBrowser"),h=t("./invariant"),f=t("./keyOf"),m=t("./merge"),v=t("./mixInto"),g=u.putListener,y=u.deleteListener,C=u.registrationNames,E={string:!0,number:!0},M=f({style:null});r.Mixin={mountComponent:p.measure("ReactDOMComponent","mountComponent",function(t,e,r){return s.Mixin.mountComponent.call(this,t,e,r),n(this.props),this._createOpenTagMarkup()+this._createContentMarkup(e)+this._tagClose}),_createOpenTagMarkup:function(){var t=this.props,e=this._tagOpen;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(null!=r)if(C[n])g(this._rootNodeID,n,r);else{n===M&&(r&&(r=t.style=m(t.style)),r=o.createMarkupForStyles(r));var i=a.createMarkupForProperty(n,r);i&&(e+=" "+i)}}var s=d(this._rootNodeID);return e+" "+l.ATTR_NAME+'="'+s+'">'},_createContentMarkup:function(t){var e=this.props.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html)return e.__html}else{var n=E[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return d(n);if(null!=r){var o=this.mountChildren(r,t);return o.join("")}}return""},receiveProps:function(t,e){n(t),s.Mixin.receiveProps.call(this,t,e)},updateComponent:p.measure("ReactDOMComponent","updateComponent",function(t,e){s.Mixin.updateComponent.call(this,t,e),this._updateDOMProperties(e),this._updateDOMChildren(e,t)}),_updateDOMProperties:function(t){var e,n,r,o=this.props;for(e in t)if(!o.hasOwnProperty(e)&&t.hasOwnProperty(e))if(e===M){var a=t[e];for(n in a)a.hasOwnProperty(n)&&(r=r||{},r[n]="")}else C[e]?y(this._rootNodeID,e):(i.isStandardName[e]||i.isCustomAttribute(e))&&s.DOMIDOperations.deletePropertyByID(this._rootNodeID,e);for(e in o){var u=o[e],c=t[e];if(o.hasOwnProperty(e)&&u!==c)if(e===M)if(u&&(u=o.style=m(u)),c){for(n in c)c.hasOwnProperty(n)&&!u.hasOwnProperty(n)&&(r=r||{},r[n]="");for(n in u)u.hasOwnProperty(n)&&c[n]!==u[n]&&(r=r||{},r[n]=u[n])}else r=u;else C[e]?g(this._rootNodeID,e,u):(i.isStandardName[e]||i.isCustomAttribute(e))&&s.DOMIDOperations.updatePropertyByID(this._rootNodeID,e,u)}r&&s.DOMIDOperations.updateStylesByID(this._rootNodeID,r)},_updateDOMChildren:function(t,e){var n=this.props,r=E[typeof t.children]?t.children:null,o=E[typeof n.children]?n.children:null,i=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,a=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,u=null!=r?null:t.children,c=null!=o?null:n.children,l=null!=r||null!=i,p=null!=o||null!=a;null!=u&&null==c?this.updateChildren(null,e):l&&!p&&this.updateTextContent(""),null!=o?r!==o&&this.updateTextContent(""+o):null!=a?i!==a&&s.DOMIDOperations.updateInnerHTMLByID(this._rootNodeID,a):null!=c&&this.updateChildren(c,e)},unmountComponent:function(){u.deleteAllListeners(this._rootNodeID),s.Mixin.unmountComponent.call(this),this.unmountChildren()}},v(r,s.Mixin),v(r,r.Mixin),v(r,c.Mixin),e.exports=r},{"./CSSPropertyOperations":3,"./DOMProperty":8,"./DOMPropertyOperations":9,"./ReactComponent":25,"./ReactEventEmitter":42,"./ReactMount":48,"./ReactMultiChild":50,"./ReactPerf":53,"./escapeTextForBrowser":81,"./invariant":94,"./keyOf":101,"./merge":103,"./mixInto":106}],33:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=t("./ReactEventEmitter"),i=t("./EventConstants"),a=r.form,s=n.createClass({render:function(){return this.transferPropsTo(a(null,this.props.children))},componentDidMount:function(t){o.trapBubbledEvent(i.topLevelTypes.topSubmit,"submit",t)}});e.exports=s},{"./EventConstants":14,"./ReactCompositeComponent":28,"./ReactDOM":30,"./ReactEventEmitter":42}],34:[function(t,e){"use strict";var n=t("./CSSPropertyOperations"),r=t("./DOMChildrenOperations"),o=t("./DOMPropertyOperations"),i=t("./ReactMount"),a=t("./getTextContentAccessor"),s=t("./invariant"),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c=a()||"NA",l=/^ /,p={updatePropertyByID:function(t,e,n){var r=i.getNode(t);s(!u.hasOwnProperty(e)),null!=n?o.setValueForProperty(r,e,n):o.deleteValueForProperty(r,e)},deletePropertyByID:function(t,e,n){var r=i.getNode(t);s(!u.hasOwnProperty(e)),o.deleteValueForProperty(r,e,n)},updatePropertiesByID:function(t,e){for(var n in e)e.hasOwnProperty(n)&&p.updatePropertiesByID(t,n,e[n])},updateStylesByID:function(t,e){var r=i.getNode(t);n.setValueForStyles(r,e)},updateInnerHTMLByID:function(t,e){var n=i.getNode(t);n.innerHTML=e.replace(l," ")},updateTextContentByID:function(t,e){var n=i.getNode(t);n[c]=e},dangerouslyReplaceNodeWithMarkupByID:function(t,e){var n=i.getNode(t);r.dangerouslyReplaceNodeWithMarkup(n,e)},dangerouslyProcessChildrenUpdates:function(t,e){for(var n=0;n<t.length;n++)t[n].parentNode=i.getNode(t[n].parentID);r.processUpdates(t,e)}};e.exports=p},{"./CSSPropertyOperations":3,"./DOMChildrenOperations":7,"./DOMPropertyOperations":9,"./ReactMount":48,"./getTextContentAccessor":92,"./invariant":94}],35:[function(t,e){"use strict";var n=t("./DOMPropertyOperations"),r=t("./LinkedValueMixin"),o=t("./ReactCompositeComponent"),i=t("./ReactDOM"),a=t("./ReactMount"),s=t("./invariant"),u=t("./merge"),c=i.input,l={},p=o.createClass({mixins:[r],getInitialState:function(){var t=this.props.defaultValue;return{checked:this.props.defaultChecked||!1,value:null!=t?t:""}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=u(this.props);t.defaultChecked=null,t.defaultValue=null,t.checked=null!=this.props.checked?this.props.checked:this.state.checked;var e=this.getValue();return t.value=null!=e?e:this.state.value,t.onChange=this._handleChange,c(t,this.props.children)},componentDidMount:function(t){var e=a.getID(t);l[e]=this},componentWillUnmount:function(){var t=this.getDOMNode(),e=a.getID(t);delete l[e]},componentDidUpdate:function(t,e,r){null!=this.props.checked&&n.setValueForProperty(r,"checked",this.props.checked||!1);var o=this.getValue();null!=o&&n.setValueForProperty(r,"value",""+o)},_handleChange:function(t){var e,n=this.getOnChange();n&&(this._isChanging=!0,e=n(t),this._isChanging=!1),this.setState({checked:t.target.checked,value:t.target.value});var r=this.props.name;if("radio"===this.props.type&&null!=r)for(var o=this.getDOMNode(),i=document.getElementsByName(r),u=0,c=i.length;c>u;u++){var p=i[u];if(p!==o&&"INPUT"===p.nodeName&&"radio"===p.type&&p.form===o.form){var d=a.getID(p);s(d);var h=l[d];s(h),h.setState({checked:!1})}}return e}});e.exports=p},{"./DOMPropertyOperations":9,"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./ReactMount":48,"./invariant":94,"./merge":103}],36:[function(t,e){"use strict";var n=t("./ReactCompositeComponent"),r=t("./ReactDOM"),o=r.option,i=n.createClass({componentWillMount:function(){null!=this.props.selected},render:function(){return o(this.props,this.props.children)}});e.exports=i},{"./ReactCompositeComponent":28,"./ReactDOM":30}],37:[function(t,e){"use strict";function n(t,e){null!=t[e]&&(t.multiple?s(Array.isArray(t[e])):s(!Array.isArray(t[e])))}function r(){for(var t=this.getValue(),e=null!=t?t:this.state.value,n=this.getDOMNode().options,r=""+e,o=0,i=n.length;i>o;o++){var a=this.props.multiple?r.indexOf(n[o].value)>=0:a=n[o].value===r;a!==n[o].selected&&(n[o].selected=a)}}var o=t("./LinkedValueMixin"),i=t("./ReactCompositeComponent"),a=t("./ReactDOM"),s=t("./invariant"),u=t("./merge"),c=a.select,l=i.createClass({mixins:[o],propTypes:{defaultValue:n,value:n},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillReceiveProps:function(t){!this.props.multiple&&t.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!t.multiple&&this.setState({value:this.state.value[0]})},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=u(this.props);return t.onChange=this._handleChange,t.value=null,c(t,this.props.children)},componentDidMount:r,componentDidUpdate:r,_handleChange:function(t){var e,n=this.getOnChange();n&&(this._isChanging=!0,e=n(t),this._isChanging=!1);var r;if(this.props.multiple){r=[];for(var o=t.target.options,i=0,a=o.length;a>i;i++)o[i].selected&&r.push(o[i].value)}else r=t.target.value;return this.setState({value:r}),e}});e.exports=l},{"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./invariant":94,"./merge":103}],38:[function(t,e){"use strict";function n(t){var e=document.selection,n=e.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(t),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function r(t){var e=window.getSelection();if(0===e.rangeCount)return null;var n=e.anchorNode,r=e.anchorOffset,o=e.focusNode,i=e.focusOffset,a=e.getRangeAt(0),s=a.toString().length,u=a.cloneRange();u.selectNodeContents(t),u.setEnd(a.startContainer,a.startOffset);var c=u.toString().length,l=c+s,p=document.createRange();p.setStart(n,r),p.setEnd(o,i);var d=p.collapsed;return p.detach(),{start:d?l:c,end:d?c:l}}function o(t,e){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof e.end?(n=e.start,r=n):e.start>e.end?(n=e.end,r=e.start):(n=e.start,r=e.end),o.moveToElementText(t),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function i(t,e){var n=window.getSelection(),r=t[s()].length,o=Math.min(e.start,r),i="undefined"==typeof e.end?o:Math.min(e.end,r),u=a(t,o),c=a(t,i);if(u&&c){var l=document.createRange();l.setStart(u.node,u.offset),n.removeAllRanges(),n.addRange(l),n.extend(c.node,c.offset),l.detach()}}var a=t("./getNodeForCharacterOffset"),s=t("./getTextContentAccessor"),u={getOffsets:function(t){var e=document.selection?n:r;return e(t)},setOffsets:function(t,e){var n=document.selection?o:i;n(t,e)}};e.exports=u},{"./getNodeForCharacterOffset":90,"./getTextContentAccessor":92}],39:[function(t,e){"use strict";var n=t("./DOMPropertyOperations"),r=t("./LinkedValueMixin"),o=t("./ReactCompositeComponent"),i=t("./ReactDOM"),a=t("./invariant"),s=t("./merge"),u=i.textarea,c=o.createClass({mixins:[r],getInitialState:function(){var t=this.props.defaultValue,e=this.props.children;null!=e&&(a(null==t),Array.isArray(e)&&(a(e.length<=1),e=e[0]),t=""+e),null==t&&(t="");var n=this.getValue();return{initialValue:""+(null!=n?n:t),value:t}},shouldComponentUpdate:function(){return!this._isChanging},render:function(){var t=s(this.props),e=this.getValue();return a(null==t.dangerouslySetInnerHTML),t.defaultValue=null,t.value=null!=e?e:this.state.value,t.onChange=this._handleChange,u(t,this.state.initialValue)},componentDidUpdate:function(t,e,r){var o=this.getValue();null!=o&&n.setValueForProperty(r,"value",""+o)},_handleChange:function(t){var e,n=this.getOnChange();return n&&(this._isChanging=!0,e=n(t),this._isChanging=!1),this.setState({value:t.target.value}),e}});e.exports=c},{"./DOMPropertyOperations":9,"./LinkedValueMixin":21,"./ReactCompositeComponent":28,"./ReactDOM":30,"./invariant":94,"./merge":103}],40:[function(t,e){"use strict";function n(){this.reinitializeTransaction()}var r=t("./ReactUpdates"),o=t("./Transaction"),i=t("./emptyFunction"),a=t("./mixInto"),s={initialize:i,close:function(){p.isBatchingUpdates=!1}},u={initialize:i,close:r.flushBatchedUpdates.bind(r)},c=[u,s];a(n,o.Mixin),a(n,{getTransactionWrappers:function(){return c}});var l=new n,p={isBatchingUpdates:!1,batchedUpdates:function(t,e){var n=p.isBatchingUpdates;p.isBatchingUpdates=!0,n?t(e):l.perform(t,null,e)}};e.exports=p},{"./ReactUpdates":59,"./Transaction":71,"./emptyFunction":80,"./mixInto":106}],41:[function(t,e){"use strict";function n(){l.TopLevelCallbackCreator=p,y.injection.injectEventPluginOrder(v),y.injection.injectInstanceHandle(E),y.injection.injectEventPluginsByName({SimpleEventPlugin:R,EnterLeaveEventPlugin:g,ChangeEventPlugin:f,CompositionEventPlugin:m,MobileSafariClickEventPlugin:C,SelectEventPlugin:M}),r.injection.injectComponentClasses({button:o,form:i,input:a,option:s,select:u,textarea:c}),h.injection.injectDOMPropertyConfig(d),b.injection.injectBatchingStrategy(D)}var r=t("./ReactDOM"),o=t("./ReactDOMButton"),i=t("./ReactDOMForm"),a=t("./ReactDOMInput"),s=t("./ReactDOMOption"),u=t("./ReactDOMSelect"),c=t("./ReactDOMTextarea"),l=t("./ReactEventEmitter"),p=t("./ReactEventTopLevelCallback");t("./ReactPerf");var d=t("./DefaultDOMPropertyConfig"),h=t("./DOMProperty"),f=t("./ChangeEventPlugin"),m=t("./CompositionEventPlugin"),v=t("./DefaultEventPluginOrder"),g=t("./EnterLeaveEventPlugin"),y=t("./EventPluginHub"),C=t("./MobileSafariClickEventPlugin"),E=t("./ReactInstanceHandles"),M=t("./SelectEventPlugin"),R=t("./SimpleEventPlugin"),D=t("./ReactDefaultBatchingStrategy"),b=t("./ReactUpdates");e.exports={inject:n}},{"./ChangeEventPlugin":5,"./CompositionEventPlugin":6,"./DOMProperty":8,"./DefaultDOMPropertyConfig":11,"./DefaultEventPluginOrder":12,"./EnterLeaveEventPlugin":13,"./EventPluginHub":16,"./MobileSafariClickEventPlugin":22,"./ReactDOM":30,"./ReactDOMButton":31,"./ReactDOMForm":33,"./ReactDOMInput":35,"./ReactDOMOption":36,"./ReactDOMSelect":37,"./ReactDOMTextarea":39,"./ReactDefaultBatchingStrategy":40,"./ReactEventEmitter":42,"./ReactEventTopLevelCallback":44,"./ReactInstanceHandles":46,"./ReactPerf":53,"./ReactUpdates":59,"./SelectEventPlugin":60,"./SimpleEventPlugin":61}],42:[function(t,e){"use strict";function n(t,e,n){a.listen(n,e,f.TopLevelCallbackCreator.createTopLevelCallback(t))}function r(t,e,n){a.capture(n,e,f.TopLevelCallbackCreator.createTopLevelCallback(t))}function o(){var t=l.refreshScrollValues;a.listen(window,"scroll",t),a.listen(window,"resize",t)}var i=t("./EventConstants"),a=t("./EventListener"),s=t("./EventPluginHub"),u=t("./ExecutionEnvironment"),c=t("./ReactEventEmitterMixin"),l=t("./ViewportMetrics"),p=t("./invariant"),d=t("./isEventSupported"),h=t("./merge"),f=h(c,{TopLevelCallbackCreator:null,ensureListening:function(t,e){p(u.canUseDOM),p(f.TopLevelCallbackCreator),c.ensureListening.call(f,{touchNotMouse:t,contentDocument:e})},setEnabled:function(t){p(u.canUseDOM),f.TopLevelCallbackCreator&&f.TopLevelCallbackCreator.setEnabled(t)},isEnabled:function(){return!(!f.TopLevelCallbackCreator||!f.TopLevelCallbackCreator.isEnabled())},listenAtTopLevel:function(t,e){p(!e._isListening);var a=i.topLevelTypes,s=e;o(),n(a.topMouseOver,"mouseover",s),n(a.topMouseDown,"mousedown",s),n(a.topMouseUp,"mouseup",s),n(a.topMouseMove,"mousemove",s),n(a.topMouseOut,"mouseout",s),n(a.topClick,"click",s),n(a.topDoubleClick,"dblclick",s),t&&(n(a.topTouchStart,"touchstart",s),n(a.topTouchEnd,"touchend",s),n(a.topTouchMove,"touchmove",s),n(a.topTouchCancel,"touchcancel",s)),n(a.topKeyUp,"keyup",s),n(a.topKeyPress,"keypress",s),n(a.topKeyDown,"keydown",s),n(a.topInput,"input",s),n(a.topChange,"change",s),n(a.topSelectionChange,"selectionchange",s),n(a.topCompositionEnd,"compositionend",s),n(a.topCompositionStart,"compositionstart",s),n(a.topCompositionUpdate,"compositionupdate",s),d("drag")&&(n(a.topDrag,"drag",s),n(a.topDragEnd,"dragend",s),n(a.topDragEnter,"dragenter",s),n(a.topDragExit,"dragexit",s),n(a.topDragLeave,"dragleave",s),n(a.topDragOver,"dragover",s),n(a.topDragStart,"dragstart",s),n(a.topDrop,"drop",s)),d("wheel")?n(a.topWheel,"wheel",s):d("mousewheel")?n(a.topWheel,"mousewheel",s):n(a.topWheel,"DOMMouseScroll",s),d("scroll",!0)?r(a.topScroll,"scroll",s):n(a.topScroll,"scroll",window),d("focus",!0)?(r(a.topFocus,"focus",s),r(a.topBlur,"blur",s)):d("focusin")&&(n(a.topFocus,"focusin",s),n(a.topBlur,"focusout",s)),d("copy")&&(n(a.topCopy,"copy",s),n(a.topCut,"cut",s),n(a.topPaste,"paste",s))},registrationNames:s.registrationNames,putListener:s.putListener,getListener:s.getListener,deleteListener:s.deleteListener,deleteAllListeners:s.deleteAllListeners,trapBubbledEvent:n,trapCapturedEvent:r});e.exports=f},{"./EventConstants":14,"./EventListener":15,"./EventPluginHub":16,"./ExecutionEnvironment":20,"./ReactEventEmitterMixin":43,"./ViewportMetrics":72,"./invariant":94,"./isEventSupported":95,"./merge":103}],43:[function(t,e){"use strict";function n(t){r.enqueueEvents(t),r.processEventQueue()}var r=t("./EventPluginHub"),o=t("./ReactUpdates"),i={_isListening:!1,ensureListening:function(t){t.contentDocument._reactIsListening||(this.listenAtTopLevel(t.touchNotMouse,t.contentDocument),t.contentDocument._reactIsListening=!0)},handleTopLevel:function(t,e,i,a){var s=r.extractEvents(t,e,i,a);o.batchedUpdates(n,s)}};e.exports=i},{"./EventPluginHub":16,"./ReactUpdates":59}],44:[function(t,e){"use strict";var n=t("./ReactEventEmitter"),r=t("./ReactMount"),o=t("./getEventTarget"),i=!0,a={setEnabled:function(t){i=!!t},isEnabled:function(){return i},createTopLevelCallback:function(t){return function(e){if(i){e.srcElement&&e.srcElement!==e.target&&(e.target=e.srcElement);var a=r.getFirstReactDOM(o(e))||window,s=r.getID(a)||"";n.handleTopLevel(t,a,s,e)}}}};e.exports=a},{"./ReactEventEmitter":42,"./ReactMount":48,"./getEventTarget":88}],45:[function(t,e){"use strict";function n(t){return i(document.documentElement,t)}var r=t("./ReactDOMSelection"),o=t("./getActiveElement"),i=t("./nodeContains"),a={hasSelectionCapabilities:function(t){return t&&("INPUT"===t.nodeName&&"text"===t.type||"TEXTAREA"===t.nodeName||"true"===t.contentEditable)},getSelectionInformation:function(){var t=o();return{focusedElem:t,selectionRange:a.hasSelectionCapabilities(t)?a.getSelection(t):null}},restoreSelection:function(t){var e=o(),r=t.focusedElem,i=t.selectionRange;e!==r&&n(r)&&(a.hasSelectionCapabilities(r)&&a.setSelection(r,i),r.focus())},getSelection:function(t){var e;if("selectionStart"in t)e={start:t.selectionStart,end:t.selectionEnd};else if(document.selection&&"INPUT"===t.nodeName){var n=document.selection.createRange();n.parentElement()===t&&(e={start:-n.moveStart("character",-t.value.length),end:-n.moveEnd("character",-t.value.length)})}else e=r.getOffsets(t);return e||{start:0,end:0}},setSelection:function(t,e){var n=e.start,o=e.end;if("undefined"==typeof o&&(o=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(o,t.value.length);else if(document.selection&&"INPUT"===t.nodeName){var i=t.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(t,e)}};e.exports=a},{"./ReactDOMSelection":38,"./getActiveElement":87,"./nodeContains":108}],46:[function(t,e){"use strict";function n(t){return p+"r["+t.toString(36)+"]"}function r(t,e){return t.charAt(e)===p||e===t.length}function o(t){return""===t||t.charAt(0)===p&&t.charAt(t.length-1)!==p}function i(t,e){return 0===e.indexOf(t)&&r(e,t.length)}function a(t){return t?t.substr(0,t.lastIndexOf(p)):""}function s(t,e){if(l(o(t)&&o(e)),l(i(t,e)),t===e)return t;for(var n=t.length+d,a=n;a<e.length&&!r(e,a);a++);return e.substr(0,a)}function u(t,e){var n=Math.min(t.length,e.length);if(0===n)return"";for(var i=0,a=0;n>=a;a++)if(r(t,a)&&r(e,a))i=a;else if(t.charAt(a)!==e.charAt(a))break;var s=t.substr(0,i);return l(o(s)),s}function c(t,e,n,r,o,u){t=t||"",e=e||"",l(t!==e);var c=i(e,t);l(c||i(t,e));for(var p=0,d=c?a:s,f=t;o&&f===t||u&&f===e||n(f,c,r),f!==e;f=d(f,e))l(p++<h)}var l=t("./invariant"),p=".",d=p.length,h=100,f=9999999,m={createReactRootID:function(){return n(Math.ceil(Math.random()*f))},createReactID:function(t,e){return t+p+e},getReactRootIDFromNodeID:function(t){var e=/\.r\[[^\]]+\]/.exec(t);return e&&e[0]},traverseEnterLeave:function(t,e,n,r,o){var i=u(t,e);i!==t&&c(t,i,n,r,!1,!0),i!==e&&c(i,e,n,o,!0,!1)},traverseTwoPhase:function(t,e,n){t&&(c("",t,e,n,!0,!1),c(t,"",e,n,!1,!0))},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:i,SEPARATOR:p};e.exports=m},{"./invariant":94}],47:[function(t,e){"use strict";var n=t("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(t){var e=n(t);return t.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+e+'">')},canReuseMarkup:function(t,e){var o=e.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var i=n(t);return i===o}};e.exports=r},{"./adler32":74}],48:[function(t,e){"use strict";function n(t){var e=d(t);return e&&R.getID(e)}function r(t){var e=o(t);if(e)if(g.hasOwnProperty(e)){var n=g[e];n!==t&&(h(!s(n,e)),g[e]=t)}else g[e]=t;return e}function o(t){return t&&t.getAttribute&&t.getAttribute(v)||""}function i(t,e){var n=o(t);n!==e&&delete g[n],t.setAttribute(v,e),g[e]=t}function a(t){return g.hasOwnProperty(t)&&s(g[t],t)||(g[t]=R.findReactNodeByID(t)),g[t]}function s(t,e){if(t){h(o(t)===e);var n=R.findReactContainerForID(e);if(n&&f(n,t))return!0}return!1}function u(t){delete g[t]}var c=t("./ReactEventEmitter"),l=t("./ReactInstanceHandles"),p=t("./$"),d=t("./getReactRootElementInContainer"),h=t("./invariant"),f=t("./nodeContains"),m=l.SEPARATOR,v="data-reactid",g={},y=1,C=9,E={},M={},R={allowFullPageRender:!1,totalInstantiationTime:0,totalInjectionTime:0,useTouchEvents:!1,_instancesByReactRootID:E,scrollMonitor:function(t,e){e()},prepareEnvironmentForDOM:function(t){h(t&&(t.nodeType===y||t.nodeType===C));var e=t.nodeType===y?t.ownerDocument:t;c.ensureListening(R.useTouchEvents,e)},_updateRootComponent:function(t,e,n,r){var o=e.props;return R.scrollMonitor(n,function(){t.replaceProps(o,r)}),t},_registerComponent:function(t,e){R.prepareEnvironmentForDOM(e);var n=R.registerContainer(e);return E[n]=t,n},_renderNewRootComponent:function(t,e,n){var r=R._registerComponent(t,e);return t.mountComponentIntoNode(r,e,n),t},renderComponent:function(t,e,r){var o=E[n(e)];if(o){if(o.constructor===t.constructor)return R._updateRootComponent(o,t,e,r);R.unmountComponentAtNode(e)}var i=d(e),a=i&&R.isRenderedByReact(i),s=a&&!o,u=R._renderNewRootComponent(t,e,s);return r&&r(),u},constructAndRenderComponent:function(t,e,n){return R.renderComponent(t(e),n)},constructAndRenderComponentByID:function(t,e,n){return R.constructAndRenderComponent(t,e,p(n))},registerContainer:function(t){var e=n(t);return e&&(e=l.getReactRootIDFromNodeID(e)),e||(e=l.createReactRootID()),M[e]=t,e},unmountComponentAtNode:function(t){var e=n(t),r=E[e];return r?(R.unmountComponentFromNode(r,t),delete E[e],delete M[e],!0):!1},unmountAndReleaseReactRootNode:function(){return R.unmountComponentAtNode.apply(this,arguments)},unmountComponentFromNode:function(t,e){for(t.unmountComponent(),e.nodeType===C&&(e=e.documentElement);e.lastChild;)e.removeChild(e.lastChild)},findReactContainerForID:function(t){var e=l.getReactRootIDFromNodeID(t),n=M[e];return n},findReactNodeByID:function(t){var e=R.findReactContainerForID(t);return R.findComponentRoot(e,t)},isRenderedByReact:function(t){if(1!==t.nodeType)return!1;var e=R.getID(t);return e?e.charAt(0)===m:!1},getFirstReactDOM:function(t){for(var e=t;e&&e.parentNode!==e;){if(R.isRenderedByReact(e))return e;e=e.parentNode}return null},findComponentRoot:function(t,e){for(var n=[t.firstChild],r=0;r<n.length;)for(var o=n[r++];o;){var i=R.getID(o);if(i){if(e===i)return o;if(l.isAncestorIDOf(i,e)){n.length=r=0,n.push(o.firstChild);break}n.push(o.firstChild)}else n.push(o.firstChild);o=o.nextSibling}h(!1)},ATTR_NAME:v,getReactRootID:n,getID:r,setID:i,getNode:a,purgeID:u,injection:{}};e.exports=R},{"./$":1,"./ReactEventEmitter":42,"./ReactInstanceHandles":46,"./getReactRootElementInContainer":91,"./invariant":94,"./nodeContains":108}],49:[function(t,e){"use strict";function n(t){this._queue=t||null}var r=t("./PooledClass"),o=t("./mixInto");o(n,{enqueue:function(t,e){this._queue=this._queue||[],this._queue.push({component:t,callback:e})},notifyAll:function(){var t=this._queue;if(t){this._queue=null;for(var e=0,n=t.length;n>e;e++){var r=t[e].component,o=t[e].callback;o.call(r,r.getDOMNode())}t.length=0}},reset:function(){this._queue=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),e.exports=n},{"./PooledClass":23,"./mixInto":106}],50:[function(t,e){"use strict";function n(t,e){return t&&e&&t.constructor===e.constructor}function r(t,e,n){h.push({parentID:t,parentNode:null,type:l.INSERT_MARKUP,markupIndex:f.push(e)-1,fromIndex:null,textContent:null,toIndex:n})}function o(t,e,n){h.push({parentID:t,parentNode:null,type:l.MOVE_EXISTING,markupIndex:null,textContent:null,fromIndex:e,toIndex:n})}function i(t,e){h.push({parentID:t,parentNode:null,type:l.REMOVE_NODE,markupIndex:null,textContent:null,fromIndex:e,toIndex:null})}function a(t,e){h.push({parentID:t,parentNode:null,type:l.TEXT_CONTENT,markupIndex:null,textContent:e,fromIndex:null,toIndex:null})}function s(){h.length&&(c.DOMIDOperations.dangerouslyProcessChildrenUpdates(h,f),u())}function u(){h.length=0,f.length=0}var c=t("./ReactComponent"),l=t("./ReactMultiChildUpdateTypes"),p=t("./flattenChildren"),d=0,h=[],f=[],m={Mixin:{mountChildren:function(t,e){var n=p(t),r=[],o=0;this._renderedChildren=n;for(var i in n){var a=n[i];if(n.hasOwnProperty(i)&&a){var s=this._rootNodeID+"."+i,u=a.mountComponent(s,e,this._mountDepth+1);a._mountImage=u,a._mountIndex=o,r.push(u),o++}}return r},updateTextContent:function(t){d++;try{var e=this._renderedChildren;for(var n in e)e.hasOwnProperty(n)&&e[n]&&this._unmountChildByName(e[n],n);this.setTextContent(t)}catch(r){throw d--,d||u(),r}d--,d||s()},updateChildren:function(t,e){d++;try{this._updateChildren(t,e)}catch(n){throw d--,d||u(),n}d--,d||s()},_updateChildren:function(t,e){var r=p(t),o=this._renderedChildren;if(r||o){var i,a=0,s=0;for(i in r)if(r.hasOwnProperty(i)){var u=o&&o[i],c=r[i];n(u,c)?(this.moveChild(u,s,a),a=Math.max(u._mountIndex,a),u.receiveProps(c.props,e),u._mountIndex=s):(u&&(a=Math.max(u._mountIndex,a),this._unmountChildByName(u,i)),c&&this._mountChildByNameAtIndex(c,i,s,e)),c&&s++}for(i in o)!o.hasOwnProperty(i)||!o[i]||r&&r[i]||this._unmountChildByName(o[i],i)}},unmountChildren:function(){var t=this._renderedChildren;for(var e in t){var n=t[e];n&&n.unmountComponent&&n.unmountComponent()}this._renderedChildren=null},moveChild:function(t,e,n){t._mountIndex<n&&o(this._rootNodeID,t._mountIndex,e)},createChild:function(t){r(this._rootNodeID,t._mountImage,t._mountIndex)},removeChild:function(t){i(this._rootNodeID,t._mountIndex)},setTextContent:function(t){a(this._rootNodeID,t)},_mountChildByNameAtIndex:function(t,e,n,r){var o=this._rootNodeID+"."+e,i=t.mountComponent(o,r,this._mountDepth+1);t._mountImage=i,t._mountIndex=n,this.createChild(t),this._renderedChildren=this._renderedChildren||{},this._renderedChildren[e]=t},_unmountChildByName:function(t,e){c.isValidComponent(t)&&(this.removeChild(t),t._mountImage=null,t._mountIndex=null,t.unmountComponent(),delete this._renderedChildren[e])}}};e.exports=m},{"./ReactComponent":25,"./ReactMultiChildUpdateTypes":51,"./flattenChildren":84}],51:[function(t,e){var n=t("./keyMirror"),r=n({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,TEXT_CONTENT:null});e.exports=r},{"./keyMirror":100}],52:[function(t,e){"use strict";var n=t("./invariant"),r={isValidOwner:function(t){return!(!t||"function"!=typeof t.attachRef||"function"!=typeof t.detachRef)},addComponentAsRefTo:function(t,e,o){n(r.isValidOwner(o)),o.attachRef(e,t)},removeComponentAsRefFrom:function(t,e,o){n(r.isValidOwner(o)),o.refs[e]===t&&o.detachRef(e)},Mixin:{attachRef:function(t,e){n(e.isOwnedBy(this));var r=this.refs||(this.refs={});r[t]=e},detachRef:function(t){delete this.refs[t]}}};e.exports=r},{"./invariant":94}],53:[function(t,e){"use strict";
function n(t,e,n){return n}var r={enableMeasure:!1,storedMeasure:n,measure:function(t,e,n){return n},injection:{injectMeasure:function(t){r.storedMeasure=t}}};e.exports=r},{}],54:[function(t,e){"use strict";function n(t){return function(e,n,r){e[n]=e.hasOwnProperty(n)?t(e[n],r):r}}var r=t("./emptyFunction"),o=t("./invariant"),i=t("./joinClasses"),a=t("./merge"),s={children:r,className:n(i),ref:r,style:n(a)},u={TransferStrategies:s,Mixin:{transferPropsTo:function(t){o(t.props.__owner__===this);var e={};for(var n in t.props)t.props.hasOwnProperty(n)&&(e[n]=t.props[n]);for(var r in this.props)if(this.props.hasOwnProperty(r)){var i=s[r];i?i(e,r,this.props[r]):e.hasOwnProperty(r)||(e[r]=this.props[r])}return t.props=e,t}}};e.exports=u},{"./emptyFunction":80,"./invariant":94,"./joinClasses":99,"./merge":103}],55:[function(t,e){"use strict";function n(t){function e(e){var n=typeof e;"object"===n&&Array.isArray(e)&&(n="array"),s(n===t)}return i(e)}function r(t){function e(t){s(n[t])}var n=a(t);return i(e)}function o(t){function e(e){s(e instanceof t)}return i(e)}function i(t){function e(n){function r(e,r,o){var i=e[r];null!=i?t(i,r,o||c):s(!n)}return n||(r.isRequired=e(!0)),r}return e(!1)}var a=t("./createObjectFrom"),s=t("./invariant"),u={array:n("array"),bool:n("boolean"),func:n("function"),number:n("number"),object:n("object"),string:n("string"),oneOf:r,instanceOf:o},c="<<anonymous>>";e.exports=u},{"./createObjectFrom":78,"./invariant":94}],56:[function(t,e){"use strict";function n(){this.reinitializeTransaction(),this.reactMountReady=s.getPooled(null)}var r=t("./ExecutionEnvironment"),o=t("./PooledClass"),i=t("./ReactEventEmitter"),a=t("./ReactInputSelection"),s=t("./ReactMountReady"),u=t("./Transaction"),c=t("./mixInto"),l={initialize:a.getSelectionInformation,close:a.restoreSelection},p={initialize:function(){var t=i.isEnabled();return i.setEnabled(!1),t},close:function(t){i.setEnabled(t)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},h=[l,p,d],f={getTransactionWrappers:function(){return r.canUseDOM?h:[]},getReactMountReady:function(){return this.reactMountReady},destructor:function(){s.release(this.reactMountReady),this.reactMountReady=null}};c(n,u.Mixin),c(n,f),o.addPoolingTo(n),e.exports=n},{"./ExecutionEnvironment":20,"./PooledClass":23,"./ReactEventEmitter":42,"./ReactInputSelection":45,"./ReactMountReady":49,"./Transaction":71,"./mixInto":106}],57:[function(t,e){"use strict";function n(t,e){var n=i.createReactRootID(),a=o.getPooled();a.reinitializeTransaction();try{a.perform(function(){var o=t.mountComponent(n,a,0);o=r.addChecksumToMarkup(o),e(o)},null)}finally{o.release(a)}}var r=t("./ReactMarkupChecksum"),o=t("./ReactReconcileTransaction"),i=t("./ReactInstanceHandles");e.exports={renderComponentToString:n}},{"./ReactInstanceHandles":46,"./ReactMarkupChecksum":47,"./ReactReconcileTransaction":56}],58:[function(t,e){"use strict";var n=t("./ReactComponent"),r=t("./ReactMount"),o=t("./escapeTextForBrowser"),i=t("./mixInto"),a=function(t){this.construct({text:t})};i(a,n.Mixin),i(a,{mountComponent:function(t,e,i){return n.Mixin.mountComponent.call(this,t,e,i),"<span "+r.ATTR_NAME+'="'+t+'">'+o(this.props.text)+"</span>"},receiveProps:function(t){t.text!==this.props.text&&(this.props.text=t.text,n.DOMIDOperations.updateTextContentByID(this._rootNodeID,t.text))}}),e.exports=a},{"./ReactComponent":25,"./ReactMount":48,"./escapeTextForBrowser":81,"./mixInto":106}],59:[function(t,e){"use strict";function n(){c(p)}function r(t,e){n(),p.batchedUpdates(t,e)}function o(t,e){return t._mountDepth-e._mountDepth}function i(){l.sort(o);for(var t=0;t<l.length;t++){var e=l[t];if(e.isMounted()){var n=e._pendingCallbacks;if(e._pendingCallbacks=null,e.performUpdateIfNecessary(),n)for(var r=0;r<n.length;r++)n[r].call(e)}}}function a(){l.length=0}function s(){try{i()}catch(t){throw t}finally{a()}}function u(t,e){return c(!e||"function"==typeof e),n(),p.isBatchingUpdates?(l.push(t),e&&(t._pendingCallbacks?t._pendingCallbacks.push(e):t._pendingCallbacks=[e]),void 0):(t.performUpdateIfNecessary(),e&&e(),void 0)}var c=t("./invariant"),l=[],p=null,d={injectBatchingStrategy:function(t){c(t),c("function"==typeof t.batchedUpdates),c("boolean"==typeof t.isBatchingUpdates),p=t}},h={batchedUpdates:r,enqueueUpdate:u,flushBatchedUpdates:s,injection:d};e.exports=h},{"./invariant":94}],60:[function(t,e){"use strict";function n(t){if("selectionStart"in t&&c.hasSelectionCapabilities(t))return{start:t.selectionStart,end:t.selectionEnd};if(document.selection){var e=document.selection.createRange();return{parentElement:e.parentElement(),text:e.text,top:e.boundingTop,left:e.boundingLeft}}var n=window.getSelection();return{anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}}function r(t){if(!b&&E==p()){var e=n(E);if(!D||!m(D,e)){D=e;var r=l.getPooled(g.select,M,t);return r.type="select",r.target=E,s.accumulateTwoPhaseDispatches(r),r}}}function o(){if(R){var t=r(R);R=null,t&&(a.enqueueEvents(t),a.processEventQueue())}}var i=t("./EventConstants"),a=t("./EventPluginHub"),s=t("./EventPropagators"),u=t("./ExecutionEnvironment"),c=t("./ReactInputSelection"),l=t("./SyntheticEvent"),p=t("./getActiveElement"),d=t("./isEventSupported"),h=t("./isTextInputElement"),f=t("./keyOf"),m=t("./shallowEqual"),v=i.topLevelTypes,g={select:{phasedRegistrationNames:{bubbled:f({onSelect:null}),captured:f({onSelectCapture:null})}}},y=!1,C=!1;u.canUseDOM&&(y="onselectionchange"in document,C=d("select"));var E=null,M=null,R=null,D=null,b=!1,N={eventTypes:g,extractEvents:function(t,e,n,i){switch(t){case v.topFocus:(h(e)||"true"===e.contentEditable)&&(E=e,M=n,D=null);break;case v.topBlur:E=null,M=null,D=null;break;case v.topMouseDown:b=!0;break;case v.topMouseUp:return b=!1,r(i);case v.topSelectionChange:return r(i);case v.topKeyDown:y||(R=i,setTimeout(o,0))}}};e.exports=N},{"./EventConstants":14,"./EventPluginHub":16,"./EventPropagators":19,"./ExecutionEnvironment":20,"./ReactInputSelection":45,"./SyntheticEvent":64,"./getActiveElement":87,"./isEventSupported":95,"./isTextInputElement":97,"./keyOf":101,"./shallowEqual":111}],61:[function(t,e){"use strict";var n=t("./EventConstants"),r=t("./EventPropagators"),o=t("./SyntheticClipboardEvent"),i=t("./SyntheticEvent"),a=t("./SyntheticFocusEvent"),s=t("./SyntheticKeyboardEvent"),u=t("./SyntheticMouseEvent"),c=t("./SyntheticTouchEvent"),l=t("./SyntheticUIEvent"),p=t("./SyntheticWheelEvent"),d=t("./invariant"),h=t("./keyOf"),f=n.topLevelTypes,m={blur:{phasedRegistrationNames:{bubbled:h({onBlur:!0}),captured:h({onBlurCapture:!0})}},click:{phasedRegistrationNames:{bubbled:h({onClick:!0}),captured:h({onClickCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:h({onCopy:!0}),captured:h({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:h({onCut:!0}),captured:h({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:h({onDoubleClick:!0}),captured:h({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:h({onDrag:!0}),captured:h({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:h({onDragEnd:!0}),captured:h({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:h({onDragEnter:!0}),captured:h({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:h({onDragExit:!0}),captured:h({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:h({onDragLeave:!0}),captured:h({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:h({onDragOver:!0}),captured:h({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:h({onDragStart:!0}),captured:h({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:h({onDrop:!0}),captured:h({onDropCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:h({onFocus:!0}),captured:h({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:h({onInput:!0}),captured:h({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:h({onKeyDown:!0}),captured:h({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:h({onKeyPress:!0}),captured:h({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:h({onKeyUp:!0}),captured:h({onKeyUpCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:h({onMouseDown:!0}),captured:h({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:h({onMouseMove:!0}),captured:h({onMouseMoveCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:h({onMouseUp:!0}),captured:h({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:h({onPaste:!0}),captured:h({onPasteCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:h({onScroll:!0}),captured:h({onScrollCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:h({onSubmit:!0}),captured:h({onSubmitCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:h({onTouchCancel:!0}),captured:h({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:h({onTouchEnd:!0}),captured:h({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:h({onTouchMove:!0}),captured:h({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:h({onTouchStart:!0}),captured:h({onTouchStartCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:h({onWheel:!0}),captured:h({onWheelCapture:!0})}}},v={topBlur:m.blur,topClick:m.click,topCopy:m.copy,topCut:m.cut,topDoubleClick:m.doubleClick,topDrag:m.drag,topDragEnd:m.dragEnd,topDragEnter:m.dragEnter,topDragExit:m.dragExit,topDragLeave:m.dragLeave,topDragOver:m.dragOver,topDragStart:m.dragStart,topDrop:m.drop,topFocus:m.focus,topInput:m.input,topKeyDown:m.keyDown,topKeyPress:m.keyPress,topKeyUp:m.keyUp,topMouseDown:m.mouseDown,topMouseMove:m.mouseMove,topMouseUp:m.mouseUp,topPaste:m.paste,topScroll:m.scroll,topSubmit:m.submit,topTouchCancel:m.touchCancel,topTouchEnd:m.touchEnd,topTouchMove:m.touchMove,topTouchStart:m.touchStart,topWheel:m.wheel},g={eventTypes:m,executeDispatch:function(t,e,n){var r=e(t,n);r===!1&&(t.stopPropagation(),t.preventDefault())},extractEvents:function(t,e,n,h){var m=v[t];if(!m)return null;var g;switch(t){case f.topInput:case f.topSubmit:g=i;break;case f.topKeyDown:case f.topKeyPress:case f.topKeyUp:g=s;break;case f.topBlur:case f.topFocus:g=a;break;case f.topClick:if(2===h.button)return null;case f.topDoubleClick:case f.topDrag:case f.topDragEnd:case f.topDragEnter:case f.topDragExit:case f.topDragLeave:case f.topDragOver:case f.topDragStart:case f.topDrop:case f.topMouseDown:case f.topMouseMove:case f.topMouseUp:g=u;break;case f.topTouchCancel:case f.topTouchEnd:case f.topTouchMove:case f.topTouchStart:g=c;break;case f.topScroll:g=l;break;case f.topWheel:g=p;break;case f.topCopy:case f.topCut:case f.topPaste:g=o}d(g);var y=g.getPooled(m,n,h);return r.accumulateTwoPhaseDispatches(y),y}};e.exports=g},{"./EventConstants":14,"./EventPropagators":19,"./SyntheticClipboardEvent":62,"./SyntheticEvent":64,"./SyntheticFocusEvent":65,"./SyntheticKeyboardEvent":66,"./SyntheticMouseEvent":67,"./SyntheticTouchEvent":68,"./SyntheticUIEvent":69,"./SyntheticWheelEvent":70,"./invariant":94,"./keyOf":101}],62:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={clipboardData:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],63:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={data:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],64:[function(t,e){"use strict";function n(t,e,n){this.dispatchConfig=t,this.dispatchMarker=e,this.nativeEvent=n;var r=this.constructor.Interface;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];this[i]=a?a(n):n[i]}this.isDefaultPrevented=n.defaultPrevented||n.returnValue===!1?o.thatReturnsTrue:o.thatReturnsFalse,this.isPropagationStopped=o.thatReturnsFalse}var r=t("./PooledClass"),o=t("./emptyFunction"),i=t("./getEventTarget"),a=t("./merge"),s=t("./mergeInto"),u={type:null,target:i,currentTarget:null,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};s(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t.preventDefault?t.preventDefault():t.returnValue=!1,this.isDefaultPrevented=o.thatReturnsTrue},stopPropagation:function(){var t=this.nativeEvent;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this.isPropagationStopped=o.thatReturnsTrue},persist:function(){this.isPersistent=o.thatReturnsTrue},isPersistent:o.thatReturnsFalse,destructor:function(){var t=this.constructor.Interface;for(var e in t)this[e]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),n.Interface=u,n.augmentClass=function(t,e){var n=this,o=Object.create(n.prototype);s(o,t.prototype),t.prototype=o,t.prototype.constructor=t,t.Interface=a(n.Interface,e),t.augmentClass=n.augmentClass,r.addPoolingTo(t,r.threeArgumentPooler)},r.addPoolingTo(n,r.threeArgumentPooler),e.exports=n},{"./PooledClass":23,"./emptyFunction":80,"./getEventTarget":88,"./merge":103,"./mergeInto":105}],65:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={relatedTarget:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],66:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={"char":null,key:null,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,charCode:null,keyCode:null,which:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],67:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o=t("./ViewportMetrics"),i={screenX:null,screenY:null,clientX:null,clientY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,button:function(t){var e=t.button;return"which"in t?e:2===e?2:4===e?1:0},buttons:null,relatedTarget:function(t){return t.relatedTarget||(t.fromElement===t.srcElement?t.toElement:t.fromElement)},pageX:function(t){return"pageX"in t?t.pageX:t.clientX+o.currentScrollLeft},pageY:function(t){return"pageY"in t?t.pageY:t.clientY+o.currentScrollTop}};r.augmentClass(n,i),e.exports=n},{"./SyntheticUIEvent":69,"./ViewportMetrics":72}],68:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticUIEvent"),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticUIEvent":69}],69:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticEvent"),o={view:null,detail:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticEvent":64}],70:[function(t,e){"use strict";function n(t,e,n){r.call(this,t,e,n)}var r=t("./SyntheticMouseEvent"),o={deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?-t.deltaY:"wheelDeltaY"in t?t.wheelDeltaY:"wheelDelta"in t?t.wheelData:0},deltaZ:null,deltaMode:null};r.augmentClass(n,o),e.exports=n},{"./SyntheticMouseEvent":67}],71:[function(t,e){"use strict";var n=t("./invariant"),r={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this.timingMetrics||(this.timingMetrics={}),this.timingMetrics.methodInvocationTime=0,this.timingMetrics.wrapperInitTimes?this.timingMetrics.wrapperInitTimes.length=0:this.timingMetrics.wrapperInitTimes=[],this.timingMetrics.wrapperCloseTimes?this.timingMetrics.wrapperCloseTimes.length=0:this.timingMetrics.wrapperCloseTimes=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(t,e,r,o,i,a,s,u){n(!this.isInTransaction());var c,l=Date.now(),p=null;try{this.initializeAll(),c=t.call(e,r,o,i,a,s,u)}catch(d){p=d}finally{var h=Date.now();this.methodInvocationTime+=h-l;try{this.closeAll()}catch(f){p=p||f}}if(p)throw p;return c},initializeAll:function(){this._isInTransaction=!0;for(var t=this.transactionWrappers,e=this.timingMetrics.wrapperInitTimes,n=null,r=0;r<t.length;r++){var i=Date.now(),a=t[r];try{this.wrapperInitData[r]=a.initialize?a.initialize.call(this):null}catch(s){n=n||s,this.wrapperInitData[r]=o.OBSERVED_ERROR}finally{var u=e[r],c=Date.now();e[r]=(u||0)+(c-i)}}if(n)throw n},closeAll:function(){n(this.isInTransaction());for(var t=this.transactionWrappers,e=this.timingMetrics.wrapperCloseTimes,r=null,i=0;i<t.length;i++){var a=t[i],s=Date.now(),u=this.wrapperInitData[i];try{u!==o.OBSERVED_ERROR&&a.close&&a.close.call(this,u)}catch(c){r=r||c}finally{var l=Date.now(),p=e[i];e[i]=(p||0)+(l-s)}}if(this.wrapperInitData.length=0,this._isInTransaction=!1,r)throw r}},o={Mixin:r,OBSERVED_ERROR:{}};e.exports=o},{"./invariant":94}],72:[function(t,e){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(){n.currentScrollLeft=document.body.scrollLeft+document.documentElement.scrollLeft,n.currentScrollTop=document.body.scrollTop+document.documentElement.scrollTop}};e.exports=n},{}],73:[function(t,e){"use strict";function n(t,e){if(r(null!=e),null==t)return e;var n=Array.isArray(t),o=Array.isArray(e);return n?t.concat(e):o?[t].concat(e):[t,e]}var r=t("./invariant");e.exports=n},{"./invariant":94}],74:[function(t,e){"use strict";function n(t){for(var e=1,n=0,o=0;o<t.length;o++)e=(e+t.charCodeAt(o))%r,n=(n+e)%r;return e|n<<16}var r=65521;e.exports=n},{}],75:[function(t,e){function n(t,e,n,r,o,i){t=t||{};for(var a,s=[e,n,r,o,i],u=0;s[u];){a=s[u++];for(var c in a)t[c]=a[c];a.hasOwnProperty&&a.hasOwnProperty("toString")&&"undefined"!=typeof a.toString&&t.toString!==a.toString&&(t.toString=a.toString)}return t}e.exports=n},{}],76:[function(t,e){function n(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"length"in t&&!("setInterval"in t)&&"number"!=typeof t.nodeType&&(Array.isArray(t)||"callee"in t||"item"in t)}function r(t){if(!n(t))return[t];if(t.item){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}return Array.prototype.slice.call(t)}e.exports=r},{}],77:[function(t,e){function n(t){var e=t.match(c);return e&&e[1].toLowerCase()}function r(t,e){var r=u;s(!!u);var o=n(t),c=o&&a(o);if(c){r.innerHTML=c[1]+t+c[2];for(var l=c[0];l--;)r=r.lastChild}else r.innerHTML=t;var p=r.getElementsByTagName("script");p.length&&(s(e),i(p).forEach(e));for(var d=i(r.childNodes);r.lastChild;)r.removeChild(r.lastChild);return d}var o=t("./ExecutionEnvironment"),i=t("./createArrayFrom"),a=t("./getMarkupWrap"),s=t("./invariant"),u=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=r},{"./ExecutionEnvironment":20,"./createArrayFrom":76,"./getMarkupWrap":89,"./invariant":94}],78:[function(t,e){function n(t,e){var n={},r=Array.isArray(e);"undefined"==typeof e&&(e=!0);for(var o=t.length;o--;)n[t[o]]=r?e[o]:e;return n}e.exports=n},{}],79:[function(t,e){"use strict";function n(t,e){var n=null==e||"boolean"==typeof e||""===e;if(n)return"";var o=isNaN(e);return o||0===e||r.isUnitlessNumber[t]?""+e:e+"px"}var r=t("./CSSProperty");e.exports=n},{"./CSSProperty":2}],80:[function(t,e){function n(t){return function(){return t}}function r(){}var o=t("./copyProperties");o(r,{thatReturns:n,thatReturnsFalse:n(!1),thatReturnsTrue:n(!0),thatReturnsNull:n(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(t){return t}}),e.exports=r},{"./copyProperties":75}],81:[function(t,e){"use strict";function n(t){return o[t]}function r(t){return(""+t).replace(i,n)}var o={"&":"&",">":">","<":"<",'"':""","'":"'","/":"/"},i=/[&><"'\/]/g;e.exports=r},{}],82:[function(t,e){var n=function(t){var e=Array.prototype.slice.call(arguments).map(function(t){return String(t)}),r=t.split("%s").length-1;return r!==e.length-1?n("ex args number mismatch: %s",JSON.stringify(e)):n._prefix+JSON.stringify(e)+n._suffix};n._prefix="<![EX[",n._suffix="]]>",e.exports=n},{}],83:[function(t,e){"use strict";function n(t,e,n){for(var r=t.attributes,o=r.length,i=[],a=0;o>a;a++){var s=r.item(a);e.call(n,s)&&i.push(s)}return i}e.exports=n},{}],84:[function(t,e){"use strict";function n(t,e,n){var r=t;o(!r.hasOwnProperty(n)),r[n]=e}function r(t){if(null==t)return t;var e={};return i(t,n,e),e}var o=t("./invariant"),i=t("./traverseAllChildren");e.exports=r},{"./invariant":94,"./traverseAllChildren":112}],85:[function(t,e){"use strict";var n=function(t,e,n){Array.isArray(t)?t.forEach(e,n):t&&e.call(n,t)};e.exports=n},{}],86:[function(t,e){function n(t,e,n){return"string"!=typeof t?t:e?r(t,e,n):document.getElementById(t)}function r(t,e,n){var i,a,s;if(o(e)==t)return e;if(e.getElementsByTagName){for(a=e.getElementsByTagName(n||"*"),s=0;s<a.length;s++)if(o(a[s])==t)return a[s]}else for(a=e.childNodes,s=0;s<a.length;s++)if(i=r(t,a[s]))return i;return null}function o(t){var e=t.getAttributeNode&&t.getAttributeNode("id");return e?e.value:null}e.exports=n},{}],87:[function(t,e){function n(){try{return document.activeElement}catch(t){return null}}e.exports=n},{}],88:[function(t,e){"use strict";function n(t){var e=t.target||t.srcElement||window;return 3===e.nodeType?e.parentNode:e}e.exports=n},{}],89:[function(t,e){function n(t){return o(!!i),p.hasOwnProperty(t)||(t="*"),a.hasOwnProperty(t)||(i.innerHTML="*"===t?"<link />":"<"+t+"></"+t+">",a[t]=!i.firstChild),a[t]?p[t]:null}var r=t("./ExecutionEnvironment"),o=t("./invariant"),i=r.canUseDOM?document.createElement("div"):null,a={circle:!0,g:!0,line:!0,path:!0,polyline:!0,rect:!0,text:!0},s=[1,'<select multiple="true">',"</select>"],u=[1,"<table>","</table>"],c=[3,"<table><tbody><tr>","</tr></tbody></table>"],l=[1,"<svg>","</svg>"],p={"*":[1,"?<div>","</div>"],area:[1,"<map>","</map>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],legend:[1,"<fieldset>","</fieldset>"],param:[1,"<object>","</object>"],tr:[2,"<table><tbody>","</tbody></table>"],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c,circle:l,g:l,line:l,path:l,polyline:l,rect:l,text:l};e.exports=n},{"./ExecutionEnvironment":20,"./invariant":94}],90:[function(t,e){"use strict";function n(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function r(t){for(;t;){if(t.nextSibling)return t.nextSibling;t=t.parentNode}}function o(t,e){for(var o=n(t),i=0,a=0;o;){if(3==o.nodeType){if(a=i+o.textContent.length,e>=i&&a>=e)return{node:o,offset:e-i};i=a}o=n(r(o))}}e.exports=o},{}],91:[function(t,e){"use strict";function n(t){return t?t.nodeType===r?t.documentElement:t.firstChild:null}var r=9;e.exports=n},{}],92:[function(t,e){"use strict";function n(){return!o&&r.canUseDOM&&(o="innerText"in document.createElement("div")?"innerText":"textContent"),o}var r=t("./ExecutionEnvironment"),o=null;e.exports=n},{"./ExecutionEnvironment":20}],93:[function(t,e){function n(t){return t.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},{}],94:[function(t,e){function n(t){if(!t)throw new Error("Invariant Violation")}e.exports=n},{}],95:[function(t,e){"use strict";function n(t,e){if(!r||e&&!r.addEventListener)return!1;var n=document.createElement("div"),i="on"+t,a=i in n;return a||(n.setAttribute(i,"return;"),a="function"==typeof n[i],"undefined"!=typeof n[i]&&(n[i]=void 0),n.removeAttribute(i)),!a&&o&&"wheel"===t&&(a=document.implementation.hasFeature("Events.wheel","3.0")),n=null,a}var r,o,i=t("./ExecutionEnvironment");i.canUseDOM&&(r=document.createElement("div"),o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},{"./ExecutionEnvironment":20}],96:[function(t,e){function n(t){return!(!t||!("undefined"!=typeof Node?t instanceof Node:"object"==typeof t&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName))}e.exports=n},{}],97:[function(t,e){"use strict";function n(t){return t&&("INPUT"===t.nodeName&&r[t.type]||"TEXTAREA"===t.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},{}],98:[function(t,e){function n(t){return r(t)&&3==t.nodeType}var r=t("./isNode");e.exports=n},{"./isNode":96}],99:[function(t,e){"use strict";function n(t){t||(t="");var e,n=arguments.length;if(n>1)for(var r=1;n>r;r++)e=arguments[r],e&&(t+=" "+e);return t}e.exports=n},{}],100:[function(t,e){"use strict";var n=t("./invariant"),r=function(t){var e,r={};n(t instanceof Object&&!Array.isArray(t));for(e in t)t.hasOwnProperty(e)&&(r[e]=e);return r};e.exports=r},{"./invariant":94}],101:[function(t,e){var n=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return e;return null};e.exports=n},{}],102:[function(t,e){"use strict";function n(t){var e={};return function(n){return e.hasOwnProperty(n)?e[n]:e[n]=t.call(this,n)}}e.exports=n},{}],103:[function(t,e){"use strict";var n=t("./mergeInto"),r=function(t,e){var r={};return n(r,t),n(r,e),r};e.exports=r},{"./mergeInto":105}],104:[function(t,e){"use strict";var n=t("./invariant"),r=t("./keyMirror"),o=36,i=function(t){return"object"!=typeof t||null===t},a={MAX_MERGE_DEPTH:o,isTerminal:i,normalizeMergeArg:function(t){return void 0===t||null===t?{}:t},checkMergeArrayArgs:function(t,e){n(Array.isArray(t)&&Array.isArray(e))},checkMergeObjectArgs:function(t,e){a.checkMergeObjectArg(t),a.checkMergeObjectArg(e)},checkMergeObjectArg:function(t){n(!i(t)&&!Array.isArray(t))},checkMergeLevel:function(t){n(o>t)},checkArrayStrategy:function(t){n(void 0===t||t in a.ArrayStrategies)},ArrayStrategies:r({Clobber:!0,IndexByIndex:!0})};e.exports=a},{"./invariant":94,"./keyMirror":100}],105:[function(t,e){"use strict";function n(t,e){if(o(t),null!=e){o(e);for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}}var r=t("./mergeHelpers"),o=r.checkMergeObjectArg;e.exports=n},{"./mergeHelpers":104}],106:[function(t,e){"use strict";var n=function(t,e){var n;for(n in e)e.hasOwnProperty(n)&&(t.prototype[n]=e[n])};e.exports=n},{}],107:[function(t,e){"use strict";function n(t,e){i("html"===t.tagName.toLowerCase()),e=e.trim(),i(0===e.toLowerCase().indexOf("<html"));var n=e.indexOf(">")+1,a=e.lastIndexOf("<"),s=e.substring(0,n),u=e.substring(n,a),c=s.indexOf(" ")>-1,l=null;if(c){l=r(s.replace("html ","span ")+"</span>")[0];var p=o(l,function(e){return t.getAttributeNS(e.namespaceURI,e.name)!==e.value});p.forEach(function(e){t.setAttributeNS(e.namespaceURI,e.name,e.value)})}var d=o(t,function(t){return!(l&&l.hasAttributeNS(t.namespaceURI,t.name))});d.forEach(function(e){t.removeAttributeNS(e.namespaceURI,e.name)}),t.innerHTML=u}var r=t("./createNodesFromMarkup"),o=t("./filterAttributes"),i=t("./invariant");e.exports=n},{"./createNodesFromMarkup":77,"./filterAttributes":83,"./invariant":94}],108:[function(t,e){function n(t,e){return t&&e?t===e?!0:r(t)?!1:r(e)?n(t,e.parentNode):t.contains?t.contains(e):t.compareDocumentPosition?!!(16&t.compareDocumentPosition(e)):!1:!1}var r=t("./isTextNode");e.exports=n},{"./isTextNode":98}],109:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,t[i],i,r++));return o}e.exports=n},{}],110:[function(t,e){"use strict";function n(t,e,n){if(!t)return null;var r=0,o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=e.call(n,i,t[i],r++));return o}e.exports=n},{}],111:[function(t,e){"use strict";function n(t,e){if(t===e)return!0;var n;for(n in t)if(t.hasOwnProperty(n)&&(!e.hasOwnProperty(n)||t[n]!==e[n]))return!1;for(n in e)if(e.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}e.exports=n},{}],112:[function(t,e){"use strict";function n(t,e,n){null!==t&&void 0!==t&&a(t,"",0,e,n)}var r=t("./ReactComponent"),o=t("./ReactTextComponent"),i=t("./invariant"),a=function(t,e,n,s,u){var c=0;if(Array.isArray(t))for(var l=0;l<t.length;l++){var p=t[l],d=e+r.getKey(p,l),h=n+c;c+=a(p,d,h,s,u)}else{var f=typeof t,m=""===e,v=m?r.getKey(t,0):e;if(null===t||void 0===t||"boolean"===f)s(u,null,v,n),c=1;else if(t.mountComponentIntoNode)s(u,t,v,n),c=1;else if("object"===f){i(!t||1!==t.nodeType);for(var g in t)t.hasOwnProperty(g)&&(c+=a(t[g],e+"{"+g+"}",n+c,s,u))}else if("string"===f){var y=new o(t);s(u,y,v,n),c+=1}else if("number"===f){var C=new o(""+t);s(u,C,v,n),c+=1}}return c};e.exports=n},{"./ReactComponent":25,"./ReactTextComponent":58,"./invariant":94}]},{},[24])(24)}); |
src/components/RankedIndividuals.js | betoesquivel/hackmtyaug16_LSystemsUI | import React, { Component } from 'react';
import { Block } from 'essence-core';
import { Text } from 'essence-core';
import InfiniteScroll from 'redux-infinite-scroll';
import Individuals from './IndividualList.js';
import Individual from './Individual.js';
const CDN_URL = 'http://d1q0qlolnapf2k.cloudfront.net';
const sampleID = '001a281d-0070-4fa8-8175-b2cee94e3351';
const individuals = [
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` },
{ 'imgSrc': `${CDN_URL}/${sampleID}.png` }
];
export default class RankedIndividuals extends Component {
_loadMore() {
const lastIndividual = this.props['lastEvaluatedIndividual'];
console.log(`Requesting individuals starting at ${lastIndividual}`);
this.props.getRankedIndividuals(lastIndividual);
}
_renderIndividuals() {
const parsed = this.props['ranked-individuals'].map((i) => {
return {
'imgSrc': `${CDN_URL}/${i.id}.png`,
...i
};
});
return ( <Individuals
individuals={ parsed } /> );
}
//_renderIndividuals() {
//const parsed = this.props['ranked-individuals'].map((i) => {
//return {
//'imgSrc': `${CDN_URL}/${i.id}.png`,
//...i
//};
//});
//return parsed.map( (i) => <Individual {...i} /> );
//}
renderInfiniteIndividuals() {
return (
<InfiniteScroll
hasMore={ this.props.hasMore }
items={this._renderIndividuals()}
loadMore={this._loadMore.bind(this)}
/>
)
}
render() {
return (
<Block classes={ 'e-row e-h-center e-v-center' }>
<Text type={'h1'}
classes={'e-text-uppercase'}
typography={'e-display-4'} >
{ "Top Rated Designs" }
</Text>
<Block classes={ 'brick brick-10' }>
{ this.renderInfiniteIndividuals.bind(this)() }
</Block>
</Block>
);
}
}
|
app/containers/LocaleToggle/index.js | akash6190/apollo-starter | /*
*
* LanguageToggle
*
*/
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import Toggle from 'components/Toggle';
import Wrapper from './Wrapper';
import messages from './messages';
import { appLocales } from '../../i18n';
import { changeLocale } from '../LanguageProvider/actions';
import { makeSelectLocale } from '../LanguageProvider/selectors';
export class LocaleToggle extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
render() {
return (
<Wrapper>
<Toggle value={this.props.locale} values={appLocales} messages={messages} onToggle={this.props.onLocaleToggle} />
</Wrapper>
);
}
}
LocaleToggle.propTypes = {
onLocaleToggle: React.PropTypes.func,
locale: React.PropTypes.string,
};
const mapStateToProps = createSelector(
makeSelectLocale(),
(locale) => ({ locale })
);
export function mapDispatchToProps(dispatch) {
return {
onLocaleToggle: (evt) => dispatch(changeLocale(evt.target.value)),
dispatch,
};
}
export default connect(mapStateToProps, mapDispatchToProps)(LocaleToggle);
|
src/js/LudoPage/MobileLudoPage/MobileCardContent.js | ludonow/ludo-beta-react | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import ReactPlayer from 'react-player';
import { cyan800, deepOrange200 } from 'material-ui/styles/colors';
const RoundRadiusTag = styled.span`
border-radius: 20px;
padding: 8px 20px;
background-color: ${cyan800};
color: white;
font-size: 0.8rem;
`;
const CardContentWrapper = styled.div`
padding: 5px 30px;
color: white;
`;
const CardImage = styled.div`
align-items: center;
display: flex;
justify-content: center;
margin-top: 20px;
img {
width: 200px;
}
`;
const CardInterval = styled.div`
display: flex;
flex-flow: row wrap;
justify-content: center;
margin: 30px 0;
text-align: center;
`;
const CardIntroduction = styled.div`
color: white;
font-size: 0.8rem;
font-weight: bold;
line-height: 1.3;
margin: 30px auto 70px auto;
white-space: pre-line;
`;
const CardTitle = styled.div`
margin: 35px 0;
text-align: center;
font-size: 22px;
font-weight: bold;
`;
const CardTags = styled.div`
display: flex;
flex-flow: row wrap;
justify-content: center;
margin: 15px 0;
text-align: center;
`;
const CardTag = RoundRadiusTag.extend`
display: flex;
align-items: center;
margin: 5px;
`;
const CardVideo = styled.div`
`;
const IntervalTag = RoundRadiusTag.extend`
display: flex;
align-items: center;
margin: 5px;
background-color: ${deepOrange200};
`;
const MobileCardContent = ({
handleImageLightboxOpen,
image_location,
interval,
introduction,
tags,
title,
video,
}) => (
<CardContentWrapper>
<CardTitle>
{title}
</CardTitle>
<CardTags>
{
tags.map((tag, index) => (
<CardTag
key={`introducton-${index}`}
>
#{tag}
</CardTag>
))
}
</CardTags>
<CardInterval>
<IntervalTag>每{interval}天回報</IntervalTag>
</CardInterval>
{
video ?
<CardVideo>
<ReactPlayer
height="auto"
url={video}
width="100%"
/>
</CardVideo>
: null
}
{
image_location ?
<CardImage>
<img
onClick={handleImageLightboxOpen}
src={image_location}
/>
</CardImage>
: null
}
<CardIntroduction>
{introduction}
</CardIntroduction>
</CardContentWrapper>
);
MobileCardContent.propTypes = {
handleImageLightboxOpen: PropTypes.func.isRequired,
interval: PropTypes.number.isRequired,
introduction: PropTypes.string.isRequired,
tags: PropTypes.arrayOf(PropTypes.string.isRequired),
title: PropTypes.string.isRequired,
video: PropTypes.string,
};
export default MobileCardContent;
|
frontend/HighlightHover.js | aadsm/react-devtools | /**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/
'use strict';
var React = require('react');
var assign = require('object-assign');
class HighlightHover extends React.Component {
constructor(props: Object) {
super(props);
this.state = {hover: false};
}
render(): ReactElement {
return (
<div
onMouseOver={() => !this.state.hover && this.setState({hover: true})}
onMouseOut={() => this.state.hover && this.setState({hover: false})}
style={assign({}, this.props.style, {
backgroundColor: this.state.hover ? '#eee' : 'transparent',
})}>
{this.props.children}
</div>
);
}
}
module.exports = HighlightHover;
|
js/ui/overview.js | pixunil/Cinnamon | // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk;
const Meta = imports.gi.Meta;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const Lang = imports.lang;
const St = imports.gi.St;
const Cinnamon = imports.gi.Cinnamon;
const Gdk = imports.gi.Gdk;
const Main = imports.ui.main;
const MessageTray = imports.ui.messageTray;
const Tweener = imports.ui.tweener;
const WorkspacesView = imports.ui.workspacesView;
// Time for initial animation going into Overview mode
const ANIMATION_TIME = 0.25;
const SwipeScrollDirection = WorkspacesView.SwipeScrollDirection;
const SwipeScrollResult = WorkspacesView.SwipeScrollResult;
function Overview() {
this._init.apply(this, arguments);
}
Overview.prototype = {
_init : function() {
this._spacing = 0;
this._group = new St.Widget({ name: 'overview',
reactive: true });
this._group._delegate = this;
this._group.connect('style-changed',
Lang.bind(this, function() {
let node = this._group.get_theme_node();
let spacing = node.get_length('spacing');
if (spacing != this._spacing) {
this._spacing = spacing;
}
}));
this._group.hide();
global.overlay_group.add_actor(this._group);
this._scrollDirection = SwipeScrollDirection.NONE;
this._scrollAdjustment = null;
this._capturedEventId = 0;
this._buttonPressId = 0;
this.visible = false; // animating to overview, in overview, animating out
this._shown = false; // show() and not hide()
this._shownTemporarily = false; // showTemporarily() and not hideTemporarily()
this._modal = false; // have a modal grab
this.animationInProgress = false;
this._hideInProgress = false;
this._windowSwitchTimeoutId = 0;
this._windowSwitchTimestamp = 0;
this._lastActiveWorkspaceIndex = -1;
this._lastHoveredWindow = null;
},
// The members we construct that are implemented in JS might
// want to access the overview as Main.overview to connect
// signal handlers and so forth. So we create them after
// construction in this init() method.
init: function() {
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this.hide));
},
setScrollAdjustment: function(adjustment, direction) {
this._scrollAdjustment = adjustment;
if (this._scrollAdjustment == null)
this._scrollDirection = SwipeScrollDirection.NONE;
else
this._scrollDirection = direction;
},
_onButtonPress: function(actor, event) {
this.emit('overview-background-button-press', actor, event);
if (this._scrollDirection == SwipeScrollDirection.NONE
|| event.get_button() != 1)
return false;
let [stageX, stageY] = event.get_coords();
this._dragStartX = this._dragX = stageX;
this._dragStartY = this._dragY = stageY;
this._dragStartValue = this._scrollAdjustment.value;
this._lastMotionTime = -1; // used to track "stopping" while swipe-scrolling
this._capturedEventId = global.stage.connect('captured-event',
Lang.bind(this, this._onCapturedEvent));
this.emit('swipe-scroll-begin');
return true;
},
_onCapturedEvent: function(actor, event) {
let stageX, stageY;
let threshold = Gtk.Settings.get_default().gtk_dnd_drag_threshold;
switch(event.type()) {
case Clutter.EventType.BUTTON_RELEASE:
[stageX, stageY] = event.get_coords();
// default to snapping back to the original value
let newValue = this._dragStartValue;
let minValue = this._scrollAdjustment.lower;
let maxValue = this._scrollAdjustment.upper - this._scrollAdjustment.page_size;
let direction;
if (this._scrollDirection == SwipeScrollDirection.HORIZONTAL) {
direction = stageX > this._dragStartX ? -1 : 1;
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
direction *= -1;
} else {
direction = stageY > this._dragStartY ? -1 : 1;
}
// We default to scroll a full page size; both the first
// and the last page may be smaller though, so we need to
// adjust difference in those cases.
let difference = direction * this._scrollAdjustment.page_size;
if (this._dragStartValue + difference > maxValue)
difference = maxValue - this._dragStartValue;
else if (this._dragStartValue + difference < minValue)
difference = minValue - this._dragStartValue;
// If the user has moved more than half the scroll
// difference, we want to "settle" to the new value
// even if the user stops dragging rather "throws" by
// releasing during the drag.
let distance = this._dragStartValue - this._scrollAdjustment.value;
let noStop = Math.abs(distance / difference) > 0.5;
// We detect if the user is stopped by comparing the
// timestamp of the button release with the timestamp of
// the last motion. Experimentally, a difference of 0 or 1
// millisecond indicates that the mouse is in motion, a
// larger difference indicates that the mouse is stopped.
if ((this._lastMotionTime > 0 &&
this._lastMotionTime > event.get_time() - 2) ||
noStop) {
if (this._dragStartValue + difference >= minValue &&
this._dragStartValue + difference <= maxValue)
newValue += difference;
}
let result;
// See if the user has moved the mouse enough to trigger
// a drag
if (Math.abs(stageX - this._dragStartX) < threshold &&
Math.abs(stageY - this._dragStartY) < threshold) {
// no motion? It's a click!
result = SwipeScrollResult.CLICK;
this.emit('swipe-scroll-end', result);
} else {
if (newValue == this._dragStartValue)
result = SwipeScrollResult.CANCEL;
else
result = SwipeScrollResult.SWIPE;
// The event capture handler is disconnected
// while scrolling to the final position, so
// to avoid undesired prelights we raise
// the cover pane.
this._coverPane.raise_top();
this._coverPane.show();
Tweener.addTween(this._scrollAdjustment,
{ value: newValue,
time: ANIMATION_TIME,
transition: 'easeOutQuad',
onCompleteScope: this,
onComplete: function() {
this._coverPane.hide();
this.emit('swipe-scroll-end',
result);
}
});
}
global.stage.disconnect(this._capturedEventId);
this._capturedEventId = 0;
return result != SwipeScrollResult.CLICK;
case Clutter.EventType.MOTION:
[stageX, stageY] = event.get_coords();
let dx = this._dragX - stageX;
let dy = this._dragY - stageY;
let primary = Main.layoutManager.primaryMonitor;
this._dragX = stageX;
this._dragY = stageY;
this._lastMotionTime = event.get_time();
// See if the user has moved the mouse enough to trigger
// a drag
if (Math.abs(stageX - this._dragStartX) < threshold &&
Math.abs(stageY - this._dragStartY) < threshold)
return true;
if (this._scrollDirection == SwipeScrollDirection.HORIZONTAL) {
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
this._scrollAdjustment.value -= (dx / primary.width) * this._scrollAdjustment.page_size;
else
this._scrollAdjustment.value += (dx / primary.width) * this._scrollAdjustment.page_size;
} else {
this._scrollAdjustment.value += (dy / primary.height) * this._scrollAdjustment.page_size;
}
return true;
// Block enter/leave events to avoid prelights
// during swipe-scroll
case Clutter.EventType.ENTER:
case Clutter.EventType.LEAVE:
return true;
}
return false;
},
//// Public methods ////
// show:
//
// Animates the overview visible and grabs mouse and keyboard input
show : function() {
if (this._shown)
return;
// Do this manually instead of using _syncInputMode, to handle failure
if (!Main.pushModal(this._group))
return;
this._modal = true;
this._animateVisible();
this._shown = true;
this._buttonPressId = this._group.connect('button-press-event',
Lang.bind(this, this._onButtonPress));
},
_animateVisible: function() {
if (this.visible || this.animationInProgress)
return;
// The main BackgroundActor is inside global.window_group which is
// hidden when displaying the overview, so we create a new
// one. Instances of this class share a single CoglTexture behind the
// scenes which allows us to show the background with different
// rendering options without duplicating the texture data.
this._background = new Clutter.Group();
this._background.hide();
global.overlay_group.add_actor(this._background);
this._desktopBackground = Meta.BackgroundActor.new_for_screen(global.screen);
this._background.add_actor(this._desktopBackground);
this._backgroundShade = new St.Bin({style_class: 'workspace-overview-background-shade'});
this._background.add_actor(this._backgroundShade);
this._backgroundShade.set_size(global.screen_width, global.screen_height);
this.visible = true;
this.animationInProgress = true;
// During transitions, we raise this to the top to avoid having the overview
// area be reactive; it causes too many issues such as mouseover handlers in the workspaces.
this._coverPane = new Clutter.Rectangle({ opacity: 0,
reactive: true });
this._group.add_actor(this._coverPane);
this._coverPane.set_position(0, 0);
this._coverPane.set_size(global.screen_width, global.screen_height);
this._coverPane.connect('event', Lang.bind(this, function (actor, event) { return true; }));
this._coverPane.hide();
// All the the actors in the window group are completely obscured,
// hiding the group holding them while the Overview is displayed greatly
// increases performance of the Overview especially when there are many
// windows visible.
//
// If we switched to displaying the actors in the Overview rather than
// clones of them, this would obviously no longer be necessary.
//
// Disable unredirection while in the overview
Meta.disable_unredirect_for_screen(global.screen);
global.window_group.hide();
this._group.show();
this._background.show();
this.workspacesView = new WorkspacesView.WorkspacesView();
global.overlay_group.add_actor(this.workspacesView.actor);
Main.panelManager.disablePanels();
this._group.opacity = 0;
Tweener.addTween(this._group,
{ opacity: 255,
transition: 'easeOutQuad',
time: ANIMATION_TIME,
onComplete: this._showDone,
onCompleteScope: this
});
this._coverPane.raise_top();
this._coverPane.show();
this.emit('showing');
},
// showTemporarily:
//
// Animates the overview visible without grabbing mouse and keyboard input;
// if show() has already been called, this has no immediate effect, but
// will result in the overview not being hidden until hideTemporarily() is
// called.
showTemporarily: function() {
if (this._shownTemporarily)
return;
this._syncInputMode();
this._animateVisible();
this._shownTemporarily = true;
},
// hide:
//
// Reverses the effect of show()
hide: function() {
if (!this._shown)
return;
if (!this._shownTemporarily)
this._animateNotVisible();
this._shown = false;
this._syncInputMode();
if (this._buttonPressId > 0)
this._group.disconnect(this._buttonPressId);
this._buttonPressId = 0;
},
// hideTemporarily:
//
// Reverses the effect of showTemporarily()
hideTemporarily: function() {
if (!this._shownTemporarily)
return;
if (!this._shown)
this._animateNotVisible();
this._shownTemporarily = false;
this._syncInputMode();
},
toggle: function() {
if (this._shown)
this.hide();
else
this.show();
},
//// Private methods ////
_syncInputMode: function() {
// We delay input mode changes during animation so that when removing the
// overview we don't have a problem with the release of a press/release
// going to an application.
if (this.animationInProgress)
return;
if (this._shown) {
if (!this._modal) {
if (Main.pushModal(this._group))
this._modal = true;
else
this.hide();
}
} else if (this._shownTemporarily) {
if (this._modal) {
Main.popModal(this._group);
this._modal = false;
}
global.stage_input_mode = Cinnamon.StageInputMode.FULLSCREEN;
} else {
if (this._modal) {
Main.popModal(this._group);
this._modal = false;
}
else if (global.stage_input_mode == Cinnamon.StageInputMode.FULLSCREEN)
global.stage_input_mode = Cinnamon.StageInputMode.NORMAL;
}
},
_animateNotVisible: function() {
if (!this.visible || this.animationInProgress)
return;
this.animationInProgress = true;
this._hideInProgress = true;
Main.panelManager.enablePanels();
this.workspacesView.hide();
// Make other elements fade out.
Tweener.addTween(this._group,
{ opacity: 0,
transition: 'easeOutQuad',
time: ANIMATION_TIME,
onComplete: this._hideDone,
onCompleteScope: this
});
this._coverPane.raise_top();
this._coverPane.show();
this.emit('hiding');
},
_showDone: function() {
this.animationInProgress = false;
this._coverPane.hide();
this.emit('shown');
// Handle any calls to hide* while we were showing
if (!this._shown && !this._shownTemporarily)
this._animateNotVisible();
this._syncInputMode();
global.sync_pointer();
},
_hideDone: function() {
this._group.remove_actor(this._coverPane);
this._coverPane.destroy();
global.overlay_group.remove_actor(this._background);
this._background.destroy();
// Re-enable unredirection
Meta.enable_unredirect_for_screen(global.screen);
global.window_group.show();
this.workspacesView.destroy();
this.workspacesView = null;
this._group.hide();
this.visible = false;
this.animationInProgress = false;
this._hideInProgress = false;
this.emit('hidden');
// Handle any calls to show* while we were hiding
if (this._shown || this._shownTemporarily)
this._animateVisible();
this._syncInputMode();
Main.layoutManager._chrome.updateRegions();
}
};
Signals.addSignalMethods(Overview.prototype);
|
examples/async/components/Picker.js | quamen/redux | import React, { Component, PropTypes } from 'react';
export default class Picker extends Component {
render() {
const { value, onChange, options } = this.props;
return (
<span>
<h1>{value}</h1>
<select onChange={e => onChange(e.target.value)}
value={value}>
{options.map(option =>
<option value={option} key={option}>
{option}
</option>)
}
</select>
</span>
);
}
}
Picker.propTypes = {
options: PropTypes.arrayOf(
PropTypes.string.isRequired
).isRequired,
value: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired
};
|
ajax/libs/zeroclipboard/2.1.4/ZeroClipboard.Core.js | keicheng/cdnjs | /*!
* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2014 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v2.1.4
*/
(function(window, undefined) {
"use strict";
/**
* Store references to critically important global functions that may be
* overridden on certain web pages.
*/
var _window = window, _document = _window.document, _navigator = _window.navigator, _setTimeout = _window.setTimeout, _encodeURIComponent = _window.encodeURIComponent, _ActiveXObject = _window.ActiveXObject, _Error = _window.Error, _parseInt = _window.Number.parseInt || _window.parseInt, _parseFloat = _window.Number.parseFloat || _window.parseFloat, _isNaN = _window.Number.isNaN || _window.isNaN, _round = _window.Math.round, _now = _window.Date.now, _keys = _window.Object.keys, _defineProperty = _window.Object.defineProperty, _hasOwn = _window.Object.prototype.hasOwnProperty, _slice = _window.Array.prototype.slice;
/**
* Convert an `arguments` object into an Array.
*
* @returns The arguments as an Array
* @private
*/
var _args = function(argumentsObj) {
return _slice.call(argumentsObj, 0);
};
/**
* Shallow-copy the owned, enumerable properties of one object over to another, similar to jQuery's `$.extend`.
*
* @returns The target object, augmented
* @private
*/
var _extend = function() {
var i, len, arg, prop, src, copy, args = _args(arguments), target = args[0] || {};
for (i = 1, len = args.length; i < len; i++) {
if ((arg = args[i]) != null) {
for (prop in arg) {
if (_hasOwn.call(arg, prop)) {
src = target[prop];
copy = arg[prop];
if (target !== copy && copy !== undefined) {
target[prop] = copy;
}
}
}
}
}
return target;
};
/**
* Return a deep copy of the source object or array.
*
* @returns Object or Array
* @private
*/
var _deepCopy = function(source) {
var copy, i, len, prop;
if (typeof source !== "object" || source == null) {
copy = source;
} else if (typeof source.length === "number") {
copy = [];
for (i = 0, len = source.length; i < len; i++) {
if (_hasOwn.call(source, i)) {
copy[i] = _deepCopy(source[i]);
}
}
} else {
copy = {};
for (prop in source) {
if (_hasOwn.call(source, prop)) {
copy[prop] = _deepCopy(source[prop]);
}
}
}
return copy;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to keep.
* The inverse of `_omit`, mostly. The big difference is that these properties do NOT need to be enumerable to
* be kept.
*
* @returns A new filtered object.
* @private
*/
var _pick = function(obj, keys) {
var newObj = {};
for (var i = 0, len = keys.length; i < len; i++) {
if (keys[i] in obj) {
newObj[keys[i]] = obj[keys[i]];
}
}
return newObj;
};
/**
* Makes a shallow copy of `obj` (like `_extend`) but filters its properties based on a list of `keys` to omit.
* The inverse of `_pick`.
*
* @returns A new filtered object.
* @private
*/
var _omit = function(obj, keys) {
var newObj = {};
for (var prop in obj) {
if (keys.indexOf(prop) === -1) {
newObj[prop] = obj[prop];
}
}
return newObj;
};
/**
* Remove all owned, enumerable properties from an object.
*
* @returns The original object without its owned, enumerable properties.
* @private
*/
var _deleteOwnProperties = function(obj) {
if (obj) {
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
delete obj[prop];
}
}
}
return obj;
};
/**
* Determine if an element is contained within another element.
*
* @returns Boolean
* @private
*/
var _containedBy = function(el, ancestorEl) {
if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
do {
if (el === ancestorEl) {
return true;
}
el = el.parentNode;
} while (el);
}
return false;
};
/**
* Get the URL path's parent directory.
*
* @returns String or `undefined`
* @private
*/
var _getDirPathOfUrl = function(url) {
var dir;
if (typeof url === "string" && url) {
dir = url.split("#")[0].split("?")[0];
dir = url.slice(0, url.lastIndexOf("/") + 1);
}
return dir;
};
/**
* Get the current script's URL by throwing an `Error` and analyzing it.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrlFromErrorStack = function(stack) {
var url, matches;
if (typeof stack === "string" && stack) {
matches = stack.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
if (matches && matches[1]) {
url = matches[1];
} else {
matches = stack.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
if (matches && matches[1]) {
url = matches[1];
}
}
}
return url;
};
/**
* Get the current script's URL by throwing an `Error` and analyzing it.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrlFromError = function() {
var url, err;
try {
throw new _Error();
} catch (e) {
err = e;
}
if (err) {
url = err.sourceURL || err.fileName || _getCurrentScriptUrlFromErrorStack(err.stack);
}
return url;
};
/**
* Get the current script's URL.
*
* @returns String or `undefined`
* @private
*/
var _getCurrentScriptUrl = function() {
var jsPath, scripts, i;
if (_document.currentScript && (jsPath = _document.currentScript.src)) {
return jsPath;
}
scripts = _document.getElementsByTagName("script");
if (scripts.length === 1) {
return scripts[0].src || undefined;
}
if ("readyState" in scripts[0]) {
for (i = scripts.length; i--; ) {
if (scripts[i].readyState === "interactive" && (jsPath = scripts[i].src)) {
return jsPath;
}
}
}
if (_document.readyState === "loading" && (jsPath = scripts[scripts.length - 1].src)) {
return jsPath;
}
if (jsPath = _getCurrentScriptUrlFromError()) {
return jsPath;
}
return undefined;
};
/**
* Get the unanimous parent directory of ALL script tags.
* If any script tags are either (a) inline or (b) from differing parent
* directories, this method must return `undefined`.
*
* @returns String or `undefined`
* @private
*/
var _getUnanimousScriptParentDir = function() {
var i, jsDir, jsPath, scripts = _document.getElementsByTagName("script");
for (i = scripts.length; i--; ) {
if (!(jsPath = scripts[i].src)) {
jsDir = null;
break;
}
jsPath = _getDirPathOfUrl(jsPath);
if (jsDir == null) {
jsDir = jsPath;
} else if (jsDir !== jsPath) {
jsDir = null;
break;
}
}
return jsDir || undefined;
};
/**
* Get the presumed location of the "ZeroClipboard.swf" file, based on the location
* of the executing JavaScript file (e.g. "ZeroClipboard.js", etc.).
*
* @returns String
* @private
*/
var _getDefaultSwfPath = function() {
var jsDir = _getDirPathOfUrl(_getCurrentScriptUrl()) || _getUnanimousScriptParentDir() || "";
return jsDir + "ZeroClipboard.swf";
};
/**
* Keep track of the state of the Flash object.
* @private
*/
var _flashState = {
bridge: null,
version: "0.0.0",
pluginType: "unknown",
disabled: null,
outdated: null,
unavailable: null,
deactivated: null,
overdue: null,
ready: null
};
/**
* The minimum Flash Player version required to use ZeroClipboard completely.
* @readonly
* @private
*/
var _minimumFlashVersion = "11.0.0";
/**
* Keep track of all event listener registrations.
* @private
*/
var _handlers = {};
/**
* Keep track of the currently activated element.
* @private
*/
var _currentElement;
/**
* Keep track of data for the pending clipboard transaction.
* @private
*/
var _clipData = {};
/**
* Keep track of data formats for the pending clipboard transaction.
* @private
*/
var _clipDataFormatMap = null;
/**
* The `message` store for events
* @private
*/
var _eventMessages = {
ready: "Flash communication is established",
error: {
"flash-disabled": "Flash is disabled or not installed",
"flash-outdated": "Flash is too outdated to support ZeroClipboard",
"flash-unavailable": "Flash is unable to communicate bidirectionally with JavaScript",
"flash-deactivated": "Flash is too outdated for your browser and/or is configured as click-to-activate",
"flash-overdue": "Flash communication was established but NOT within the acceptable time limit"
}
};
/**
* ZeroClipboard configuration defaults for the Core module.
* @private
*/
var _globalConfig = {
swfPath: _getDefaultSwfPath(),
trustedDomains: window.location.host ? [ window.location.host ] : [],
cacheBust: true,
forceEnhancedClipboard: false,
flashLoadTimeout: 3e4,
autoActivate: true,
bubbleEvents: true,
containerId: "global-zeroclipboard-html-bridge",
containerClass: "global-zeroclipboard-container",
swfObjectId: "global-zeroclipboard-flash-bridge",
hoverClass: "zeroclipboard-is-hover",
activeClass: "zeroclipboard-is-active",
forceHandCursor: false,
title: null,
zIndex: 999999999
};
/**
* The underlying implementation of `ZeroClipboard.config`.
* @private
*/
var _config = function(options) {
if (typeof options === "object" && options !== null) {
for (var prop in options) {
if (_hasOwn.call(options, prop)) {
if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) {
_globalConfig[prop] = options[prop];
} else if (_flashState.bridge == null) {
if (prop === "containerId" || prop === "swfObjectId") {
if (_isValidHtml4Id(options[prop])) {
_globalConfig[prop] = options[prop];
} else {
throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
}
} else {
_globalConfig[prop] = options[prop];
}
}
}
}
}
if (typeof options === "string" && options) {
if (_hasOwn.call(_globalConfig, options)) {
return _globalConfig[options];
}
return;
}
return _deepCopy(_globalConfig);
};
/**
* The underlying implementation of `ZeroClipboard.state`.
* @private
*/
var _state = function() {
return {
browser: _pick(_navigator, [ "userAgent", "platform", "appName" ]),
flash: _omit(_flashState, [ "bridge" ]),
zeroclipboard: {
version: ZeroClipboard.version,
config: ZeroClipboard.config()
}
};
};
/**
* The underlying implementation of `ZeroClipboard.isFlashUnusable`.
* @private
*/
var _isFlashUnusable = function() {
return !!(_flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.deactivated);
};
/**
* The underlying implementation of `ZeroClipboard.on`.
* @private
*/
var _on = function(eventType, listener) {
var i, len, events, added = {};
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.on(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].replace(/^on/, "");
added[eventType] = true;
if (!_handlers[eventType]) {
_handlers[eventType] = [];
}
_handlers[eventType].push(listener);
}
if (added.ready && _flashState.ready) {
ZeroClipboard.emit({
type: "ready"
});
}
if (added.error) {
var errorTypes = [ "disabled", "outdated", "unavailable", "deactivated", "overdue" ];
for (i = 0, len = errorTypes.length; i < len; i++) {
if (_flashState[errorTypes[i]] === true) {
ZeroClipboard.emit({
type: "error",
name: "flash-" + errorTypes[i]
});
break;
}
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.off`.
* @private
*/
var _off = function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers;
if (arguments.length === 0) {
events = _keys(_handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.split(/\s+/);
} else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
for (i in eventType) {
if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
ZeroClipboard.off(i, eventType[i]);
}
}
}
if (events && events.length) {
for (i = 0, len = events.length; i < len; i++) {
eventType = events[i].toLowerCase().replace(/^on/, "");
perEventHandlers = _handlers[eventType];
if (perEventHandlers && perEventHandlers.length) {
if (listener) {
foundIndex = perEventHandlers.indexOf(listener);
while (foundIndex !== -1) {
perEventHandlers.splice(foundIndex, 1);
foundIndex = perEventHandlers.indexOf(listener, foundIndex);
}
} else {
perEventHandlers.length = 0;
}
}
}
}
return ZeroClipboard;
};
/**
* The underlying implementation of `ZeroClipboard.handlers`.
* @private
*/
var _listeners = function(eventType) {
var copy;
if (typeof eventType === "string" && eventType) {
copy = _deepCopy(_handlers[eventType]) || null;
} else {
copy = _deepCopy(_handlers);
}
return copy;
};
/**
* The underlying implementation of `ZeroClipboard.emit`.
* @private
*/
var _emit = function(event) {
var eventCopy, returnVal, tmp;
event = _createEvent(event);
if (!event) {
return;
}
if (_preprocessEvent(event)) {
return;
}
if (event.type === "ready" && _flashState.overdue === true) {
return ZeroClipboard.emit({
type: "error",
name: "flash-overdue"
});
}
eventCopy = _extend({}, event);
_dispatchCallbacks.call(this, eventCopy);
if (event.type === "copy") {
tmp = _mapClipDataToFlash(_clipData);
returnVal = tmp.data;
_clipDataFormatMap = tmp.formatMap;
}
return returnVal;
};
/**
* The underlying implementation of `ZeroClipboard.create`.
* @private
*/
var _create = function() {
if (typeof _flashState.ready !== "boolean") {
_flashState.ready = false;
}
if (!ZeroClipboard.isFlashUnusable() && _flashState.bridge === null) {
var maxWait = _globalConfig.flashLoadTimeout;
if (typeof maxWait === "number" && maxWait >= 0) {
_setTimeout(function() {
if (typeof _flashState.deactivated !== "boolean") {
_flashState.deactivated = true;
}
if (_flashState.deactivated === true) {
ZeroClipboard.emit({
type: "error",
name: "flash-deactivated"
});
}
}, maxWait);
}
_flashState.overdue = false;
_embedSwf();
}
};
/**
* The underlying implementation of `ZeroClipboard.destroy`.
* @private
*/
var _destroy = function() {
ZeroClipboard.clearData();
ZeroClipboard.blur();
ZeroClipboard.emit("destroy");
_unembedSwf();
ZeroClipboard.off();
};
/**
* The underlying implementation of `ZeroClipboard.setData`.
* @private
*/
var _setData = function(format, data) {
var dataObj;
if (typeof format === "object" && format && typeof data === "undefined") {
dataObj = format;
ZeroClipboard.clearData();
} else if (typeof format === "string" && format) {
dataObj = {};
dataObj[format] = data;
} else {
return;
}
for (var dataFormat in dataObj) {
if (typeof dataFormat === "string" && dataFormat && _hasOwn.call(dataObj, dataFormat) && typeof dataObj[dataFormat] === "string" && dataObj[dataFormat]) {
_clipData[dataFormat] = dataObj[dataFormat];
}
}
};
/**
* The underlying implementation of `ZeroClipboard.clearData`.
* @private
*/
var _clearData = function(format) {
if (typeof format === "undefined") {
_deleteOwnProperties(_clipData);
_clipDataFormatMap = null;
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
delete _clipData[format];
}
};
/**
* The underlying implementation of `ZeroClipboard.getData`.
* @private
*/
var _getData = function(format) {
if (typeof format === "undefined") {
return _deepCopy(_clipData);
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
return _clipData[format];
}
};
/**
* The underlying implementation of `ZeroClipboard.focus`/`ZeroClipboard.activate`.
* @private
*/
var _focus = function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.activeClass);
if (_currentElement !== element) {
_removeClass(_currentElement, _globalConfig.hoverClass);
}
}
_currentElement = element;
_addClass(element, _globalConfig.hoverClass);
var newTitle = element.getAttribute("title") || _globalConfig.title;
if (typeof newTitle === "string" && newTitle) {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.setAttribute("title", newTitle);
}
}
var useHandCursor = _globalConfig.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
_setHandCursor(useHandCursor);
_reposition();
};
/**
* The underlying implementation of `ZeroClipboard.blur`/`ZeroClipboard.deactivate`.
* @private
*/
var _blur = function() {
var htmlBridge = _getHtmlBridge(_flashState.bridge);
if (htmlBridge) {
htmlBridge.removeAttribute("title");
htmlBridge.style.left = "0px";
htmlBridge.style.top = "-9999px";
htmlBridge.style.width = "1px";
htmlBridge.style.top = "1px";
}
if (_currentElement) {
_removeClass(_currentElement, _globalConfig.hoverClass);
_removeClass(_currentElement, _globalConfig.activeClass);
_currentElement = null;
}
};
/**
* The underlying implementation of `ZeroClipboard.activeElement`.
* @private
*/
var _activeElement = function() {
return _currentElement || null;
};
/**
* Check if a value is a valid HTML4 `ID` or `Name` token.
* @private
*/
var _isValidHtml4Id = function(id) {
return typeof id === "string" && id && /^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(id);
};
/**
* Create or update an `event` object, based on the `eventType`.
* @private
*/
var _createEvent = function(event) {
var eventType;
if (typeof event === "string" && event) {
eventType = event;
event = {};
} else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
eventType = event.type;
}
if (!eventType) {
return;
}
_extend(event, {
type: eventType.toLowerCase(),
target: event.target || _currentElement || null,
relatedTarget: event.relatedTarget || null,
currentTarget: _flashState && _flashState.bridge || null,
timeStamp: event.timeStamp || _now() || null
});
var msg = _eventMessages[event.type];
if (event.type === "error" && event.name && msg) {
msg = msg[event.name];
}
if (msg) {
event.message = msg;
}
if (event.type === "ready") {
_extend(event, {
target: null,
version: _flashState.version
});
}
if (event.type === "error") {
if (/^flash-(disabled|outdated|unavailable|deactivated|overdue)$/.test(event.name)) {
_extend(event, {
target: null,
minimumVersion: _minimumFlashVersion
});
}
if (/^flash-(outdated|unavailable|deactivated|overdue)$/.test(event.name)) {
_extend(event, {
version: _flashState.version
});
}
}
if (event.type === "copy") {
event.clipboardData = {
setData: ZeroClipboard.setData,
clearData: ZeroClipboard.clearData
};
}
if (event.type === "aftercopy") {
event = _mapClipResultsFromFlash(event, _clipDataFormatMap);
}
if (event.target && !event.relatedTarget) {
event.relatedTarget = _getRelatedTarget(event.target);
}
event = _addMouseData(event);
return event;
};
/**
* Get a relatedTarget from the target's `data-clipboard-target` attribute
* @private
*/
var _getRelatedTarget = function(targetEl) {
var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
};
/**
* Add element and position data to `MouseEvent` instances
* @private
*/
var _addMouseData = function(event) {
if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
var srcElement = event.target;
var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
var pos = _getDOMObjectPosition(srcElement);
var screenLeft = _window.screenLeft || _window.screenX || 0;
var screenTop = _window.screenTop || _window.screenY || 0;
var scrollLeft = _document.body.scrollLeft + _document.documentElement.scrollLeft;
var scrollTop = _document.body.scrollTop + _document.documentElement.scrollTop;
var pageX = pos.left + (typeof event._stageX === "number" ? event._stageX : 0);
var pageY = pos.top + (typeof event._stageY === "number" ? event._stageY : 0);
var clientX = pageX - scrollLeft;
var clientY = pageY - scrollTop;
var screenX = screenLeft + clientX;
var screenY = screenTop + clientY;
var moveX = typeof event.movementX === "number" ? event.movementX : 0;
var moveY = typeof event.movementY === "number" ? event.movementY : 0;
delete event._stageX;
delete event._stageY;
_extend(event, {
srcElement: srcElement,
fromElement: fromElement,
toElement: toElement,
screenX: screenX,
screenY: screenY,
pageX: pageX,
pageY: pageY,
clientX: clientX,
clientY: clientY,
x: clientX,
y: clientY,
movementX: moveX,
movementY: moveY,
offsetX: 0,
offsetY: 0,
layerX: 0,
layerY: 0
});
}
return event;
};
/**
* Determine if an event's registered handlers should be execute synchronously or asynchronously.
*
* @returns {boolean}
* @private
*/
var _shouldPerformAsync = function(event) {
var eventType = event && typeof event.type === "string" && event.type || "";
return !/^(?:(?:before)?copy|destroy)$/.test(eventType);
};
/**
* Control if a callback should be executed asynchronously or not.
*
* @returns `undefined`
* @private
*/
var _dispatchCallback = function(func, context, args, async) {
if (async) {
_setTimeout(function() {
func.apply(context, args);
}, 0);
} else {
func.apply(context, args);
}
};
/**
* Handle the actual dispatching of events to client instances.
*
* @returns `undefined`
* @private
*/
var _dispatchCallbacks = function(event) {
if (!(typeof event === "object" && event && event.type)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = _handlers["*"] || [];
var specificTypeHandlers = _handlers[event.type] || [];
var handlers = wildcardTypeHandlers.concat(specificTypeHandlers);
if (handlers && handlers.length) {
var i, len, func, context, eventCopy, originalContext = this;
for (i = 0, len = handlers.length; i < len; i++) {
func = handlers[i];
context = originalContext;
if (typeof func === "string" && typeof _window[func] === "function") {
func = _window[func];
}
if (typeof func === "object" && func && typeof func.handleEvent === "function") {
context = func;
func = func.handleEvent;
}
if (typeof func === "function") {
eventCopy = _extend({}, event);
_dispatchCallback(func, context, [ eventCopy ], async);
}
}
}
return this;
};
/**
* Preprocess any special behaviors, reactions, or state changes after receiving this event.
* Executes only once per event emitted, NOT once per client.
* @private
*/
var _preprocessEvent = function(event) {
var element = event.target || _currentElement || null;
var sourceIsSwf = event._source === "swf";
delete event._source;
var flashErrorNames = [ "flash-disabled", "flash-outdated", "flash-unavailable", "flash-deactivated", "flash-overdue" ];
switch (event.type) {
case "error":
if (flashErrorNames.indexOf(event.name) !== -1) {
_extend(_flashState, {
disabled: event.name === "flash-disabled",
outdated: event.name === "flash-outdated",
unavailable: event.name === "flash-unavailable",
deactivated: event.name === "flash-deactivated",
overdue: event.name === "flash-overdue",
ready: false
});
}
break;
case "ready":
var wasDeactivated = _flashState.deactivated === true;
_extend(_flashState, {
disabled: false,
outdated: false,
unavailable: false,
deactivated: false,
overdue: wasDeactivated,
ready: !wasDeactivated
});
break;
case "copy":
var textContent, htmlContent, targetEl = event.relatedTarget;
if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
if (htmlContent !== textContent) {
event.clipboardData.setData("text/html", htmlContent);
}
} else if (!_clipData["text/plain"] && event.target && (textContent = event.target.getAttribute("data-clipboard-text"))) {
event.clipboardData.clearData();
event.clipboardData.setData("text/plain", textContent);
}
break;
case "aftercopy":
ZeroClipboard.clearData();
if (element && element !== _safeActiveElement() && element.focus) {
element.focus();
}
break;
case "_mouseover":
ZeroClipboard.focus(element);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
_fireMouseEvent(_extend({}, event, {
type: "mouseenter",
bubbles: false,
cancelable: false
}));
}
_fireMouseEvent(_extend({}, event, {
type: "mouseover"
}));
}
break;
case "_mouseout":
ZeroClipboard.blur();
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
_fireMouseEvent(_extend({}, event, {
type: "mouseleave",
bubbles: false,
cancelable: false
}));
}
_fireMouseEvent(_extend({}, event, {
type: "mouseout"
}));
}
break;
case "_mousedown":
_addClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_mouseup":
_removeClass(element, _globalConfig.activeClass);
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
case "_click":
case "_mousemove":
if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
_fireMouseEvent(_extend({}, event, {
type: event.type.slice(1)
}));
}
break;
}
if (/^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
return true;
}
};
/**
* Dispatch a synthetic MouseEvent.
*
* @returns `undefined`
* @private
*/
var _fireMouseEvent = function(event) {
if (!(event && typeof event.type === "string" && event)) {
return;
}
var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
view: doc.defaultView || _window,
canBubble: true,
cancelable: true,
detail: event.type === "click" ? 1 : 0,
button: typeof event.which === "number" ? event.which - 1 : typeof event.button === "number" ? event.button : doc.createEvent ? 0 : 1
}, args = _extend(defaults, event);
if (!target) {
return;
}
if (doc.createEvent && target.dispatchEvent) {
args = [ args.type, args.canBubble, args.cancelable, args.view, args.detail, args.screenX, args.screenY, args.clientX, args.clientY, args.ctrlKey, args.altKey, args.shiftKey, args.metaKey, args.button, args.relatedTarget ];
e = doc.createEvent("MouseEvents");
if (e.initMouseEvent) {
e.initMouseEvent.apply(e, args);
e._source = "js";
target.dispatchEvent(e);
}
}
};
/**
* Create the HTML bridge element to embed the Flash object into.
* @private
*/
var _createHtmlBridge = function() {
var container = _document.createElement("div");
container.id = _globalConfig.containerId;
container.className = _globalConfig.containerClass;
container.style.position = "absolute";
container.style.left = "0px";
container.style.top = "-9999px";
container.style.width = "1px";
container.style.height = "1px";
container.style.zIndex = "" + _getSafeZIndex(_globalConfig.zIndex);
return container;
};
/**
* Get the HTML element container that wraps the Flash bridge object/element.
* @private
*/
var _getHtmlBridge = function(flashBridge) {
var htmlBridge = flashBridge && flashBridge.parentNode;
while (htmlBridge && htmlBridge.nodeName === "OBJECT" && htmlBridge.parentNode) {
htmlBridge = htmlBridge.parentNode;
}
return htmlBridge || null;
};
/**
* Create the SWF object.
*
* @returns The SWF object reference.
* @private
*/
var _embedSwf = function() {
var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
if (!flashBridge) {
var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
var flashvars = _vars(_globalConfig);
var swfUrl = _globalConfig.swfPath + _cacheBust(_globalConfig.swfPath, _globalConfig);
container = _createHtmlBridge();
var divToBeReplaced = _document.createElement("div");
container.appendChild(divToBeReplaced);
_document.body.appendChild(container);
var tmpDiv = _document.createElement("div");
var oldIE = _flashState.pluginType === "activex";
tmpDiv.innerHTML = '<object id="' + _globalConfig.swfObjectId + '" name="' + _globalConfig.swfObjectId + '" ' + 'width="100%" height="100%" ' + (oldIE ? 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' : 'type="application/x-shockwave-flash" data="' + swfUrl + '"') + ">" + (oldIE ? '<param name="movie" value="' + swfUrl + '"/>' : "") + '<param name="allowScriptAccess" value="' + allowScriptAccess + '"/>' + '<param name="allowNetworking" value="' + allowNetworking + '"/>' + '<param name="menu" value="false"/>' + '<param name="wmode" value="transparent"/>' + '<param name="flashvars" value="' + flashvars + '"/>' + "</object>";
flashBridge = tmpDiv.firstChild;
tmpDiv = null;
flashBridge.ZeroClipboard = ZeroClipboard;
container.replaceChild(flashBridge, divToBeReplaced);
}
if (!flashBridge) {
flashBridge = _document[_globalConfig.swfObjectId];
if (flashBridge && (len = flashBridge.length)) {
flashBridge = flashBridge[len - 1];
}
if (!flashBridge && container) {
flashBridge = container.firstChild;
}
}
_flashState.bridge = flashBridge || null;
return flashBridge;
};
/**
* Destroy the SWF object.
* @private
*/
var _unembedSwf = function() {
var flashBridge = _flashState.bridge;
if (flashBridge) {
var htmlBridge = _getHtmlBridge(flashBridge);
if (htmlBridge) {
if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
flashBridge.style.display = "none";
(function removeSwfFromIE() {
if (flashBridge.readyState === 4) {
for (var prop in flashBridge) {
if (typeof flashBridge[prop] === "function") {
flashBridge[prop] = null;
}
}
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
} else {
_setTimeout(removeSwfFromIE, 10);
}
})();
} else {
if (flashBridge.parentNode) {
flashBridge.parentNode.removeChild(flashBridge);
}
if (htmlBridge.parentNode) {
htmlBridge.parentNode.removeChild(htmlBridge);
}
}
}
_flashState.ready = null;
_flashState.bridge = null;
_flashState.deactivated = null;
}
};
/**
* Map the data format names of the "clipData" to Flash-friendly names.
*
* @returns A new transformed object.
* @private
*/
var _mapClipDataToFlash = function(clipData) {
var newClipData = {}, formatMap = {};
if (!(typeof clipData === "object" && clipData)) {
return;
}
for (var dataFormat in clipData) {
if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
switch (dataFormat.toLowerCase()) {
case "text/plain":
case "text":
case "air:text":
case "flash:text":
newClipData.text = clipData[dataFormat];
formatMap.text = dataFormat;
break;
case "text/html":
case "html":
case "air:html":
case "flash:html":
newClipData.html = clipData[dataFormat];
formatMap.html = dataFormat;
break;
case "application/rtf":
case "text/rtf":
case "rtf":
case "richtext":
case "air:rtf":
case "flash:rtf":
newClipData.rtf = clipData[dataFormat];
formatMap.rtf = dataFormat;
break;
default:
break;
}
}
}
return {
data: newClipData,
formatMap: formatMap
};
};
/**
* Map the data format names from Flash-friendly names back to their original "clipData" names (via a format mapping).
*
* @returns A new transformed object.
* @private
*/
var _mapClipResultsFromFlash = function(clipResults, formatMap) {
if (!(typeof clipResults === "object" && clipResults && typeof formatMap === "object" && formatMap)) {
return clipResults;
}
var newResults = {};
for (var prop in clipResults) {
if (_hasOwn.call(clipResults, prop)) {
if (prop !== "success" && prop !== "data") {
newResults[prop] = clipResults[prop];
continue;
}
newResults[prop] = {};
var tmpHash = clipResults[prop];
for (var dataFormat in tmpHash) {
if (dataFormat && _hasOwn.call(tmpHash, dataFormat) && _hasOwn.call(formatMap, dataFormat)) {
newResults[prop][formatMap[dataFormat]] = tmpHash[dataFormat];
}
}
}
}
return newResults;
};
/**
* Will look at a path, and will create a "?noCache={time}" or "&noCache={time}"
* query param string to return. Does NOT append that string to the original path.
* This is useful because ExternalInterface often breaks when a Flash SWF is cached.
*
* @returns The `noCache` query param with necessary "?"/"&" prefix.
* @private
*/
var _cacheBust = function(path, options) {
var cacheBust = options == null || options && options.cacheBust === true;
if (cacheBust) {
return (path.indexOf("?") === -1 ? "?" : "&") + "noCache=" + _now();
} else {
return "";
}
};
/**
* Creates a query string for the FlashVars param.
* Does NOT include the cache-busting query param.
*
* @returns FlashVars query string
* @private
*/
var _vars = function(options) {
var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
if (options.trustedDomains) {
if (typeof options.trustedDomains === "string") {
domains = [ options.trustedDomains ];
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
domains = options.trustedDomains;
}
}
if (domains && domains.length) {
for (i = 0, len = domains.length; i < len; i++) {
if (_hasOwn.call(domains, i) && domains[i] && typeof domains[i] === "string") {
domain = _extractDomain(domains[i]);
if (!domain) {
continue;
}
if (domain === "*") {
trustedOriginsExpanded.length = 0;
trustedOriginsExpanded.push(domain);
break;
}
trustedOriginsExpanded.push.apply(trustedOriginsExpanded, [ domain, "//" + domain, _window.location.protocol + "//" + domain ]);
}
}
}
if (trustedOriginsExpanded.length) {
str += "trustedOrigins=" + _encodeURIComponent(trustedOriginsExpanded.join(","));
}
if (options.forceEnhancedClipboard === true) {
str += (str ? "&" : "") + "forceEnhancedClipboard=true";
}
if (typeof options.swfObjectId === "string" && options.swfObjectId) {
str += (str ? "&" : "") + "swfObjectId=" + _encodeURIComponent(options.swfObjectId);
}
return str;
};
/**
* Extract the domain (e.g. "github.com") from an origin (e.g. "https://github.com") or
* URL (e.g. "https://github.com/zeroclipboard/zeroclipboard/").
*
* @returns the domain
* @private
*/
var _extractDomain = function(originOrUrl) {
if (originOrUrl == null || originOrUrl === "") {
return null;
}
originOrUrl = originOrUrl.replace(/^\s+|\s+$/g, "");
if (originOrUrl === "") {
return null;
}
var protocolIndex = originOrUrl.indexOf("//");
originOrUrl = protocolIndex === -1 ? originOrUrl : originOrUrl.slice(protocolIndex + 2);
var pathIndex = originOrUrl.indexOf("/");
originOrUrl = pathIndex === -1 ? originOrUrl : protocolIndex === -1 || pathIndex === 0 ? null : originOrUrl.slice(0, pathIndex);
if (originOrUrl && originOrUrl.slice(-4).toLowerCase() === ".swf") {
return null;
}
return originOrUrl || null;
};
/**
* Set `allowScriptAccess` based on `trustedDomains` and `window.location.host` vs. `swfPath`.
*
* @returns The appropriate script access level.
* @private
*/
var _determineScriptAccess = function() {
var _extractAllDomains = function(origins) {
var i, len, tmp, resultsArray = [];
if (typeof origins === "string") {
origins = [ origins ];
}
if (!(typeof origins === "object" && origins && typeof origins.length === "number")) {
return resultsArray;
}
for (i = 0, len = origins.length; i < len; i++) {
if (_hasOwn.call(origins, i) && (tmp = _extractDomain(origins[i]))) {
if (tmp === "*") {
resultsArray.length = 0;
resultsArray.push("*");
break;
}
if (resultsArray.indexOf(tmp) === -1) {
resultsArray.push(tmp);
}
}
}
return resultsArray;
};
return function(currentDomain, configOptions) {
var swfDomain = _extractDomain(configOptions.swfPath);
if (swfDomain === null) {
swfDomain = currentDomain;
}
var trustedDomains = _extractAllDomains(configOptions.trustedDomains);
var len = trustedDomains.length;
if (len > 0) {
if (len === 1 && trustedDomains[0] === "*") {
return "always";
}
if (trustedDomains.indexOf(currentDomain) !== -1) {
if (len === 1 && currentDomain === swfDomain) {
return "sameDomain";
}
return "always";
}
}
return "never";
};
}();
/**
* Get the currently active/focused DOM element.
*
* @returns the currently active/focused element, or `null`
* @private
*/
var _safeActiveElement = function() {
try {
return _document.activeElement;
} catch (err) {
return null;
}
};
/**
* Add a class to an element, if it doesn't already have it.
*
* @returns The element, with its new class added.
* @private
*/
var _addClass = function(element, value) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.classList) {
if (!element.classList.contains(value)) {
element.classList.add(value);
}
return element;
}
if (value && typeof value === "string") {
var classNames = (value || "").split(/\s+/);
if (element.nodeType === 1) {
if (!element.className) {
element.className = value;
} else {
var className = " " + element.className + " ", setClass = element.className;
for (var c = 0, cl = classNames.length; c < cl; c++) {
if (className.indexOf(" " + classNames[c] + " ") < 0) {
setClass += " " + classNames[c];
}
}
element.className = setClass.replace(/^\s+|\s+$/g, "");
}
}
}
return element;
};
/**
* Remove a class from an element, if it has it.
*
* @returns The element, with its class removed.
* @private
*/
var _removeClass = function(element, value) {
if (!element || element.nodeType !== 1) {
return element;
}
if (element.classList) {
if (element.classList.contains(value)) {
element.classList.remove(value);
}
return element;
}
if (typeof value === "string" && value) {
var classNames = value.split(/\s+/);
if (element.nodeType === 1 && element.className) {
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
for (var c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(" " + classNames[c] + " ", " ");
}
element.className = className.replace(/^\s+|\s+$/g, "");
}
}
return element;
};
/**
* Attempt to interpret the element's CSS styling. If `prop` is `"cursor"`,
* then we assume that it should be a hand ("pointer") cursor if the element
* is an anchor element ("a" tag).
*
* @returns The computed style property.
* @private
*/
var _getStyle = function(el, prop) {
var value = _window.getComputedStyle(el, null).getPropertyValue(prop);
if (prop === "cursor") {
if (!value || value === "auto") {
if (el.nodeName === "A") {
return "pointer";
}
}
}
return value;
};
/**
* Get the zoom factor of the browser. Always returns `1.0`, except at
* non-default zoom levels in IE<8 and some older versions of WebKit.
*
* @returns Floating unit percentage of the zoom factor (e.g. 150% = `1.5`).
* @private
*/
var _getZoomFactor = function() {
var rect, physicalWidth, logicalWidth, zoomFactor = 1;
if (typeof _document.body.getBoundingClientRect === "function") {
rect = _document.body.getBoundingClientRect();
physicalWidth = rect.right - rect.left;
logicalWidth = _document.body.offsetWidth;
zoomFactor = _round(physicalWidth / logicalWidth * 100) / 100;
}
return zoomFactor;
};
/**
* Get the DOM positioning info of an element.
*
* @returns Object containing the element's position, width, and height.
* @private
*/
var _getDOMObjectPosition = function(obj) {
var info = {
left: 0,
top: 0,
width: 0,
height: 0
};
if (obj.getBoundingClientRect) {
var rect = obj.getBoundingClientRect();
var pageXOffset, pageYOffset, zoomFactor;
if ("pageXOffset" in _window && "pageYOffset" in _window) {
pageXOffset = _window.pageXOffset;
pageYOffset = _window.pageYOffset;
} else {
zoomFactor = _getZoomFactor();
pageXOffset = _round(_document.documentElement.scrollLeft / zoomFactor);
pageYOffset = _round(_document.documentElement.scrollTop / zoomFactor);
}
var leftBorderWidth = _document.documentElement.clientLeft || 0;
var topBorderWidth = _document.documentElement.clientTop || 0;
info.left = rect.left + pageXOffset - leftBorderWidth;
info.top = rect.top + pageYOffset - topBorderWidth;
info.width = "width" in rect ? rect.width : rect.right - rect.left;
info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
}
return info;
};
/**
* Reposition the Flash object to cover the currently activated element.
*
* @returns `undefined`
* @private
*/
var _reposition = function() {
var htmlBridge;
if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
var pos = _getDOMObjectPosition(_currentElement);
_extend(htmlBridge.style, {
width: pos.width + "px",
height: pos.height + "px",
top: pos.top + "px",
left: pos.left + "px",
zIndex: "" + _getSafeZIndex(_globalConfig.zIndex)
});
}
};
/**
* Sends a signal to the Flash object to display the hand cursor if `true`.
*
* @returns `undefined`
* @private
*/
var _setHandCursor = function(enabled) {
if (_flashState.ready === true) {
if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
_flashState.bridge.setHandCursor(enabled);
} else {
_flashState.ready = false;
}
}
};
/**
* Get a safe value for `zIndex`
*
* @returns an integer, or "auto"
* @private
*/
var _getSafeZIndex = function(val) {
if (/^(?:auto|inherit)$/.test(val)) {
return val;
}
var zIndex;
if (typeof val === "number" && !_isNaN(val)) {
zIndex = val;
} else if (typeof val === "string") {
zIndex = _getSafeZIndex(_parseInt(val, 10));
}
return typeof zIndex === "number" ? zIndex : "auto";
};
/**
* Detect the Flash Player status, version, and plugin type.
*
* @see {@link https://code.google.com/p/doctype-mirror/wiki/ArticleDetectFlash#The_code}
* @see {@link http://stackoverflow.com/questions/12866060/detecting-pepper-ppapi-flash-with-javascript}
*
* @returns `undefined`
* @private
*/
var _detectFlashSupport = function(ActiveXObject) {
var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
/**
* Derived from Apple's suggested sniffer.
* @param {String} desc e.g. "Shockwave Flash 7.0 r61"
* @returns {String} "7.0.61"
* @private
*/
function parseFlashVersion(desc) {
var matches = desc.match(/[\d]+/g);
matches.length = 3;
return matches.join(".");
}
function isPepperFlash(flashPlayerFileName) {
return !!flashPlayerFileName && (flashPlayerFileName = flashPlayerFileName.toLowerCase()) && (/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(flashPlayerFileName) || flashPlayerFileName.slice(-13) === "chrome.plugin");
}
function inspectPlugin(plugin) {
if (plugin) {
hasFlash = true;
if (plugin.version) {
flashVersion = parseFlashVersion(plugin.version);
}
if (!flashVersion && plugin.description) {
flashVersion = parseFlashVersion(plugin.description);
}
if (plugin.filename) {
isPPAPI = isPepperFlash(plugin.filename);
}
}
}
if (_navigator.plugins && _navigator.plugins.length) {
plugin = _navigator.plugins["Shockwave Flash"];
inspectPlugin(plugin);
if (_navigator.plugins["Shockwave Flash 2.0"]) {
hasFlash = true;
flashVersion = "2.0.0.11";
}
} else if (_navigator.mimeTypes && _navigator.mimeTypes.length) {
mimeType = _navigator.mimeTypes["application/x-shockwave-flash"];
plugin = mimeType && mimeType.enabledPlugin;
inspectPlugin(plugin);
} else if (typeof ActiveXObject !== "undefined") {
isActiveX = true;
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e1) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
hasFlash = true;
flashVersion = "6.0.21";
} catch (e2) {
try {
ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
hasFlash = true;
flashVersion = parseFlashVersion(ax.GetVariable("$version"));
} catch (e3) {
isActiveX = false;
}
}
}
}
_flashState.disabled = hasFlash !== true;
_flashState.outdated = flashVersion && _parseFloat(flashVersion) < _parseFloat(_minimumFlashVersion);
_flashState.version = flashVersion || "0.0.0";
_flashState.pluginType = isPPAPI ? "pepper" : isActiveX ? "activex" : hasFlash ? "netscape" : "unknown";
};
/**
* Invoke the Flash detection algorithms immediately upon inclusion so we're not waiting later.
*/
_detectFlashSupport(_ActiveXObject);
/**
* A shell constructor for `ZeroClipboard` client instances.
*
* @constructor
*/
var ZeroClipboard = function() {
if (!(this instanceof ZeroClipboard)) {
return new ZeroClipboard();
}
if (typeof ZeroClipboard._createClient === "function") {
ZeroClipboard._createClient.apply(this, _args(arguments));
}
};
/**
* The ZeroClipboard library's version number.
*
* @static
* @readonly
* @property {string}
*/
_defineProperty(ZeroClipboard, "version", {
value: "2.1.4",
writable: false,
configurable: true,
enumerable: true
});
/**
* Update or get a copy of the ZeroClipboard global configuration.
* Returns a copy of the current/updated configuration.
*
* @returns Object
* @static
*/
ZeroClipboard.config = function() {
return _config.apply(this, _args(arguments));
};
/**
* Diagnostic method that describes the state of the browser, Flash Player, and ZeroClipboard.
*
* @returns Object
* @static
*/
ZeroClipboard.state = function() {
return _state.apply(this, _args(arguments));
};
/**
* Check if Flash is unusable for any reason: disabled, outdated, deactivated, etc.
*
* @returns Boolean
* @static
*/
ZeroClipboard.isFlashUnusable = function() {
return _isFlashUnusable.apply(this, _args(arguments));
};
/**
* Register an event listener.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.on = function() {
return _on.apply(this, _args(arguments));
};
/**
* Unregister an event listener.
* If no `listener` function/object is provided, it will unregister all listeners for the provided `eventType`.
* If no `eventType` is provided, it will unregister all listeners for every event type.
*
* @returns `ZeroClipboard`
* @static
*/
ZeroClipboard.off = function() {
return _off.apply(this, _args(arguments));
};
/**
* Retrieve event listeners for an `eventType`.
* If no `eventType` is provided, it will retrieve all listeners for every event type.
*
* @returns array of listeners for the `eventType`; if no `eventType`, then a map/hash object of listeners for all event types; or `null`
*/
ZeroClipboard.handlers = function() {
return _listeners.apply(this, _args(arguments));
};
/**
* Event emission receiver from the Flash object, forwarding to any registered JavaScript event listeners.
*
* @returns For the "copy" event, returns the Flash-friendly "clipData" object; otherwise `undefined`.
* @static
*/
ZeroClipboard.emit = function() {
return _emit.apply(this, _args(arguments));
};
/**
* Create and embed the Flash object.
*
* @returns The Flash object
* @static
*/
ZeroClipboard.create = function() {
return _create.apply(this, _args(arguments));
};
/**
* Self-destruct and clean up everything, including the embedded Flash object.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.destroy = function() {
return _destroy.apply(this, _args(arguments));
};
/**
* Set the pending data for clipboard injection.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.setData = function() {
return _setData.apply(this, _args(arguments));
};
/**
* Clear the pending data for clipboard injection.
* If no `format` is provided, all pending data formats will be cleared.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.clearData = function() {
return _clearData.apply(this, _args(arguments));
};
/**
* Get a copy of the pending data for clipboard injection.
* If no `format` is provided, a copy of ALL pending data formats will be returned.
*
* @returns `String` or `Object`
* @static
*/
ZeroClipboard.getData = function() {
return _getData.apply(this, _args(arguments));
};
/**
* Sets the current HTML object that the Flash object should overlay. This will put the global
* Flash object on top of the current element; depending on the setup, this may also set the
* pending clipboard text data as well as the Flash object's wrapping element's title attribute
* based on the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.focus = ZeroClipboard.activate = function() {
return _focus.apply(this, _args(arguments));
};
/**
* Un-overlays the Flash object. This will put the global Flash object off-screen; depending on
* the setup, this may also unset the Flash object's wrapping element's title attribute based on
* the underlying HTML element and ZeroClipboard configuration.
*
* @returns `undefined`
* @static
*/
ZeroClipboard.blur = ZeroClipboard.deactivate = function() {
return _blur.apply(this, _args(arguments));
};
/**
* Returns the currently focused/"activated" HTML element that the Flash object is wrapping.
*
* @returns `HTMLElement` or `null`
* @static
*/
ZeroClipboard.activeElement = function() {
return _activeElement.apply(this, _args(arguments));
};
if (typeof define === "function" && define.amd) {
define(function() {
return ZeroClipboard;
});
} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
module.exports = ZeroClipboard;
} else {
window.ZeroClipboard = ZeroClipboard;
}
})(function() {
return this || window;
}()); |
app/containers/App/index.js | bhefty/react-redux-boilerplate | import React from 'react'
import Helmet from 'react-helmet'
import styled, { ThemeProvider } from 'styled-components'
import { Switch, Route } from 'react-router-dom'
import Header from 'components/Header'
import Footer from 'components/Footer'
import HomePage from 'containers/HomePage/Loadable'
import FeaturePage from 'containers/FeaturePage/Loadable'
import NotFoundPage from 'containers/NotFoundPage/Loadable'
const theme = {
primary: '#434C5E',
lightShade: '#E9E6D9',
lightAccent: '#77938D',
darkAccent: '#5472A1',
darkShade: '#1B1720',
whiteMain: '#FAFAFA'
}
const AppWrapper = styled.div`
max-width: calc(768px + 16px * 2);
margin: 0 auto;
display: flex;
min-height: calc(100vh - 150px); // min height for App wrapper should account for nav and footer
padding: 0 16px;
flex-direction: column;
`
export default function App () {
return (
<ThemeProvider theme={theme}>
<div>
<Helmet
titleTemplate='%s - React.js Boilerplate'
defaultTitle='React.js Boilerplate'
>
<meta name='description' content='A React.js Boierlplate application with Redux' />
</Helmet>
<Header />
<AppWrapper>
<Switch>
<Route exact path='/' component={HomePage} />
<Route path='/features' component={FeaturePage} />
<Route path='' component={NotFoundPage} />
</Switch>
</AppWrapper>
<Footer />
</div>
</ThemeProvider>
)
}
|
wrappers/md.js | hiasinho/trade-iq | import React from 'react'
import 'css/markdown-styles.css'
import Helmet from "react-helmet"
import { config } from 'config'
module.exports = React.createClass({
propTypes () {
return {
router: React.PropTypes.object,
}
},
render () {
const post = this.props.route.page.data
return (
<div className="markdown">
<Helmet
title={`${config.siteTitle} | ${post.title}`}
/>
<h1>{post.title}</h1>
<div dangerouslySetInnerHTML={{ __html: post.body }} />
</div>
)
},
})
|
imports/ui/components/reading/ReadingEnvironment/ReadingEnvironment.js | pletcher/cltk_frontend | import React from 'react';
import Annotatable from 'draft-js-annotations';
import PropTypes from 'prop-types';
import FlatButton from 'material-ui/FlatButton';
import baseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import LoadingWell from '/imports/ui/components/spinkit/LoadingWell';
import ReadingTextNode from '/imports/ui/components/reading/ReadingTextNode';
import ReadingWorkHeader from '/imports/ui/components/reading/ReadingWorkHeader';
class ReadingEnvironment extends React.Component {
constructor(props) {
super(props);
this.state = {
isLoading: false,
};
}
getChildContext() {
return { muiTheme: getMuiTheme(baseTheme) };
}
renderText() {
const { textNodes } = this.props;
return textNodes.map((textNode) => {
let showNumber = false;
return (
<ReadingTextNode
key={textNode.id}
showNumber={showNumber}
addAnnotationCheckList={this.addAnnotationCheckList}
toggleReadingMeta={this.props.toggleReadingMeta}
showLoginModal={this.props.showLoginModal}
showSignupModal={this.props.showSignupModal}
closeLoginModal={this.props.closeLoginModal}
closeSignupModal={this.props.closeSignupModal}
{...textNode}
/>
);
});
}
render() {
const { work, textNodes, textLocationPrev, textLocationNext } = this.props;
const form = work.form || 'prose';
return (
<div className={`reading-container reading-container--${form}`}>
<ReadingWorkHeader
work={work}
/>
{textNodes && textNodes.length ?
<div>
{textLocationPrev && textLocationPrev.length ?
<div className="reading-load-more reading-load-more--before">
<FlatButton
className={`load-more ${this.state.isLoading ? 'load-more--loading' : ''}`}
onClick={this.props.loadMore.bind(this, 'previous')}
label={this.state.isLoading ? 'Loading . . .' : 'Previous'}
/>
</div>
: '' }
<div className="reading-text-outer">
{this.renderText()}
</div>
{textLocationNext && textLocationNext.length ?
<div className="reading-load-more reading-load-more--after">
<FlatButton
className={`load-more ${this.state.isLoading ? 'load-more--loading' : ''}`}
onClick={this.props.loadMore.bind(this, 'next')}
label={this.state.isLoading ? 'Loading . . .' : 'Next'}
/>
</div>
: '' }
</div>
:
<LoadingWell />
}
</div>
);
}
}
ReadingEnvironment.propTypes = {
work: PropTypes.object.isRequired,
textNodes: PropTypes.array.isRequired,
loadMore: PropTypes.func.isRequired,
calculateTextNodeDepths: PropTypes.func.isRequired,
highlightId: PropTypes.string,
toggleReadingMeta: PropTypes.func,
isTextAfter: PropTypes.bool,
isTextBefore: PropTypes.bool,
isLoading: PropTypes.bool,
showLoginModal: PropTypes.func,
showSignupModal: PropTypes.func,
closeLoginModal: PropTypes.func,
closeSignupModal: PropTypes.func,
};
ReadingEnvironment.childContextTypes = {
muiTheme: PropTypes.object.isRequired,
};
export default ReadingEnvironment;
|
packages/idyll-components/src/boolean.js | idyll-lang/idyll | import React from 'react';
class Boolean extends React.PureComponent {
constructor(props) {
super(props);
}
toggleCheckbox() {
this.props.updateProps({
value: !this.props.value
});
}
render() {
const { value, className, style } = this.props;
return (
<input
type="checkbox"
onChange={this.toggleCheckbox.bind(this)}
onClick={this.props.onClick || (e => e.stopPropagation())}
checked={value}
className={`idyll-checkbox ${className ? className : ''}`.trim()}
style={style}
/>
);
}
}
Boolean.defaultProps = {
value: false
};
Boolean._idyll = {
name: 'Boolean',
tagType: 'closed',
props: [
{
name: 'value',
type: 'boolean',
example: 'x',
description:
'A value for the checkbox. If this value is truthy, the checkbox will be shown.'
}
]
};
export default Boolean;
|
src/components/RightPane.js | gj262/noaa-coops-viewer | import PropTypes from 'prop-types'
import React from 'react'
import YearSelector from 'components/YearSelector'
import './RightPane.scss'
export default class RightPane extends React.Component {
static propTypes = {
years: PropTypes.array,
width: PropTypes.number.isRequired
}
render () {
return (
<div className='right-pane' style={{ width: `${this.props.width}px` }}>
<YearSelector selection={this.props.years} {...this.props} />
</div>
)
}
}
|
js/lessons/lesson3/index.js | leftstick/react-lesson | 'use strict';
import React from 'react';
import DocumentLink from 'fw/DocumentLink';
import LessonTitle from 'fw/LessonTitle';
import LessonHelper from 'fw/LessonHelper';
import Preview from 'fw/Preview';
import InputBar from './InputBar';
import TextList from './TextList';
class Lesson3 extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<LessonTitle text='add input text into below list' />
<LessonHelper>
<DocumentLink link='http://facebook.github.io/react/docs/more-about-refs.html#the-ref-string-attribute' text='Read reference' />
<DocumentLink link='http://facebook.github.io/react/docs/multiple-components.html#dynamic-children' text='Read dynamic-children' />
<DocumentLink link='http://facebook.github.io/react/docs/reusable-components.html#es6-classes' text='Read reusable-components' />
</LessonHelper>
<Preview>
<InputBar/>
<TextList />
</Preview>
</div>
);
}
}
module.exports = Lesson3;
|
docs/app/Examples/elements/Button/Content/ButtonExampleConditionals.js | ben174/Semantic-UI-React | import React from 'react'
import { Button } from 'semantic-ui-react'
const ButtonExampleConditionals = () => (
<Button.Group>
<Button>Cancel</Button>
<Button.Or />
<Button positive>Save</Button>
</Button.Group>
)
export default ButtonExampleConditionals
|
packages/material-ui-icons/src/SignalCellularAltRounded.js | Kagami/material-ui | import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M18.5 4c.83 0 1.5.67 1.5 1.5v13c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5v-13c0-.83.67-1.5 1.5-1.5zm-12 10c.83 0 1.5.67 1.5 1.5v3c0 .83-.67 1.5-1.5 1.5S5 19.33 5 18.5v-3c0-.83.67-1.5 1.5-1.5zm6-5c.83 0 1.5.67 1.5 1.5v8c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5v-8c0-.83.67-1.5 1.5-1.5z" /></g></React.Fragment>
, 'SignalCellularAltRounded');
|
aadmin/includes/javascript/jquery-1.12.1.min.js | ctmusicnz/colombianespresso | /*! jQuery v1.12.1 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){
return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e);
},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
|
src/routes.js | suranartnc/isomorphic-react-redux-tutorial | import React from 'react';
import { Route, IndexRoute } from 'react-router';
import {
App,
Home,
QuestionDetail
} from './react/containers';
export default (
<Route path={`/`} component={App}>
<IndexRoute component={Home} />
<Route path={`questions/:question_id`} component={QuestionDetail} />
</Route>
); |
src/js/mixins/StoreWatchMixin.js | maxkernw/React-Flux | import React from 'react';
import AppStore from '../stores/app-store';
import DataStore from '../stores/app-store';
export default ( InnerComponent, stateCallback ) => class extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
this.state = stateCallback( props );
}
// Add change listeners to stores
componentDidMount() {
DataStore.addChangeListener(this._onChange);
}
// Remove change listers from stores
componentWillUnmount() {
DataStore.removeChangeListener(this._onChange);
}
// Method to setState based upon Store changes
_onChange(){
this.setState(stateCallback());
}
render(){
return <InnerComponent {...this.state}{...this.props} />
}
}
|
src/Parts/TablePart/index.js | sqhtiamo/zaro | import React, { Component } from 'react';
import { PropTypes } from 'prop-types';
import styles from './style';
import authFunc from '../../utils/auth';
import Loading from '../../Components/Loading';
import {
Table,
TableRow,
TableRowColumn,
TableHeaderRow,
Pagination,
Container,
Button
} from '../../Components';
import filter from '../../utils/filter';
export default class TablePart extends Component {
componentDidMount() {
if (this.page) {
this.search = this.page.search;
}
}
getRuleArray(auth, crule, key) {
if (!key) {
return false;
}
this.auth = auth;
let arr = [];
for (let i = 0; i <= crule.length; i++) {
if (crule[i] && crule[i].value && key === crule[i].value) {
// console.log(crule[i].rule);
arr = crule[i].rule;
break;
}
}
if (arr.indexOf(auth) < 0) {
return false; // 该操作不在权限内
}
return true; // 该操作在权限内
}
genHeader() {
const { itemFormat, operations } = this.props;
const opLength =
operations.filter(item => !item.auth || authFunc(item.auth)).length;
const opWidth = opLength * styles.opBtnLength;
return (
<TableHeaderRow>
{
itemFormat.map((item, idx) => {
const key = `${item.title}-${idx}`;
return (
<TableRowColumn
key={key}
columnNumber={idx}
title={item.title}
>{item.title}</TableRowColumn>
);
})
}
{
opLength ?
<TableRowColumn style={{ width: opWidth }} columnNumber={opLength}>
操作
</TableRowColumn>
:
''
}
</TableHeaderRow>
);
}
genOperations(rowIdx, item) {
const { operations, items, operationsRule } = this.props;
const relyKey = item[operationsRule.relyKey];
const crule = operationsRule.crule;
// console.log(operationsRule.crule, item[operationsRule.relyKey]);
const map = {
add: '新增',
delete: '删除',
dateil: '查看',
update: '编辑',
};
// 操作对象不存在,return null
if (operations.length === 0) {
return null;
}
return (
<TableRowColumn columnNumber={1}>
{
operations.map((op) => {
if (op.auth && !authFunc(op.auth)) {
return null;
}
// console.log(this.getRuleArray(op.auth, crule, relyKey))
if (crule && !this.getRuleArray(op.auth, crule, relyKey)) {
return null;
}
if (op.type) {
const func = () => {
if (op.url) {
console.log(`跳转${op.url}`);
} else {
op.func(rowIdx, items[rowIdx], this.search);
}
};
return (
<Button
key={`${rowIdx}-${op.type}`}
style={styles.opBtn}
text={map[op.type]}
onClick={func}
idx={rowIdx}
type={['primary', 'small']}
/>
);
}
const func = () => {
op.func(rowIdx, items[rowIdx], this.search);
};
return (
<Button
key={`${rowIdx}-${op.text}`}
text={op.text}
onClick={func}
style={styles.opBtn}
type={['primary', 'small']}
/>
);
})
}
</TableRowColumn>
);
}
genRows() {
const { items, itemFormat } = this.props;
return items.map((item, rowIdx) => {
const rowKey = `rowKey${rowIdx}`;
return (
<TableRow
key={rowKey}
rowNumber={rowIdx}
>
{
itemFormat.map((config, colIdx) => {
const { format, key, after } = config;
const value = format ? filter(format, item[key]) : item[key];
const tAfter = (value && after) ? (after) : '';
return (
<TableRowColumn
key={key}
columnNumber={colIdx}
title={value}
>{value}{tAfter}</TableRowColumn>
);
})
}
{
this.genOperations(rowIdx, item)
}
</TableRow>
);
});
}
render() {
const {
isLoading,
title,
minWidth,
beforeSearch,
success,
searchParams,
url,
items,
showPage
} = this.props;
const paginationStyle = Object.assign({}, styles.pagination);
if (!items.length) {
paginationStyle.display = 'none';
}
return (
<div>
{
<Container
title={title}
>
{
isLoading ?
<Loading />
:
<Table hoverable center style={minWidth ? { minWidth } : {}} >
{this.genHeader()}
{this.genRows()}
</Table>
}
{
!items.length && !isLoading ?
<div style={styles.empty}>列表为空</div>
:
null
}
{
showPage ?
<Pagination
url={url}
beforeSearch={beforeSearch}
success={success}
searchParams={searchParams}
style={paginationStyle}
ref={(item) => {
this.page = item;
}}
/>
: ''
}
</Container>
}
</div>
);
}
}
TablePart.propTypes = {
title: PropTypes.string,
url: PropTypes.string.isRequired,
items: PropTypes.arrayOf(PropTypes.shape()).isRequired,
itemFormat: PropTypes.arrayOf(PropTypes.shape()).isRequired,
operations: PropTypes.arrayOf(PropTypes.shape()),
operationsRule: PropTypes.shape(),
isLoading: PropTypes.bool,
minWidth: PropTypes.number,
beforeSearch: PropTypes.func,
success: PropTypes.func,
searchParams: PropTypes.shape(),
showPage: PropTypes.bool
};
TablePart.defaultProps = {
title: '查询结果',
url: '',
isLoading: false,
operations: [],
operationsRule: {},
minWidth: null,
success: () => {},
beforeSearch: () => {},
searchParams: {},
showPage: true
};
|
app/containers/HomePage.js | thomasantony/budget-app-legacy | import React, { Component } from 'react';
import Home from '../containers/Home';
export default class HomePage extends Component {
render() {
return (
<Home />
);
}
}
|
packages/reactive-dict/migration.js | GrimDerp/meteor | ReactiveDict._migratedDictData = {}; // name -> data
ReactiveDict._dictsToMigrate = {}; // name -> ReactiveDict
ReactiveDict._loadMigratedDict = function (dictName) {
if (_.has(ReactiveDict._migratedDictData, dictName))
return ReactiveDict._migratedDictData[dictName];
return null;
};
ReactiveDict._registerDictForMigrate = function (dictName, dict) {
if (_.has(ReactiveDict._dictsToMigrate, dictName))
throw new Error("Duplicate ReactiveDict name: " + dictName);
ReactiveDict._dictsToMigrate[dictName] = dict;
};
if (Meteor.isClient && Package.reload) {
// Put old migrated data into ReactiveDict._migratedDictData,
// where it can be accessed by ReactiveDict._loadMigratedDict.
var migrationData = Package.reload.Reload._migrationData('reactive-dict');
if (migrationData && migrationData.dicts)
ReactiveDict._migratedDictData = migrationData.dicts;
// On migration, assemble the data from all the dicts that have been
// registered.
Package.reload.Reload._onMigrate('reactive-dict', function () {
var dictsToMigrate = ReactiveDict._dictsToMigrate;
var dataToMigrate = {};
for (var dictName in dictsToMigrate)
dataToMigrate[dictName] = dictsToMigrate[dictName]._getMigrationData();
return [true, {dicts: dataToMigrate}];
});
}
|
test/specs/elements/Step/StepGroup-test.js | clemensw/stardust | import faker from 'faker'
import React from 'react'
import * as common from 'test/specs/commonTests'
import Step from 'src/elements/Step/Step'
import StepGroup from 'src/elements/Step/StepGroup'
describe('StepGroup', () => {
common.isConformant(StepGroup)
common.hasUIClassName(StepGroup)
common.propKeyOnlyToClassName(StepGroup, 'fluid')
common.propKeyOnlyToClassName(StepGroup, 'ordered')
common.propKeyAndValueToClassName(StepGroup, 'stackable')
common.propKeyOnlyToClassName(StepGroup, 'vertical')
describe('renders children', () => {
const firstText = faker.hacker.phrase()
const secondText = faker.hacker.phrase()
it('with `children` prop', () => {
const wrapper = mount(
<StepGroup>
<Step>{firstText}</Step>
<Step>{secondText}</Step>
</StepGroup>
)
.find('Step')
wrapper.first().should.contain.text(firstText)
wrapper.last().should.contain.text(secondText)
})
it('with `items` prop', () => {
const items = [
{ title: firstText },
{ title: secondText },
]
const wrapper = mount(<StepGroup items={items} />).find('Step')
wrapper.first().find('StepTitle').should.contain.text(firstText)
wrapper.last().find('StepTitle').should.contain.text(secondText)
})
})
})
|
src/website/app/demos/Dropdown/Dropdown/examples/rtl.js | mineral-ui/mineral-ui | /* @flow */
import styled from '@emotion/styled';
import React from 'react';
import Button from '../../../../../../library/Button';
import Dropdown from '../../../../../../library/Dropdown';
import { pxToEm } from '../../../../../../library/styles';
import { ThemeProvider } from '../../../../../../library/themes';
import data from '../../../Menu/common/menuData';
import type { StyledComponent } from '@emotion/styled-base/src/utils';
const Root: StyledComponent<{ [key: string]: any }> = styled('div')({
paddingBottom: pxToEm(130)
});
const DemoLayout = (props: Object) => <Root {...props} />;
export default {
id: 'rtl',
title: 'Bidirectionality',
description: `Dropdowns support right-to-left (RTL) languages. The placement of
the menu as well as the menu itself will be reversed when the \`direction\`
theme variable is set to \`rtl\`.`,
scope: { Button, data, DemoLayout, Dropdown, ThemeProvider },
source: `
<DemoLayout dir="rtl">
<ThemeProvider theme={{ direction: 'rtl' }}>
<Dropdown data={data} isOpen>
<Button>Menu</Button>
</Dropdown>
</ThemeProvider>
</DemoLayout>`
};
|
client/src/index.js | mrfrederico-ist/the-code-venture-fullstack-challenge | import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import {
createNetworkInterface,
ApolloClient,
ApolloProvider,
} from 'react-apollo'
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import './index.css'
import reducers from './reducers'
import requireAuth from './components/requireAuth'
import App from './components/App'
import Login from './components/Login'
import registerServiceWorker from './utils/registerServiceWorker'
const dataIdFromObject = obj => {
if (obj.__typename) {
if (obj.id !== undefined) {
return `${obj.__typename}:${obj.id}`
}
}
return null
}
const networkInterface = createNetworkInterface({
uri: 'http://localhost:4000/graphql',
opts: { credentials: 'include' },
})
export const apolloClient = new ApolloClient({
networkInterface,
dataIdFromObject,
})
const store = createStore(reducers, {}, applyMiddleware(thunk))
// ====================
ReactDOM.render(
<ApolloProvider client={apolloClient} store={store}>
<BrowserRouter>
<Switch>
<Route path="/" exact component={requireAuth(App)} />
<Route path="/login" exact component={Login} />
</Switch>
</BrowserRouter>
</ApolloProvider>,
document.getElementById('root'),
)
// ===================
registerServiceWorker()
|
app/components/FetchView/index.js | zmora-agh/zmora-ui | /**
*
* FetchView
*
*/
import React from 'react';
import { CircularProgress } from 'material-ui/Progress';
function FetchView(props) {
return props.children !== undefined ?
props.children :
<div style={{ textAlign: 'center', margin: '50px auto' }}><CircularProgress size={50} /></div>;
}
FetchView.propTypes = {
children: React.PropTypes.node,
};
export default FetchView;
|
app/assets/javascripts/components/Shared/TopBar.js | jennyyuejin/projectFox | var React = require('react');
var $ = require('jquery');
var Router = require('react-router');
var RouteHandler = Router.RouteHandler;
var Icon = require ('react-fa');
var Link = Router.Link;
// Others
var DropdownButton = require('react-bootstrap').DropdownButton;
var MenuItem = require('react-bootstrap').MenuItem;
var Button = require('react-bootstrap').Button;
var TimerMixin = require('react-timer-mixin');
// Actions
var AppActions = require('../../actions/AppActions');
var SessionActions = require('../../actions/SessionActions');
// Components
var SignInForm = require('./SignInForm');
var SignUpForm = require('./SignUpForm');
var TopBar = React.createClass({
displayName: 'TopBar',
mixins: [Router.Navigation],
toSubmit: function(){
if(this.props.session.isLoggedIn){
this.transitionTo('submit');
} else {
this.props.toggleSignIn();
}
},
render: function() {
var signInBtn, signUpBtn, submitBtn;
var avatar = this.props.session.userInfo ? this.props.session.userInfo.avatar : null;
if (!this.props.session.isLoggedIn){
signInBtn = <li className="cta tab">
<a onClick={this.props.toggleSignIn} >Sign In / Sign Up</a>
</li>;
notifications = null;
} else {
signInBtn = <UsrDropDown avatar={avatar} />;
notifications = <Notification />;
}
return (
<nav className="navbar navbar-default">
<div className="container-fluid">
<div className="navbar-header">
<a className="navbar-brand" href="#">
<img alt="PROJECTFOX" src="" />
</a>
</div>
</div>
<div style={{"height": "70px", "position":"relative", "zIndex":"1", "background":"white"}}>
<ul id="gn-menu" className="gn-menu-main" style={{"background": "rgba(255,255,255,0.5)"}}>
{/* <IconMenu /> */}
{/* <Logo /> */}
{/* <Lang /> */}
{signInBtn}
{/* {notifications} */}
</ul>
</div>
</nav>
);
}
});
//Notifications Button
var Notification_timer;
var Notification = React.createClass({
getInitialState: function () {
return {
open:false,
};
},
mixins: [TimerMixin],
mouseOverhandler: function() {
this.clearTimeout(Notification_timer);
this.setState({open:true});
},
mouseOuthandler: function() {
Notification_timer = this.setTimeout(
()=> {this.setState ({open:false});},
50
);
},
render: function() {
var tabopen = "cta tab";
if (this.state.open)
{
tabopen = "cta tab open";
}
else
{
tabopen = "cta tab";
}
return (
<li onMouseOver={this.mouseOverhandler} onMouseOut={this.mouseOuthandler} className={tabopen}>
<a className="dropdown-toggle" type="button" id="notification-dropdown" data-toggle="dropdown" aria-expanded="false">
<span id="notification-badge" className="badge badge-navbar " style={{"fontSize": "inherit"}}><span className="fa fa-bell"></span><span className="num_unread" style={{"fontSize": "14px"}}> </span></span>
</a>
<ul className="dropdown-menu notifications" role="menu" aria-labelledby="notification-dropdown" style={{"maxWidth": "380px", "right": "0"}}>
<li id="notification-list" style={{"overflowY":"scroll","maxHeight":"400px","padding":"10px 20px"}}>
<div style={{"lineHeight": "30px"}}>
You have no unread notifications
</div>
</li>
<li className="divider"></li>
<li><a href="/notifications/mark_all_read" data-remote="true" style={{"padding":"10px 20px"}}><p>Mark all as read</p></a></li>
<li><a href="/notifications" style={{"padding":"10px 20px"}}><p>All Notifications</p></a></li>
</ul>
</li>
);
}
});
//User Dropdown Button
var UsrDropDown_timer;
var UsrDropDown = React.createClass({
mixins: [TimerMixin, Router.Navigation, Router.State],
getInitialState: function () {
return {
open:false,
};
},
// mouseOnClick: function () {
// this.setState({open:true});
// },
// mouseOnOut: function () {
// this.setState ({open:false});
// },
mouseOverhandler: function() {
this.clearTimeout(UsrDropDown_timer);
this.setState({open:true});
},
mouseOuthandler: function() {
UsrDropDown_timer = this.setTimeout(
()=> {this.setState ({open:false});},
50
);
},
signOut: function(){
SessionActions.logout();
// console.log(this.getPath());
// if(this.getPath() == "/p/new"){
// this.transitionTo('home');
// }
},
render: function() {
var tabopen = "cta tab";
if (this.state.open)
{
tabopen = "cta tab open";
}
else
{
tabopen = "cta tab";
}
return (
<li onMouseOver={this.mouseOverhandler} onMouseOut={this.mouseOuthandler} className={tabopen}>
<a className="dropdown-toggle" type="button" id="dropdownMenuDivider" data-toggle="dropdown" aria-expanded="true">
<div style={{"position":"relative", "display":"inline"}}>
<img className="gravatar" data-toggle="popover" height="30" src={this.props.avatar} style={{"marginRight": "0"}} width="30"/>
<span className="caret"></span>
</div>
</a>
<ul className="dropdown-menu" role="menu" aria-labelledby="dropdownMenuDivider" style={{"right":"0"}}>
<li role="presentation"><a role="menuitem" tabIndex="-1" onClick={this.signOut} style={{"padding":"10px 20px"}}><p>Sign Out</p></a></li>
</ul>
</li>);
}
});
module.exports = TopBar;
|
dapp/src/shared/components/app/add.js | airalab/DAO-IPCI | import React from 'react'
import { Field } from 'redux-form'
const renderField = ({
input, type, label, placeholder, disabled, className, meta: { touched, error }
}) => {
if (type === 'hidden') {
return <input {...input} type={type} />
}
return (
<div>
{label}
<input
{...input}
className={className}
type={type}
placeholder={placeholder}
disabled={disabled}
/>
{touched && error && error}
</div>
)
}
const Form = (props) => {
const { fields, handleSubmit, submitting } = props
// {address.touched && address.error ? <div className="alert alert-danger">
// {address.error}</div> : ''}
return (
<form onSubmit={handleSubmit}>
<div className="input-group">
<div className="input-group-addon"><span>DAO address</span></div>
{fields.map((item, index) => (
<Field key={index} component={renderField} {...item} type="text" className="form-control" />
))}
<div className="input-group-btn">
<button className="btn btn-default" type="submit" disabled={submitting}>{submitting ? '...' : 'Go!'}</button>
</div>
</div>
</form>
)
}
export default Form
|
L10_CameraRollPicker/__tests__/index.android.js | kobkrit/learn-react-native | import 'react-native';
import React from 'react';
import Index from '../index.android.js';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});
|
weather/src/components/chart.js | williampuk/ReduxCasts | import _ from 'lodash';
import React from 'react';
import { Sparklines, SparklinesLine, SparklinesReferenceLine } from 'react-sparklines';
function average(data) {
return _.round(_.sum(data)/data.length);
}
export default (props) => {
return (
<div>
<Sparklines height={120} width={180} data={props.data}>
<SparklinesLine color={props.color} />
<SparklinesReferenceLine type="avg" />
</Sparklines>
<div>{average(props.data)} {props.units}</div>
</div>
);
}
|
packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js | jdcrensh/create-react-app | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { ReactComponent as Logo } from './assets/logo.svg';
const SvgComponent = () => {
return <Logo id="feature-svg-component" />;
};
export const SvgComponentWithRef = React.forwardRef((props, ref) => (
<Logo id="feature-svg-component-with-ref" ref={ref} />
));
export default SvgComponent;
|
src/script/pages/NotFound.js | neikvon/fbi-template-react | import React from 'react';
let NotFound = React.createClass({
render: function() {
return (
<div>
<h1>404!</h1>
对不起,页面没找到 :/
</div>
);
}
});
module.exports = NotFound;
|
app/assets/scripts/components/page-footer.js | openaq/openaq.github.io | 'use strict';
import React from 'react';
import { IndexLink, Link } from 'react-router';
import { formatThousands } from '../utils/format';
var PageFooter = React.createClass({
displayName: 'PageFooter',
propTypes: {
measurements: React.PropTypes.number
},
render: function () {
let copyright = this.props.measurements !== null
? `${formatThousands(this.props.measurements)} measurements captured`
: 'Built';
return (
<footer className='page__footer' role='contentinfo'>
<div className='inner'>
<nav className='page__foot-nav'>
<div className='foot-nav-block'>
<h1 className='page__foot-title'>
<IndexLink to='/' title='Visit homepage'>
<img src='/assets/graphics/layout/oaq-logo-col-pos.svg' alt='OpenAQ logotype' width='72' height='40' />
<span>OpenAQ</span>
</IndexLink>
</h1>
<h2 className='contact__title'>Connect with us</h2>
<ul className='connect-menu'>
<li><a href='https://github.com/openaq/' className='connect-menu__link--github' title='View Github' target='_blank'><span>Github</span></a></li>
<li><a href='https://openaq-slackin.herokuapp.com/' className='connect-menu__link--slack' title='View Slack' target='_blank'><span>Slack</span></a></li>
<li><a href='https://twitter.com/openaq' className='connect-menu__link--twitter' title='View Twitter' target='_blank'><span>Twitter</span></a></li>
<li><a href='mailto:[email protected]' className='connect-menu__link--email' title='View Email'><span>Email</span></a></li>
</ul>
</div>
<div className='foot-nav-block'>
<h2 className='contact__title'>Get involved</h2>
<ul className='foot-menu'>
<li><Link to='/community' title='View page'>Participate</Link></li>
<li><Link to='/community' title='View page'>Support our mission</Link></li>
</ul>
</div>
<div className='foot-nav-block'>
<h2 className='contact__title'>Open data</h2>
<ul className='foot-menu'>
<li><Link to='/locations' title='View page'>Locations</Link></li>
<li><Link to='/countries' title='View page'>Countries</Link></li>
<li><Link to='/map' title='View page'>World map</Link></li>
<li><a href='https://docs.openaq.org/' title='View API' target='_blank'>Use API</a></li>
<li><a href='https://medium.com/@openaq/where-does-openaq-data-come-from-a5cf9f3a5c85' title='View blog post' target='_blank'>License and data disclaimer</a></li>
</ul>
</div>
<div className='foot-nav-block'>
<h2 className='contact__title'>Community</h2>
<ul className='foot-menu'>
<li><Link to='/community' title='View page'>About the community</Link></li>
<li><Link to='/community/projects?type=Developer+tools' title='View page'>Data tools</Link></li>
<li><Link to='/community/projects' title='View page'>Community impact</Link></li>
<li><Link to='/community/workshops' title='View page'>Workshops</Link></li>
</ul>
</div>
<div className='foot-nav-block'>
<h2 className='contact__title'>About</h2>
<ul className='foot-menu'>
<li><Link to='/about' title='View page'>Our organization</Link></li>
<li><a href='https://medium.com/@openaq' title='View blog' target='_blank'>Blog</a></li>
<li><Link to='/about' title='View page'>Contact</Link></li>
<li><a href='https://github.com/openaq/openaq-info/blob/master/FAQ.md' title='View FAQs'>FAQs</a></li>
</ul>
</div>
</nav>
<div className='foot-info'>
<div className='foot-newsletter'>
<h2>Subscribe to our newsletter</h2>
<form ref='newsletterForm' action='//openaq.us10.list-manage.com/subscribe/post?u=ca93b2911fff40db15f6e7203&id=e65a8618a1' method='post' id='mc-embedded-subscribe-form' name='mc-embedded-subscribe-form' target='_blank' noValidate>
<div className='form__input-group'>
<input type='email' name='EMAIL' id='mce-EMAIL' placeholder='[email protected]' className='form__control form__control--medium' required />
<span className='form__input-group-button'><button className='button--subscribe' type='submit' onClick={() => this.refs.newsletterForm.reset()}><span>Subscribe</span></button></span>
</div>
{/* real people should not fill this in and expect good things - do not remove this or risk form bot signups */}
<div style={{ position: 'absolute', left: '-5000px' }} aria-hidden='true'>
<input type='text' name='b_ca93b2911fff40db15f6e7203_e65a8618a1' tabIndex='-1' value='' />
</div>
</form>
</div>
<p className='foot-copyright'>{copyright} with love by <a href='https://openaq.org/' title='Visit the OpenAQ website'>OpenAQ</a>.</p>
</div>
</div>
</footer>
);
}
});
module.exports = PageFooter;
|
src/components/capture/capture-modal/CategoryInput.js | sebpearce/cycad-react | import React from 'react';
import styles from './CaptureModal.scss';
class CategoryInput extends React.Component {
render() {
const suffix = this.props.categoryWarning ? 'Warning' : '';
const className = styles['categoryPickerInput' + suffix];
return (
<div className={styles.categoryPicker}>
<label>{'Category'}</label>
<input
type="text"
autoFocus="true"
className={className}
onChange={this.props.handleSearchStringChange}
value={this.props.categoryInput}
ref={(input) => { this.categoryInput = input; }}
onFocus={this.props.handleFocus}
/>
</div>
);
}
}
CategoryInput.propTypes = {
categoryInput: React.PropTypes.string.isRequired,
handleSearchStringChange: React.PropTypes.func.isRequired,
handleFocus: React.PropTypes.func.isRequired,
categoryWarning: React.PropTypes.bool.isRequired,
}
export default CategoryInput;
|
src/molecules/formfields/CreditCardField/index.js | policygenius/athenaeum | import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Icon from 'atoms/Icon';
import ErrorMessage from 'atoms/ErrorMessage';
import styles from './credit_card_field.module.scss';
function CreditCardField(props) {
const {
className,
cardType,
creditCardNumber,
expirationDate,
input,
label,
meta,
securityCode,
} = props;
const showErrorMessage = (meta.visited && !meta.active) || meta.submitFailed;
const classes = classnames(
styles['credit-card'],
meta && meta.active && styles['focused'],
meta && showErrorMessage && meta.error && !meta.active && styles['hasError'],
className,
);
const message = meta && showErrorMessage && (meta.error || meta.warning);
return (
<div>
<div
className={classes}
onBlur={(e) => {
if (!e.relatedTarget) input.onBlur();
}}
onFocus={input.onFocus}
>
<div className={styles['header']}>
{ /* eslint-disable-next-line jsx-a11y/label-has-for */ }
<label htmlFor='date' className={styles['label']}>
{ label }
</label>
<Icon className={styles['icon-lock']} icon='lock' />
</div>
<div className={styles['line-1']}>
{ creditCardNumber }
<Icon className={styles['icon-logo']} icon={cardType} />
</div>
<div className={styles['line-2']}>
<div className={styles['col']}>{ expirationDate }</div>
<div className={styles['col']}>{ securityCode }</div>
</div>
</div>
<ErrorMessage
condition={!!message}
message={message}
/>
</div>
);
}
CreditCardField.propTypes = {
/**
* This prop will add a new className to any inherent classNames
* provided in the component's index.js file.
*/
className: PropTypes.string,
/**
* Label.
*/
label: PropTypes.string,
/**
* Credit card form field.
*/
creditCardNumber: PropTypes.node,
/**
* Expiration Date form field.
*/
expirationDate: PropTypes.node,
/**
* Security Code form field.
*/
securityCode: PropTypes.node,
/**
* Create Logo of credit card. Accepted Cards ['visa', 'americanExpress', 'masterCard', `discover`]
*/
cardType: PropTypes.string,
/**
* Redux Form meta prop for touched, error, active
*/
meta: PropTypes.object,
/**
* Redux form input object
*/
input: PropTypes.object.isRequired,
};
CreditCardField.defaultProps = {
// Place any default props here.
cardType: 'visa',
label: 'Credit Card Information',
};
export default CreditCardField;
|
app/javascript/mastodon/components/autosuggest_emoji.js | Nyoho/mastodon | import React from 'react';
import PropTypes from 'prop-types';
import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light';
import { assetHost } from 'mastodon/utils/config';
export default class AutosuggestEmoji extends React.PureComponent {
static propTypes = {
emoji: PropTypes.object.isRequired,
};
render () {
const { emoji } = this.props;
let url;
if (emoji.custom) {
url = emoji.imageUrl;
} else {
const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')];
if (!mapping) {
return null;
}
url = `${assetHost}/emoji/${mapping.filename}.svg`;
}
return (
<div className='autosuggest-emoji'>
<img
className='emojione'
src={url}
alt={emoji.native || emoji.colons}
/>
{emoji.colons}
</div>
);
}
}
|
react-flux-mui/js/material-ui/docs/src/app/components/pages/components/FontIcon/Page.js | pbogdan/react-flux-mui | import React from 'react';
import Title from 'react-title-component';
import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import iconCode from '!raw!material-ui/FontIcon/FontIcon';
import iconReadmeText from './README';
import IconExampleSimple from './ExampleSimple';
import iconExampleSimpleCode from '!raw!./ExampleSimple';
import IconExampleIcons from './ExampleIcons';
import iconExampleIconsCode from '!raw!./ExampleIcons';
const descriptions = {
custom: 'This example uses a custom font (not part of Material-UI). The `className` defines the specific ' +
'icon. The third example has a `hoverColor` defined.',
public: 'This example uses the [Material icons font]' +
'(http://google.github.io/material-design-icons/#icon-font-for-the-web), referenced in the `<head>` of the docs ' +
'site index page. The `className` defines the font, and the `IconFont` tag content defines the specific icon.',
};
const FontIconPage = () => (
<div>
<Title render={(previousTitle) => `Font Icon - ${previousTitle}`} />
<MarkdownElement text={iconReadmeText} />
<CodeExample
title="Custom icon font"
description={descriptions.custom}
code={iconExampleSimpleCode}
>
<IconExampleSimple />
</CodeExample>
<CodeExample
title="Public icon font"
description={descriptions.public}
code={iconExampleIconsCode}
>
<IconExampleIcons />
</CodeExample>
<PropTypeDescription code={iconCode} />
</div>
);
export default FontIconPage;
|
packages/components/src/List/ListComposition/LazyLoadingList/LazyLoadingList.component.js | Talend/ui | import React from 'react';
import PropTypes from 'prop-types';
import { InfiniteLoader } from 'react-virtualized';
import debounce from 'lodash/debounce';
import VList from '../VList';
import { useListContext } from '../context';
const DEFAULT_THRESHOLD = 5;
const DEFAULT_MIN_BATCH_SIZE = 20;
const DEFAULT_DEBOUNCE_DELAY = 0;
function LazyLoadingList(props) {
const {
rowCount,
threshold,
minimumBatchSize,
loadMoreRows,
debounceDelay,
onRowsRendered: parentOnRowsRendered,
...rest
} = props;
const { collection } = useListContext();
const isRowLoaded = ({ index }) => collection && collection[index];
let loadMoreRowsCallback = loadMoreRows;
if (loadMoreRowsCallback && debounceDelay) {
loadMoreRowsCallback = debounce(loadMoreRowsCallback, debounceDelay);
}
return (
<InfiniteLoader
isRowLoaded={isRowLoaded}
loadMoreRows={loadMoreRowsCallback}
minimumBatchSize={minimumBatchSize}
rowCount={rowCount}
threshold={threshold}
>
{({ onRowsRendered, registerChild }) => {
function combinedOnRowsRendered(...args) {
if (parentOnRowsRendered) {
parentOnRowsRendered(...args);
}
onRowsRendered(...args);
}
return (
<VList
registerChild={registerChild}
onRowsRendered={combinedOnRowsRendered}
rowCount={rowCount}
{...rest}
/>
);
}}
</InfiniteLoader>
);
}
LazyLoadingList.defaultProps = {
threshold: DEFAULT_THRESHOLD,
minimumBatchSize: DEFAULT_MIN_BATCH_SIZE,
debounceDelay: DEFAULT_DEBOUNCE_DELAY,
};
if (process.env.NODE_ENV !== 'production') {
LazyLoadingList.propTypes = {
loadMoreRows: PropTypes.func.isRequired,
onRowsRendered: PropTypes.func,
rowCount: PropTypes.number,
threshold: PropTypes.number,
minimumBatchSize: PropTypes.number,
debounceDelay: PropTypes.number,
};
}
export default LazyLoadingList;
|
src/index.js | publicJorn/floatingmenu | require('./main.less');
import React from 'react';
import { render } from 'react-dom';
import { FloatingMenu, findMenuItemsInDom } from './FloatingMenu/FloatingMenu';
render(
<FloatingMenu menuItems={findMenuItemsInDom()} open={false} />,
document.querySelector('.jsFloatingMenuContainer')
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.